2025-12-18 21:07:59 -05:00
# 🚀 MNMIVM-SE (Server Edition)
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
### *A LAN-Native VM Cloud with a Minimal Control Plane*
2025-12-15 21:06:22 -05:00
2025-12-21 23:50:22 +00:00

2025-12-15 21:06:22 -05:00
2025-12-21 23:43:22 +00:00
## Demo Video
2025-12-22 00:04:28 +00:00
<video controls src="https://mentalnet.xyz/forgejo/markmental/mnmivm-se/raw/branch/master/assets/output.mp4">
Your browser does not support the video tag. Video is available in /assets/output.mp4
2025-12-21 23:43:22 +00:00
</video>
2025-12-22 00:04:28 +00:00
**MNMIVM-SE** is the **server-focused edition ** of MNMIVM
(https://mentalnet.xyz/forgejo/markmental/mnmivm-se) — a minimal, single-binary VM launcher built on **QEMU + KVM + cloud-init ** that turns your **LAN into a local VM cloud ** .
2025-12-21 23:43:22 +00:00
2025-12-22 00:04:28 +00:00
Unlike traditional platforms, MNMIVM-SE exposes raw infrastructure primitives directly:
2025-12-18 21:07:59 -05:00
bridges, TAP devices, MAC addresses, static IPs, and Linux processes.
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
> Your LAN is the fabric.
> The kernel is the scheduler.
> The CLI is the control plane.
2025-12-15 21:06:22 -05:00
---
2025-12-18 21:07:59 -05:00
## ☁️ What MNMIVM-SE Is
2025-12-15 21:06:22 -05:00
2025-12-22 00:04:28 +00:00
- A **local VM cloud ** built directly on your LAN
- A **process-native control plane **
- A **CLI-first infrastructure tool **
- A Proxmox-style networking model **without Proxmox **
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
Each VM:
- Has a persistent MAC address
- Has a static IP on your LAN
- Appears as a first-class network device
- Can host real infrastructure services (DNS, CI, storage, routing, etc.)
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
Routers, firewalls, and switches see MNMIVM-SE VMs as **real machines ** , not NAT artifacts.
2025-12-15 21:06:22 -05:00
---
2025-12-18 21:07:59 -05:00
## 🧠 Control Plane Model
2025-12-22 00:04:28 +00:00
MNMIVM-SE **does have a control plane ** , but it is intentionally **minimal, local, and explicit ** .
2025-12-18 21:07:59 -05:00
2025-12-22 00:04:28 +00:00
- Single CLI binary
- File-backed state
2025-12-18 21:07:59 -05:00
- Linux process lifecycle tracking
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
There is:
2025-12-22 00:04:28 +00:00
- No daemon
2025-12-18 21:07:59 -05:00
- No API server
- No database
- No reconciliation loop
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
Instead:
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
- VM lifecycle = Linux process lifecycle
- State = files under `/var/lib/microvm`
- Configuration changes = cloud-init regeneration
- Access = SSH + VNC
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
> The filesystem is the state store.
> `/proc` is the source of truth.
> Each CLI command is a deliberate control action.
2025-12-15 21:06:22 -05:00
---
2025-12-18 21:07:59 -05:00
## 🧱 Supported Host Operating Systems
### ✅ Supported
| Host OS | Version |
|------|---------|
2025-12-22 00:04:28 +00:00
| Debian | 12+ |
| Alpine Linux | 3.22+ |
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
### 🕒 Coming Soon
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
| Host OS | Notes |
|------|------|
2025-12-22 00:04:28 +00:00
| Ubuntu | Netplan-based host networking planned |
2025-12-18 21:07:59 -05:00
2025-12-22 00:04:28 +00:00
Ubuntu is undocumented for now due to netplan differences, but it should not be much different in setting up a bridged network interface.
2025-12-18 21:07:59 -05:00
### ❌ Not Supported
- Wi-Fi– only hosts
- WSL / nested hypervisors
2025-12-22 00:04:28 +00:00
- Desktop NAT-based setups
2025-12-15 21:06:22 -05:00
---
2025-12-22 00:04:28 +00:00
## 📦 Debian Host Requirements (12+)
Install required packages:
```bash
sudo apt update
sudo apt install -y \
qemu-system-x86 \
golang \
qemu-utils \
qemu-bridge-helper \
cloud-image-utils \
genisoimage \
bridge-utils \
iproute2 \
iptables \
curl \
ca-certificates \
git \
build-essential
````
Optional but recommended:
2025-12-15 21:06:22 -05:00
2025-12-22 00:04:28 +00:00
```bash
sudo apt install -y cpu-checker
kvm-ok
```
2025-12-15 21:06:22 -05:00
2025-12-22 00:04:28 +00:00
Ensure KVM is available:
```bash
ls -l /dev/kvm
2025-12-15 21:06:22 -05:00
```
2025-12-18 21:07:59 -05:00
2025-12-22 00:04:28 +00:00
---
## 🔌 TUN/TAP Kernel Module (Required)
MNMIVM-SE requires the **TUN/TAP ** kernel module.
Verify:
```bash
ls -l /dev/net/tun
```
If missing:
```bash
sudo modprobe tun
```
Persist on boot:
### Debian
```bash
echo tun | sudo tee /etc/modules-load.d/tun.conf
```
### Alpine
```bash
echo tun | sudo tee -a /etc/modules
```
---
## 🧱 Architecture Overview
```
2025-12-15 21:06:22 -05:00
/var/lib/microvm/
2025-12-18 21:07:59 -05:00
├── images/
2025-12-15 21:06:22 -05:00
└── vms/
2025-12-22 00:04:28 +00:00
└── vm1/
├── disk.qcow2
├── seed.iso
├── pubkey.pub
├── os.name
├── vm.ip
├── vm.mac
├── vnc.port
└── vm.pid
```
2025-12-18 21:07:59 -05:00
2025-12-22 00:04:28 +00:00
No libvirt.
No XML.
2025-12-15 21:06:22 -05:00
No daemon.
---
2025-12-18 21:07:59 -05:00
## 🌐 Host Networking Requirements (CRITICAL)
2025-12-22 00:04:28 +00:00
MNMIVM-SE requires a **Linux bridge ** .
2025-12-18 21:07:59 -05:00
### Example: `/etc/network/interfaces` (Debian)
```ini
auto lo
iface lo inet loopback
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
auto ens18
iface ens18 inet manual
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
auto br0
iface br0 inet static
address 192.168.86.10
netmask 255.255.255.0
gateway 192.168.86.1
dns-nameservers 1.1.1.1 8.8.8.8
bridge_ports ens18
bridge_stp off
bridge_fd 0
2025-12-22 00:04:28 +00:00
```
2025-12-18 21:07:59 -05:00
2025-12-22 00:04:28 +00:00
Rules:
2025-12-18 21:07:59 -05:00
2025-12-22 00:04:28 +00:00
* Host IP must live on `br0`
* Physical NIC has no IP
2025-12-18 21:07:59 -05:00
* Wi-Fi cannot be bridged
* VMs attach via TAP devices
2025-12-15 21:06:22 -05:00
---
2025-12-18 21:07:59 -05:00
## 🔥 Kernel Bridge Filtering (THIS WILL BREAK VMs)
2025-12-22 00:04:28 +00:00
Check:
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
```bash
cat /proc/sys/net/bridge/bridge-nf-call-iptables
# must be 0
```
2025-12-22 00:04:28 +00:00
Fix (runtime):
2025-12-18 21:07:59 -05:00
```bash
sudo sysctl -w net.bridge.bridge-nf-call-iptables=0
sudo sysctl -w net.bridge.bridge-nf-call-ip6tables=0
sudo sysctl -w net.bridge.bridge-nf-call-arptables=0
```
2025-12-22 00:04:28 +00:00
Persist:
2025-12-18 21:07:59 -05:00
```ini
2025-12-22 00:04:28 +00:00
# /etc/sysctl.d/99-bridge.conf
2025-12-18 21:07:59 -05:00
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-arptables = 0
```
2025-12-15 21:06:22 -05:00
---
2025-12-18 21:07:59 -05:00
## 🔐 QEMU Bridge Permissions
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
```ini
2025-12-22 00:04:28 +00:00
# /etc/qemu/bridge.conf
2025-12-18 21:07:59 -05:00
allow br0
```
Verify helper:
```bash
ls -l /usr/lib/qemu/qemu-bridge-helper
```
2025-12-15 21:06:22 -05:00
---
2025-12-18 21:07:59 -05:00
## 🐧 Alpine Linux Host Notes (3.22+)
2025-12-15 21:06:22 -05:00
```bash
2025-12-18 21:07:59 -05:00
apk add \
qemu-system-x86_64 \
qemu-img \
qemu-hw-display-virtio-vga \
bridge-utils \
cdrkit \
go
2025-12-15 21:06:22 -05:00
```
2025-12-18 21:07:59 -05:00
Notes:
* `cdrkit` provides `genisoimage`
2025-12-22 00:04:28 +00:00
* No libvirt or background services
2025-12-18 21:07:59 -05:00
* OpenRC is sufficient
---
## ⚙️ Server Edition Configuration (Code-Level)
2025-12-22 00:04:28 +00:00
Edit constants in `main.go` :
2025-12-18 21:07:59 -05:00
```go
// Networking
bridgeName = "br0"
lanCIDR = "192.168.86.0/24"
lanGW = "192.168.86.1"
lanDNS1 = "192.168.86.1"
lanDNS2 = "8.8.8.8"
// VM sizing
baseDiskSize = "12G"
memMB = "1024"
cpus = "1"
```
---
## 🧰 CLI Usage
2025-12-22 00:04:28 +00:00
### Create VM
2025-12-15 21:06:22 -05:00
```bash
2025-12-18 21:07:59 -05:00
sudo mnmivm-se create vm1 \
--os debian \
--pubkey-path ~/.ssh/id_ed25519.pub \
--ip 192.168.86.53
2025-12-15 21:06:22 -05:00
```
2025-12-22 00:04:28 +00:00
### Start
2025-12-15 21:06:22 -05:00
```bash
2025-12-18 21:07:59 -05:00
sudo mnmivm-se start vm1
2025-12-15 21:06:22 -05:00
```
2025-12-22 00:04:28 +00:00
### SSH
2025-12-15 21:06:22 -05:00
```bash
2025-12-18 21:07:59 -05:00
ssh debian@192 .168.86.53
2025-12-15 21:06:22 -05:00
```
2025-12-22 00:04:28 +00:00
### Stop
2025-12-15 21:06:22 -05:00
```bash
2025-12-18 21:07:59 -05:00
sudo mnmivm-se stop vm1
2025-12-15 21:06:22 -05:00
```
2025-12-22 00:04:28 +00:00
### Update cloud-init
2025-12-15 21:06:22 -05:00
```bash
2025-12-18 21:07:59 -05:00
sudo mnmivm-se update-cloud vm1 \
--pubkey-path newkey.pub \
--ip 192.168.86.54
2025-12-15 21:06:22 -05:00
```
---
2025-12-18 21:07:59 -05:00
## 🔑 Security Model
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
* SSH key– only access
2025-12-22 00:04:28 +00:00
* No passwords
2025-12-18 21:07:59 -05:00
* No root login
2025-12-22 00:04:28 +00:00
* Static IPs
* Pinned MAC addresses
2025-12-18 21:07:59 -05:00
* VNC console for recovery only
2025-12-15 21:06:22 -05:00
2025-12-22 00:04:28 +00:00
Security is **intentional by default ** .
2025-12-15 21:06:22 -05:00
---
2025-12-18 21:07:59 -05:00
## ⚠️ What MNMIVM-SE Is Not
2025-12-15 21:06:22 -05:00
2025-12-22 00:04:28 +00:00
* A managed cloud
* A multi-tenant platform
* A scheduler
* A UI-driven system
* A NAT-based laptop tool
2025-12-15 21:06:22 -05:00
2025-12-22 00:04:28 +00:00
If you want policy and HA, use Proxmox or OpenStack.
If you want **direct infrastructure control ** , use MNMIVM-SE.
2025-12-15 21:06:22 -05:00
---
2025-12-18 21:07:59 -05:00
## 🐧 Why MNMIVM-SE Exists
2025-12-22 00:04:28 +00:00
Because sometimes you don't want:
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
* libvirt
* XML
* dashboards
* APIs
* orchestration layers
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
You want:
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
> “Put a VM on my LAN, give it an IP, and let me build infrastructure.”
2025-12-15 21:06:22 -05:00
2025-12-22 00:04:28 +00:00
MNMIVM-SE does exactly that.
2025-12-18 21:07:59 -05:00
---
2025-12-15 21:06:22 -05:00
2025-12-18 21:07:59 -05:00
### ⚠️ Final Note
2025-12-15 21:06:22 -05:00
2025-12-22 00:04:28 +00:00
If networking breaks, it isn't a bug.
2025-12-15 21:06:22 -05:00
2025-12-22 00:04:28 +00:00
It's Linux doing exactly what you told it to do.
2025-12-15 21:06:22 -05:00
2025-12-22 00:04:28 +00:00
And that's the point.
2025-12-15 21:06:22 -05:00