How sosuku325/aerovm works
Purpose and Entry Points
AeroVM packages QEMU virtual machines as a Pterodactyl egg. Pterodactyl imports egg/egg-aerovm.json, selects a published Docker image, and invokes the container startup command. The runtime entry point is scripts/start.sh; it translates egg environment variables into persistent VM state and a QEMU process.
Pterodactyl Integration Boundary
The egg defines server variables, Docker image choices, allocations, and startup behavior consumed by Pterodactyl/Wings: egg/egg-aerovm.json. AeroVM relies on Pterodactyl to expose assigned container ports; QEMU forwarding alone cannot make a port reachable. The server container persists VM artifacts under /home/container, notably disk.qcow2, optional installer ISOs, cloud-init seed data, and generated password state.
VM Bootstrap and Validation
scripts/start.sh is the central control plane. It validates resource, hostname, password/key, display, KVM, networking, and port-collision inputs before launching anything. It derives RAM/disk defaults from Pterodactyl limits where available, protects against invalid numeric values, and chooses whether to use UEFI/OVMF and SMBIOS overrides.
Storage Provisioning Modes
Blank-disk images create and retain an empty qcow2 disk, optionally download and attach os.iso, and boot the installer until an OS is installed. Cloud-image variants copy a bundled base qcow2 into the persistent disk location and expand it when requested. Image construction and guest-image bundling are separated by Dockerfiles, including docker/Dockerfile.alpine, docker/Dockerfile.ubuntu-24.04, and docker/Dockerfile.guest-debian-12.
Cloud-Init Guest Configuration
For cloud-image containers, scripts/start.sh generates a NoCloud seed ISO from egg variables. It configures hostname, credentials, SSH keys, package updates, and a settings-derived instance ID so changed panel settings re-provision on restart. Graphical modes additionally cause guest-side desktop/RDP/SPICE setup through cloud-init. This is a guest boundary: AeroVM prepares seed media, while cloud-init inside the guest applies it.
QEMU Runtime, Networking, and Display
The startup script launches qemu-system-x86_64 with virtio disk/network, memory balloon, RNG, optional UEFI, and either KVM or TCG emulation. User-mode QEMU networking maps the primary allocation to guest SSH and can add RDP, low-port, and explicit forwarding rules. Display selection is also assembled here: serial console, VNC/noVNC, SPICE, RDP forwarding, or headless operation. VNC/SPICE passwords are supplied through QEMU file-backed secrets rather than process arguments.
Optional Host KVM Enablement
Wings normally starts containers with explicit numeric identities that do not retain image group membership. The optional host-side patch exposes /dev/kvm and injects the host KVM group into each server container: wings-patch/install.sh, wings-patch/container.go.txt, and wings-patch/container_legacy.go.txt. The installer version-selects the Wings overlay, builds a replacement Go Wings binary, backs up the prior binary, configures udev permissions, and restarts Wings. At runtime, scripts/start.sh still decides whether KVM is safe—defaulting away from nested virtualization.
Distribution and Infrastructure
Docker images are published to GitHub Container Registry (ghcr.io/sosuku325/aerovm) and built across blank-disk, cloud-init, and debug-shell variants. The build/publish automation is .github/workflows/build.yml; the debug image uses docker/Dockerfile.shell and scripts/shell.sh. Material dependencies are Docker, Pterodactyl Panel/Wings, QEMU, cloud-init guest images, xorriso, and optionally Go plus systemd/udev for the Wings KVM patch.
Main entry points: start.sh VM startup control plane · build.yml Build/publish workflow · Dockerfile.guest-debian-12 Bundled Debian guest image · Dockerfile.alpine Runtime image variants
Components 18
Build & distribution
- GitHub Container Registry
- Build/publish workflow · Builds blank-disk, cloud-init, and debug images.
.github/workflows/build.yml - Runtime image variants · Alpine and Ubuntu images provide AeroVM runtime variants.
docker/Dockerfile.alpine - Bundled Debian guest image · Produces the cloud-image base qcow2.
docker/Dockerfile.guest-debian-12 - Debug shell image
docker/Dockerfile.shell - Debug shell entrypoint
scripts/shell.sh
Container VM runtime
- VM startup control plane · Validates settings, provisions state, and assembles QEMU.
scripts/start.sh - Persistent VM state · Retains qcow2 disks, ISOs, seed media, and password state.
- Blank-disk provisioning · Creates a persistent disk and optionally attaches an installer ISO.
- Cloud-image provisioning · Copies and optionally expands the bundled qcow2 base image.
- NoCloud seed ISO · Carries hostname, credentials, keys, packages, and instance ID.
- Guest cloud-init · Applies seed configuration, including graphical guest setup.
- QEMU VM process · Runs the guest with virtio devices, UEFI, KVM-or-TCG, networking, and display.
- Guest operating system
Optional Wings KVM patch
- Wings KVM patch installer · Builds and installs a version-selected Wings overlay and configures udev.
wings-patch/install.sh - Patched Wings overlay · Injects the host KVM group and exposes /dev/kvm to server containers.
wings-patch/container.go.txt
Other components
- Pterodactyl Panel/Wings · Imports the egg and runs server containers.
- AeroVM egg · Defines variables, allocations, images, and startup behavior.
egg/egg-aerovm.json
Connections 24
- AeroVM egg → Pterodactyl Panel/Wings: imported by
- Pterodactyl Panel/Wings → VM startup control plane: starts container
- Build/publish workflow → Runtime image variants: builds
- Build/publish workflow → Bundled Debian guest image: builds
- Build/publish workflow → Debug shell image: builds
- Runtime image variants → GitHub Container Registry: publishes
- Bundled Debian guest image → GitHub Container Registry: publishes
- Debug shell image → Debug shell entrypoint: uses
- GitHub Container Registry → Pterodactyl Panel/Wings: selected image
- VM startup control plane → Blank-disk provisioning: selects mode
- VM startup control plane → Cloud-image provisioning: selects mode
- Blank-disk provisioning → Persistent VM state: creates disk and ISO state
- Cloud-image provisioning → Persistent VM state: creates persistent disk
- Bundled Debian guest image → Cloud-image provisioning: supplies base qcow2
- VM startup control plane → NoCloud seed ISO: generates for cloud images
- NoCloud seed ISO → Guest cloud-init: configures
- Persistent VM state → QEMU VM process: attaches disk and media
- VM startup control plane → QEMU VM process: launches and configures
- QEMU VM process → Guest operating system: runs
- Guest cloud-init → Guest operating system: provisions
- Pterodactyl Panel/Wings → QEMU VM process: exposes assigned ports · Panel allocations are required for host reachability.
- Wings KVM patch installer → Patched Wings overlay: installs
- Patched Wings overlay → Pterodactyl Panel/Wings: patches Wings runtime
- Pterodactyl Panel/Wings → VM startup control plane: optionally grants /dev/kvm