No description
  • Rust 80%
  • Python 13.5%
  • Shell 5.4%
  • Dockerfile 0.7%
  • CSS 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ronald Farrer e8abdbef4e
Some checks are pending
CI / Test (push) Blocked by required conditions
CI / USE-flag feature builds (push) Blocked by required conditions
CI / UI E2E (browser) (push) Blocked by required conditions
CI / Gentoo USE-flag matrix (ebuild install) (push) Blocked by required conditions
CI / Build (push) Blocked by required conditions
CI / Build-1 (push) Blocked by required conditions
CI / Build Web UI (push) Blocked by required conditions
CI / Gentoo Docker Build (push) Blocked by required conditions
Live ISO (server-openrc-x86_64) / Build + test + publish live ISO (server-openrc-x86_64) (push) Waiting to run
CI / Check (push) Has started running
Guest save state + cluster drain (2 nodes, KVM) / Save state (VMs, containers with CRIU) + two-node drain / rebalance (push) Has started running
CI / Security Audit (push) Has started running
CI / Mobile theme (light/dark) (push) Successful in 4s
CI / Plan (what needs to run) (push) Successful in 5s
CI / Web UI theme (light/dark) (push) Successful in 4s
Mutation testing (nightly incremental, weekly full per group) / cargo-mutants (vm-snapshot) (push) Successful in 9s
Mutation testing (nightly incremental, weekly full per group) / cargo-mutants (vm-runtime) (push) Successful in 11s
Mutation testing (nightly incremental, weekly full per group) / cargo-mutants (backup) (push) Successful in 11s
Mutation testing (nightly incremental, weekly full per group) / cargo-mutants (storage) (push) Successful in 9s
guests: the boot pass never starts or resumes an HA-managed VM (left to the HA loop after it syncs placement): fixes split brain after a hard crash with the node coming back (lab j01296); unit test; no version bump
2026-11-10 00:37:34 -08:00
.forgejo overlay-sync: the hourly poll checks out main's tip, not the scheduled run's stale GITHUB_SHA (rustinion-agent bumps were never synced to horcrux-overlay); no version bump 2026-11-09 14:08:56 -08:00
.github ci: enable GitHub Pages site automatically via configure-pages 2026-09-25 19:15:49 -07:00
branding iso: GRUB boot menu uses the product splash (official logo, scaled) via gfxterm; falls back to the text menu if splash/font missing; serial mirror unchanged 2026-10-28 17:00:51 -07:00
build live-iso boot-modes: clear the tty line buffer (^U) before answering the persistence prompt; pick() re-sends 's'+digit when GRUB's Booting line is late, the stray keys sat in the UART buffer and the prompt read 's8y' (= N) -> root shell, PERSISTENCE-CREATED never printed: Patronus x86 BIOS persist-enc-created failed every run on rw-man-02 (866, 12017), reproduced there with the 11-04 ISO that passed in CI, passes with the fix; assertions unchanged; TREE.sha256 regenerated; no version bump 2026-11-08 15:43:04 -08:00
ci ci: apt installs retry on a flaky Ubuntu mirror (ci/apt-install.sh): apt-get update exits 0 on a timed-out index, so Check job 78450 (run 1674, 8a068ee8) died with 'Package clang has no installation candidate'; retries update until the probe package has a candidate, 5 attempts with backoff; used by check/test/build/build-ui/security/use-features/ui-e2e 2026-11-08 20:37:35 -08:00
crates cluster: nodes report their uplink speed and NVMe count in the usage poll; /api/ceph/placement uses them for remote nodes instead of asking the operator (area 5/4); no version bump 2026-11-09 20:37:30 -08:00
deploy Cluster: list this node on GET /api/cluster/nodes, Remove-node button on /ha/cluster, cluster is a default feature (cargo, ebuild, Dockerfile); tests incl. UI e2e 2026-10-24 05:35:02 -07:00
docs power: automatic wake-on-demand in the idle power loop (below min_online or every running node >= 80% CPU: one managed node powered on via BMC, woken nodes not powered down for 30 min); area 7; no version bump 2026-11-09 18:15:13 -08:00
examples fix: HTTPS-aware test harnesses, LXC browser E2E, USE-gated builds, live QEMU status 2026-10-17 01:36:49 -07:00
gentoo app-admin/rustinion-agent: bump to 0.1.347 (release CI) [skip ci]; no version bump 2026-11-09 21:04:34 +00:00
horcrux-api guests: the boot pass never starts or resumes an HA-managed VM (left to the HA loop after it syncs placement): fixes split brain after a hard crash with the node coming back (lab j01296); unit test; no version bump 2026-11-10 00:37:34 -08:00
horcrux-cli fmt + clippy clean for guest power / drain 2026-10-22 17:56:54 -07:00
horcrux-common VM host PCI passthrough + mediated devices (vGPU): hardware.hostpci -> vfio-pci, /api/gpu/mdev routes over sysfs, start/save checks; replaces dead virsh-based vgpu.rs; docs rewritten to match; unit + HTTP tests 2026-10-26 10:48:15 -07:00
horcrux-mobile horcrux-mobile: follow the device light/dark (dark palette, color-scheme + theme-color per scheme), success button contrast, theme check + render proof 2026-10-30 14:50:43 -07:00
horcrux-ui feat(vm): network cards, CD-ROM/ISO library, boot order, VM edit, shutdown/reboot/reset, host bridges 2026-10-18 14:44:54 -07:00
site site: sitemap.xml, robots Sitemap line, IndexNow key and post-deploy submit 2026-11-08 17:52:20 -08:00
terraform-provider-horcrux feat(auth): users, roles, groups, ACLs, realms (LDAP/AD/OIDC/PAM), 2FA, RBAC on every route, HTTPS by default 2026-10-17 01:36:22 -07:00
.dockerignore gentoo: add live (9999) ebuild alongside versioned (0.1.0), fix placeholder URLs 2026-09-24 21:39:56 -07:00
.gitignore ui: hide admin-only actions and skip unreadable requests for roles without the privilege 2026-10-31 05:38:46 -07:00
AGENTS.md refactor: auth, vm, container, cluster and backup crates; main.rs split done 2026-10-17 15:12:45 -07:00
API_DOCUMENTATION.md fix: HTTPS-aware test harnesses, LXC browser E2E, USE-gated builds, live QEMU status 2026-10-17 01:36:49 -07:00
Cargo.lock revert accidental Cargo.lock churn from fmt-fix commit 2026-10-25 09:01:57 -07:00
Cargo.toml Cross-node container moves in drain and rebalance: live (CRIU) for Docker/Podman/LXC, Incus live over push mode, cold fallback and rollback; e2e on two KVM VMs 2026-10-23 00:32:58 -07:00
CI-TRIGGERS.md docs: CI-TRIGGERS.md without the forge product name (claims check forbids it in public docs); doc-only, no code change 2026-11-06 09:36:32 -08:00
CODE_CLEANUP_REPORT.md refactor: Reduce compiler warnings by 88% (435→50) with code cleanup 2025-10-10 22:37:06 -07:00
COMPARISON.md Add comprehensive technical documentation 2025-10-11 21:08:30 -07:00
CONTRIBUTING.md Add comprehensive CONTRIBUTING.md guide 2025-10-11 18:28:16 -07:00
DEPLOYMENT.md fix: HTTPS-aware test harnesses, LXC browser E2E, USE-gated builds, live QEMU status 2026-10-17 01:36:49 -07:00
docker-compose.yml fix: HTTPS-aware test harnesses, LXC browser E2E, USE-gated builds, live QEMU status 2026-10-17 01:36:49 -07:00
Dockerfile Cluster: list this node on GET /api/cluster/nodes, Remove-node button on /ha/cluster, cluster is a default feature (cargo, ebuild, Dockerfile); tests incl. UI e2e 2026-10-24 05:35:02 -07:00
Dockerfile.cli build: track latest stable Rust instead of pinning old versions 2026-09-24 20:01:49 -07:00
ENHANCEMENTS_FINAL_SUMMARY.md Add comprehensive enhancement session summary 2025-10-10 20:38:39 -07:00
ENHANCEMENTS_SESSION_SUMMARY.md docs: Add comprehensive enhancements session summary 2025-10-10 20:22:24 -07:00
FEATURES.md fix(cluster): report live node CPU/memory usage; add cluster status/remove endpoints 2026-10-15 20:49:34 -07:00
FINAL_STATUS.md docs: Update FINAL_STATUS.md - Platform now 5/5 stars, fully production ready 2025-10-10 19:27:54 -07:00
FINAL_VALIDATION_REPORT.md Add comprehensive final validation report 2025-10-10 20:50:04 -07:00
horcrux_logo.png first commit 2025-10-08 12:53:47 -07:00
IMPLEMENTATION_PLAN.md feat: Complete migration system with 100% real implementations 2025-10-10 18:56:20 -07:00
install.sh fix: HTTPS-aware test harnesses, LXC browser E2E, USE-gated builds, live QEMU status 2026-10-17 01:36:49 -07:00
LICENSE first commit 2025-10-08 12:53:47 -07:00
MISSING_FEATURES.md docs: document horcrux-mobile & terraform provider, fix stale claims 2026-10-12 16:42:24 -07:00
OIDC_FIX_SUMMARY.md docs: Add comprehensive OIDC security fix summary 2025-10-10 19:29:27 -07:00
PORTAINER_COMPARISON.md docs: add PORTAINER_COMPARISON.md 2026-10-13 12:34:24 -07:00
PROGRESS_SUMMARY.md Add comprehensive noVNC testing suite and documentation 2025-10-13 21:47:50 -07:00
PROJECT_STATISTICS.md refactor: Reduce compiler warnings by 88% (435→50) with code cleanup 2025-10-10 22:37:06 -07:00
PROXMOX_COMPARISON.md first commit 2025-10-08 12:53:47 -07:00
QUICKSTART.md Add comprehensive user documentation 2025-10-11 19:28:52 -07:00
README.md README: link the project website 2026-11-08 17:51:28 -08:00
README.md.old first commit 2025-10-08 12:53:47 -07:00
REMAINING_WORK.md docs: Update REMAINING_WORK.md to reflect OIDC security fix 2025-10-10 19:06:27 -07:00
ROADMAP.md docs: stable-1.0 roadmap with measurable exit criteria and live status checklist; stable-channel design (design only, nothing built); README links 2026-10-28 18:09:51 -07:00
SESSION_COMPLETE.md Add comprehensive session completion summary 2025-10-10 21:09:40 -07:00
SESSION_COMPLETE_2025-10-12.md Add complete session documentation for testing and noVNC implementation 2025-10-12 22:54:21 -07:00
SESSION_SUMMARY.md feat: Complete migration system with 100% real implementations 2025-10-10 18:56:20 -07:00
SESSION_SUMMARY_2025-10-11.md Add session summary for 2025-10-11 code quality improvements 2025-10-11 17:47:30 -07:00
SESSION_SUMMARY_2025-10-12.md Add comprehensive documentation for libvirt integration 2025-10-12 21:51:58 -07:00
STATUS.md first commit 2025-10-08 12:53:47 -07:00
TECHNICAL_STATUS.md Add comprehensive technical documentation 2025-10-11 21:08:30 -07:00
test-runner.sh test+ci: one integration-test binary; CI builds with mold, line-tables-only, per-job caches 2026-10-17 15:29:27 -07:00
test_novnc.sh Add comprehensive noVNC testing suite and documentation 2025-10-13 21:47:50 -07:00
TEST_STATUS.md feat(console): expose serial console over HTTP + CLI 2026-10-06 18:16:38 -07:00
test_vnc_protocol.py Add comprehensive noVNC testing suite and documentation 2025-10-13 21:47:50 -07:00
test_vnc_server.py Add comprehensive noVNC testing suite and documentation 2025-10-13 21:47:50 -07:00
TROUBLESHOOTING.md fix: HTTPS-aware test harnesses, LXC browser E2E, USE-gated builds, live QEMU status 2026-10-17 01:36:49 -07:00
USER_MANUAL.md HA recovery + balancer placement honour per-guest required node labels (VmResources.required_labels, HaManager.set_required_labels fed from placement rules each HA tick; unlabelled/unknown nodes never match; unit tests; manual); area 2; no version bump 2026-11-08 00:44:36 -08:00
VALIDATION_SESSION_SUMMARY.md docs: Add validation session summary 2025-10-10 19:57:32 -07:00
warning_analysis.md docs: mark warning_analysis.md as stale (55 warnings from 2025-10-12, already resolved/wired up) 2026-10-14 14:54:52 -07:00

Horcrux

Horcrux

A headless hypervisor/server OS (Proxmox VE-style virtualization manager) for Gentoo Linux, written in Rust, with an optional desktop.

Status: in active development (v0.1.x). Not yet suitable for production use. APIs, config and on-disk formats can still change between releases. Try it on test hardware.

License: GPL v3 Built with Rust Platform: Gentoo

Website and docs: horcrux.errant.solutions

Documentation | Roadmap to 1.0 | API reference | Installation | Docker guide

What is Horcrux?

Horcrux is a server-first operating system: a Gentoo-based hypervisor you install from an ISO (x86_64 and aarch64) and manage through the web UI, the API, the CLI or SSH. The server image has no desktop and needs no display: it installs over a serial console or SSH with an answer file, and the web UI comes up on port 8006. A desktop is an optional edition (GNOME today) layered on the same core, for laptops and workstations that run VMs; it adds the desktop and nothing else (see Layers).

image what it is
horcrux-server-openrc-daily-x86_64.iso, horcrux-server-openrc-daily-aarch64.iso the headless server (the product)
horcrux-gnome-light-openrc-daily-x86_64.iso server core + GNOME (optional desktop edition)

Image names are <product>-<desktop environment or "server">-<init system>-<channel>-<arch>.iso (details).

Horcrux is a web-managed virtualization platform that aims at Proxmox VE-style functionality (VMs, containers, storage, clustering, firewall, backups, RBAC) on Gentoo, with a Rust API server, a Rust/WASM web UI, a CLI and a Terraform provider. It differs from Proxmox in a few deliberate ways:

  • More backends: QEMU/KVM, LXD and Incus for VMs; LXC, LXD, Incus, Docker and Podman for containers.
  • Kubernetes management: connect or provision k3s/kubeadm clusters, workloads, Helm.
  • Mixed-architecture clusters: x86_64, aarch64 and riscv64 nodes in one cluster.
  • Gentoo-native: ebuilds and USE flags select which features get built.
  • Rust throughout, including the web UI (Leptos/WASM).

Commercial support is planned after a stable 1.0 (a paid stable update channel with best-effort email support; the free channel stays complete). Design: docs/stable-channel.md.

Current status

What is covered by automated tests in the project's CI today:

  • Build and lint: formatting, clippy, release builds across feature sets, and a USE-flag feature build matrix.
  • Unit and integration tests run against a live horcrux-api server.
  • Against real services, not mocks: OpenLDAP, Dex (OIDC), PAM and an ACME test CA for auth realms and certificates; real nftables for firewall and SDN policy enforcement; real CNI plugins; real tap/VLAN/PXE VM networking; nested LXC and Incus containers; a k3s cluster with a local chart repository for Helm; the Docker daemon for container tests.
  • Web UI: built to WASM and exercised by browser end-to-end tests.
  • Gentoo: the container image builds through Portage, and the ebuild installs across a USE-flag matrix.
  • Security audit (cargo audit) runs on every change.

Known gaps and caveats:

  • riscv64 / aarch64 release binaries are cross-compiled, but there is no physical RISC-V hardware in the test setup. Reports from real riscv64 boards are welcome.
  • The Hypervisor HA fencing agent type is a stub (see horcrux-api/src/ha/fencing.rs); the IPMI, iLO/DRAC, SSH, libvirt, watchdog and SNMP-PDU agents are implemented.
  • The mobile UI's Storage and Network pages are placeholders ("coming soon").
  • Several status/summary documents in the repo root are historical session notes and may overstate completeness; treat this README, docs/ and the CI results as the source of truth. See also the stable 1.0 roadmap and checklist, the older ROADMAP.md and MISSING_FEATURES.md.
  • No third-party security review has been done.

Features

Virtualization and containers

  • Hypervisors: QEMU/KVM, LXD, Incus.
  • Container runtimes: LXC, LXD, Incus, Docker, Podman.
  • Templates: full and linked clones, cloud-init.
  • Console access: VNC (noVNC in the browser via a WebSocket proxy; QEMU listens on 127.0.0.1 with a per-start password), SPICE, serial console, headless VMs.

Kubernetes

  • Connect clusters via kubeconfig or provision k3s/kubeadm clusters.
  • Pods, Deployments, StatefulSets, DaemonSets, Jobs/CronJobs, Services, Ingress, NetworkPolicies, ConfigMaps/Secrets, PVCs, StorageClasses.
  • Helm install/upgrade/rollback and repository management; metrics, events, logs, exec over WebSocket.

See docs/KUBERNETES.md.

Storage

ZFS, Ceph RBD, LVM, directory (qcow2) and iSCSI backends.

Clustering and HA

  • Corosync/Pacemaker clustering with quorum checks.
  • HA framework with affinity rules and fencing agents.
  • Live migration of running QEMU VMs (disk mirror + QEMU migration, no shared storage required), or offline migration with a verified copy; cancel rolls back. See docs/MIGRATION.md.

Security

  • Realms (user@realm): local, PAM, LDAP (plain/StartTLS/LDAPS), Active Directory, OpenID Connect (PKCE, state, nonce), and API keys.
  • Second factors: TOTP, WebAuthn security keys/passkeys, recovery codes; enforceable per user, realm or globally.
  • RBAC: Proxmox-style privileges checked on every API route, built-in and custom roles, path ACLs with propagation.
  • HTTPS by default on port 8006 using a node-local CA (or your own certificate, or ACME/Let's Encrypt with renewal). Plain HTTP is redirected.
  • Firewall: nftables-based, datacenter/node/per-guest rules, security groups, IPv4 and IPv6.

See docs/ACCESS_CONTROL.md.

Operations

  • Backup and restore: full/incremental/differential, vzdump-compatible format, scheduled jobs, gzip/zstd/lz4.
  • Monitoring and alerting: node and container metrics (/proc, cgroups v1/v2), live dashboard over WebSocket, thresholds, notification channels, alert history.
  • Web UI: Rust/WASM dashboard, VM management, alerts, consoles.
  • CLI (horcrux), mobile UI (horcrux-mobile) and a Terraform provider (terraform-provider-horcrux: horcrux_vm, horcrux_container, horcrux_storage_pool, horcrux_firewall_rule).

Installation

Prerequisites

  • Gentoo Linux (recommended); other Linux distributions may work but are not the target.
  • CPU with VT-x/AMD-V for KVM; 8+ GB RAM and 50+ GB disk are a sensible minimum for guests.
  • Rust 1.82 or later to build from source.

From source (installer script)

git clone https://github.com/CanuteTheGreat/horcrux.git
cd horcrux
sudo ./deploy/install.sh

The script checks requirements, creates the horcrux user and groups, builds from source, installs binaries and the web UI, configures services and initializes the database. Then open https://localhost:8006.

On first start there is no default password: the admin password comes from ADMIN_PASSWORD, or is generated into /var/lib/horcrux/initial-admin-password (deleted once you change it). Self-registration is off. Scripts must use https:// and trust the node CA from /api/tls/ca.pem (or the CLI's --ca-cert). Details: docs/ACCESS_CONTROL.md. The full guide is docs/INSTALLATION.md.

Docker (development)

The Docker path builds through the project's own Gentoo/Portage overlay (gentoo/), so USE flags still apply. It is a development/CI convenience, not a separate deployment target.

git clone https://github.com/CanuteTheGreat/horcrux.git
cd horcrux
docker-compose up -d

curl -k https://localhost:8006/api/tls/ca.pem -o horcrux-ca.pem
curl --cacert horcrux-ca.pem https://localhost:8006/api/health

See docs/DOCKER.md.

Gentoo ebuild

sudo mkdir -p /var/db/repos/local/app-emulation/horcrux
sudo cp deploy/gentoo/horcrux-0.1.0.ebuild /var/db/repos/local/app-emulation/horcrux/
cd /var/db/repos/local/app-emulation/horcrux
sudo ebuild horcrux-0.1.0.ebuild manifest
sudo USE="qemu lxc docker" emerge -av app-emulation/horcrux
sudo systemctl enable --now horcrux-api

A live horcrux-9999.ebuild is also in deploy/gentoo/.

USE flags

Flag Description Default
qemu QEMU/KVM virtualization on
lxc LXC containers on
docker Docker integration on
podman Podman integration off
cluster Clustering and HA (/ha/* pages, node list, create/join, failover) on
backup Backup compression on
gpu GPU passthrough off

Configuration

Edit /etc/horcrux/config.toml (example in deploy/config.toml.example):

[server]
bind_address = "0.0.0.0:8006"
workers = 4

[storage]
default_pool = "local"

[clustering]
node_name = "node1"
cluster_name = "production"

[auth]
session_timeout = 7200  # 2 hours

Using it

API

The server publishes an OpenAPI spec and Swagger UI on your own node at /api/openapi.yaml and /api/docs once it is running. The spec is also in the repo at docs/openapi.yaml; guides are docs/API_DOCS.md and docs/API.md.

TOKEN=$(curl -s --cacert horcrux-ca.pem -X POST https://localhost:8006/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "<your admin password>"}' | jq -r .ticket)

curl --cacert horcrux-ca.pem -H "Authorization: Bearer $TOKEN" https://localhost:8006/api/vms

CLI

horcrux vm list
horcrux vm create --name myvm --memory 2048 --cpus 2 --disk 20
horcrux vm start vm-100
horcrux snapshot create vm-100 --name "before-upgrade" --include-memory
horcrux clone create vm-100 --name clone1 --full --start
horcrux completions bash > /etc/bash_completion.d/horcrux

See docs/CLI.md.

Testing

./test-runner.sh        # everything
cargo test --lib        # unit tests
cargo test --test integration_tests

Many integration tests need real services (nftables, LXC, Incus, k3s, LDAP...) and are meant to run in CI; the unit tests run anywhere.

Architecture

┌─────────────────────────────────────────────┐
│           Web UI (Leptos/WASM)              │
└───────────────────┬─────────────────────────┘
                    │ REST API / WebSocket
┌───────────────────┴─────────────────────────┐
│         Horcrux API Server (Axum)           │
│  VM │ Container │ Storage │ Cluster │ Auth  │
│ Backup │ Monitor │ Alerts │ Firewall │ SDN  │
└───────────────────┬─────────────────────────┘
┌───────────────────┴─────────────────────────┐
│        Hypervisors & Storage Backends       │
│  QEMU │ LXD │ Incus │ Docker │ Podman       │
│  ZFS │ Ceph │ LVM │ iSCSI │ Directory       │
└─────────────────────────────────────────────┘

Contributing

See CONTRIBUTING.md.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
cargo install trunk
cargo run                                   # API server
cd horcrux-api/horcrux-ui && trunk serve    # UI

License

GPL-3.0. See LICENSE.

Acknowledgments

Inspired by Proxmox VE. Built with Axum, Leptos, Tokio and Serde.

Support