12 releases
Uses new Rust 2024
| 0.3.13 | Jan 24, 2026 |
|---|---|
| 0.3.12 | Jan 22, 2026 |
| 0.3.4 | Dec 31, 2025 |
| 0.2.0 | Dec 27, 2025 |
#562 in Operating systems
Used in herolib-do
1MB
20K
SLoC
herolib-mos
Network and VM abstraction layer for the HeroLib library, combined with system information and OS detection capabilities.
Features
Network & VM Management
- Network Namespace Management: Create, manage, and delete network namespaces
- Bridge Operations: Create and manage Linux bridge devices
- Virtual Ethernet (veth) Pairs: Create and configure veth pairs for network isolation
- Interface Configuration: Set IP addresses, bring interfaces up/down, attach to bridges
- Routing Management: Add and delete routes, manage routing tables
- Mycelium Integration: Setup and manage mycelium overlay networks
- Cloud Hypervisor VM Management: Complete VM lifecycle control with Rhai scripting support
System Information
- OS Detection & Analysis: Identify OS type, distribution, version, kernel configuration, uptime, and timezone
- Hardware Profiling: CPU info, memory, storage, network interfaces, GPU, USB/PCI devices
- System Capabilities: Virtualization support (KVM/Xen), container runtime availability (Docker/Podman), systemd, cgroups, filesystems
- Performance Metrics: Real-time CPU/memory usage, disk usage, network statistics, temperatures, load averages
- GeoIP & NTP: Geolocation services and time synchronization status
MyFS Filesystem Management
- FUSE Filesystem Operations: Mount and manage MyFS filesystems with FUSE integration
- Image Packing: Create MyFS filesystem images from directories with metadata and content stores
- Image Unpacking: Extract MyFS filesystem images to target directories with caching support
- Mount Point Management: Automatic mount point creation, validation, and status checking
- Error Handling: Comprehensive error reporting for FUSE availability, permissions, and mount failures
Installation
Add to your Cargo.toml:
[dependencies]
herolib-mos = "0.3.5"
For Rhai scripting support:
[dependencies]
herolib-mos = { version = "0.3.5", features = ["rhai"] }
Usage
Rust API
use herolib_mos::network::{bridge, interface, namespace};
use herolib_mos::myfs;
// Create a bridge
let bridge = bridge::create_bridge("br0")?;
// Create a veth pair
let veth = interface::create_veth_pair("veth0", "veth1", 1500, "")?;
// Create a network namespace
let ns = namespace::create_namespace("test-ns")?;
Rhai Scripting
Rhai Scripting
// Create a bridge
let bridge = create_bridge("br0");
print(`Bridge created: ${bridge.name}`);
// Show System Dashboard
print("Displaying system status dashboard...");
print_system_status();
// Create veth pair
let veth = create_veth_pair("veth0", "veth1", 1500);
// Set IP address
set_ip_address("veth0", "10.0.0.1/24");
// Bring interface up
interface_set_up("veth0");
Examples
See the rhaiexamples/mos/ directory for complete examples.
Dependencies
~51–94MB
~1.5M SLoC