secubox-deb/packages/secubox-vm
CyberMind 5e93c73600
feat(navbar): consolidate to 6 charter categories + fix dropped menu entries (closes #306) (#307)
The hub's `_compute_menu_sync()` drops menu entries lacking an `id`
field. 6+ packages (lyrion, yacy, zigbee, rustdesk, grafana, authelia)
shipped a different schema (`title/url/section/module`) so they NEVER
appeared in the navbar. Plus the existing CATEGORY_META declared 12
sections (dashboard/security/network/system/core/users/services/
privacy/monitoring/publishing/apps/admin), not the 6 SecuBox charter
modules.

Changes:
* All 121 packages/secubox-*/menu.d/*.json normalised to the canonical
  schema (id, name, path, category, icon, order, description). Legacy
  schema aliases (title/url/module/section) preserved as fallbacks then
  dropped from the file.
* Each menu entry's category remapped to one of the 6 charter modules:
  AUTH (auth/users/identity/zkp/nac/openclaw),
  WALL (crowdsec/waf/mitmproxy/hardening/threat-* /cve-triage/...),
  BOOT (kernel-build/eye-remote/master-link/droplet/cloner/backup/...),
  MIND (ai-gateway/mcp-server/grafana/ndpid/netifyd/glances/...),
  ROOT (system/hub/portal/console/admin/vault/vm/rtty/...),
  MESH (wireguard/dns/tor/matrix/gitea/nextcloud/mail/lyrion/yacy/
        zigbee/dns-provider/rustdesk/... — all network + comms apps).
* secubox-hub v1.4.0 — CATEGORY_META rewritten with the 6 charter
  modules carrying their official color from DESIGN-CHARTER.md and
  the complementary-pair order. DEFAULT_MENU fallback remapped too.
* secubox-zigbee v2.5.3 — www/zigbee/index.html rewritten with the
  canonical SecuBox scaffold (body display:flex, sidebar 220px fixed,
  .main reserving 48px for the global-menu-bar). MESH palette.

Browser side: operators need to clear localStorage sbx_menu_cache (or
hard-refresh after the 1h TTL) to see the new sections after deploy.

Co-authored-by: CyberMind-FR <gandalf@Gk2.net>
2026-05-21 10:03:05 +02:00
..
api feat(phase9): Add VM Manager - virtualization management 2026-03-28 16:37:45 +01:00
debian feat(secubox): complete meta-script generator Tasks 14-17 2026-05-11 05:32:29 +02:00
menu.d feat(navbar): consolidate to 6 charter categories + fix dropped menu entries (closes #306) (#307) 2026-05-21 10:03:05 +02:00
nginx feat(phase9): Add VM Manager - virtualization management 2026-03-28 16:37:45 +01:00
www/vm fix(ui): Add sidebar navigation to 11 modules 2026-04-10 13:20:24 +02:00
README.md feat: Complete Phase 8, 9, 10 - all modules done 2026-04-08 14:46:58 +02:00

SecuBox VM

Virtualization management module for SecuBox. Provides a unified API for managing both KVM virtual machines (via libvirt) and LXC containers.

Features

  • KVM virtual machine management via libvirt/virsh
  • LXC container management
  • Unified API for both virtualization types
  • VM lifecycle management (create, start, stop, restart, delete)
  • VNC console access for KVM VMs
  • ISO image management for VM installation
  • LXC template listing for container creation
  • Automatic KVM hardware detection (/dev/kvm)

API Endpoints

Method Endpoint Description
GET /health Health check
GET /status Virtualization status (libvirt, LXC, KVM)
GET /vms List all VMs and containers
GET /vms/kvm List KVM virtual machines only
GET /vms/lxc List LXC containers only
GET /vms/{name} Get VM or container details
POST /vms/kvm Create a new KVM VM
POST /vms/lxc Create a new LXC container
POST /vms/{name}/start Start a VM or container
POST /vms/{name}/stop Stop a VM or container (force optional)
POST /vms/{name}/restart Restart a VM or container
DELETE /vms/{name} Delete a VM or container
GET /vms/{name}/console Get console connection info
GET /iso List available ISO images
GET /templates List available LXC templates

Configuration

Storage Directories:

  • /var/lib/secubox/vm/ - VM data directory
  • /var/lib/secubox/vm/iso/ - ISO image storage
  • /var/lib/secubox/vm/disks/ - Virtual disk storage (qcow2)

Data Models:

# KVM VM creation
{
    "name": "debian-server",
    "memory": 2048,       # MB
    "vcpus": 2,
    "disk_size": 20,      # GB
    "iso": "debian-12.iso",
    "os_type": "linux"
}

# LXC container creation
{
    "name": "web-container",
    "template": "debian",
    "release": "bookworm",
    "arch": "amd64"
}

Dependencies

  • python3
  • python3-fastapi
  • python3-pydantic
  • secubox-core
  • libvirt-daemon-system (for KVM)
  • qemu-system (for KVM)
  • qemu-utils (for qcow2 disk creation)
  • virtinst (for virt-install)
  • lxc (for LXC containers)
  • lxc-templates (for LXC container creation)

Files

  • /var/lib/secubox/vm/ - VM data root directory
  • /var/lib/secubox/vm/iso/ - ISO images for VM installation
  • /var/lib/secubox/vm/disks/{name}.qcow2 - Virtual machine disk images
  • /etc/secubox/vm.toml - Module configuration

Supported LXC Templates

  • debian: bookworm, bullseye, buster
  • ubuntu: jammy, focal, noble
  • alpine: 3.19, 3.18, edge
  • archlinux: current
  • fedora: 39, 38

Usage Examples

Create a KVM VM:

curl -X POST http://localhost/api/v1/vm/vms/kvm \
  -H "Content-Type: application/json" \
  -d '{"name": "test-vm", "memory": 4096, "vcpus": 4, "disk_size": 50}'

Create an LXC container:

curl -X POST http://localhost/api/v1/vm/vms/lxc \
  -H "Content-Type: application/json" \
  -d '{"name": "web-server", "template": "debian", "release": "bookworm"}'

Start a VM:

curl -X POST http://localhost/api/v1/vm/vms/test-vm/start

Get VNC console info:

curl http://localhost/api/v1/vm/vms/test-vm/console
# Returns: {"type": "vnc", "host": "localhost", "port": 5900, "display": ":0"}

Force stop a VM:

curl -X POST "http://localhost/api/v1/vm/vms/test-vm/stop?force=true"

Requirements

  • For KVM: CPU with virtualization extensions (Intel VT-x or AMD-V)
  • /dev/kvm must be accessible
  • libvirtd service must be running for KVM operations

Author

Gerald KERMA devel@cybermind.fr CyberMind - https://cybermind.fr