herolib-mos

Crates.ioherolib-mos
lib.rsherolib-mos
version0.3.13
created_at2025-12-27 20:03:51.3983+00
updated_at2026-01-24 05:32:47.468124+00
descriptionMycelium Operating System (MOS) - Network and VM abstraction layer
homepage
repositoryhttps://github.com/herolib/herolib_rust
max_upload_size
id2007732
size478,245
kristof de spiegeleer (despiegk)

documentation

README

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.

Commit count: 0

cargo fmt