How slaker19/webkvm works
WebKVM is a web-based Linux virtualization manager for KVM/QEMU VMs and Incus containers. Users authenticate in the SPA, navigate management pages, and issue API requests to the Go server, which exposes compute, storage, image, and cluster operations. Live status and telemetry arrive through SSE. The README also identifies terminal access, backups, firewall, networking, and HA clustering as major capabilities. Connections below are limited to excerpted calls and explicit README statements; many backend feature paths are present in the tree but their wiring was not sampled.
Main entry points: api REST handlers · App.svelte Management SPA · auth.svelte.js Session and API · backend.go Compute abstraction
Components 28
Web interface
- Management SPA
frontend/src/App.svelte - Hash router
frontend/src/lib/router.svelte.js - Session and API
frontend/src/lib/stores/auth.svelte.js - Live event store
frontend/src/lib/stores/events.svelte.js - Storage views
frontend/src/routes/Storage.svelte - Storage tabs
frontend/src/lib/components/storage - VM management
frontend/src/routes/VmList.svelte - Web terminal
frontend/src/routes/HostConsole.svelte
API server
- HTTP server
backend/cmd/server/main.go - REST handlers
backend/internal/api - Authentication
backend/internal/auth - Event hub
backend/internal/events/hub.go
Compute and cluster
- VM and container API
backend/internal/api/vms.go - Compute abstraction
backend/internal/compute/backend.go - KVM operations
backend/internal/libvirt/domain.go - Incus operations
backend/internal/compute/incus/incus.go - HA orchestration
backend/internal/ha/control_plane.go
Storage and images
- Storage API
backend/internal/api/storage_pools.go - KVM storage
backend/internal/libvirt/storage.go - Incus storage
backend/internal/compute/incus/incus_storage.go - Backup services
backend/internal/backupstore/runner.go - Image deployments
backend/internal/api/image_hub.go
Host services
- Firewall
backend/internal/firewall/host.go - Host networking
backend/internal/api/networks.go - Console API
backend/internal/api/console.go
Other components
- Operator
- Incus service
- Libvirt service
Connections 27
- Operator → Management SPA: uses
README.md - Management SPA → Hash router: routes via
frontend/src/App.svelte - Management SPA → Session and API: bootstraps
frontend/src/App.svelte - Management SPA → Live event store: reads events
frontend/src/App.svelte - Management SPA → HTTP server: HTTPS / REST
README.md - Storage views → Storage tabs: renders
frontend/src/routes/Storage.svelte - Storage tabs → Session and API: requests data
- VM management → Session and API: requests data
- Web terminal → Session and API: opens console
- HTTP server → REST handlers: serves
- REST handlers → Authentication: authorizes
- REST handlers → Event hub: publishes events
- REST handlers → VM and container API: routes VM calls
- VM and container API → Compute abstraction: dispatches compute
- Compute abstraction → KVM operations: runs KVM
- Compute abstraction → Incus operations: runs containers
- HA orchestration → Incus operations: coordinates cluster
- REST handlers → Storage API: routes storage
- Storage API → KVM storage: manages volumes
- Storage API → Incus storage: manages storage
- REST handlers → Backup services: runs backups
- REST handlers → Image deployments: serves image hub
- REST handlers → Firewall: configures rules
- REST handlers → Host networking: manages networks
- REST handlers → Console API: serves console
- KVM operations → Libvirt service: controls
- Incus operations → Incus service: controls