English | 中文
This guide covers how to set up the AxVisor development environment locally and run different guest operating systems on QEMU.
- OS: Linux (native or WSL2)
- Architecture: x86_64 host
sudo apt update && sudo apt install -y \
build-essential gcc libssl-dev libudev-dev pkg-config \
qemu-system-x86 qemu-system-arm qemu-system-misc \
git curl wgetcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"Once you enter the project directory, Rust will automatically install the required nightly toolchain, components, and cross-compilation targets based on rust-toolchain.toml — no manual configuration needed.
Install additional Cargo tools:
cargo install cargo-binutils
cargo +stable install ostool --version '^0.8'cargo-binutils: providesrust-objcopy,rust-objdump, etc.ostool: custom build runner for AxVisor
NimbOS runs on x86_64 QEMU and requires KVM hardware acceleration. ArceOS and Linux use AArch64 QEMU (TCG mode) and do not need KVM — you can skip this section.
Verify the KVM device exists:
ls -la /dev/kvmAdd your user to the kvm group:
sudo usermod -aG kvm $USERApply the group change in the current terminal without re-logging:
newgrp kvmVerify:
id # output should include "kvm"This branch provides a one-click setup script scripts/setup_qemu.sh that automatically downloads guest images, patches configuration paths, and prepares the rootfs.
./scripts/setup_qemu.sh arceos
cargo xtask qemu \
--build-config configs/board/qemu-aarch64.toml \
--qemu-config .github/workflows/qemu-aarch64.toml \
--vmconfigs tmp/vmconfigs/arceos-aarch64-qemu-smp1.generated.tomlSuccess indicator: Hello, world! appears in the output.
./scripts/setup_qemu.sh linux
cargo xtask qemu \
--build-config configs/board/qemu-aarch64.toml \
--qemu-config .github/workflows/qemu-aarch64.toml \
--vmconfigs tmp/vmconfigs/linux-aarch64-qemu-smp1.generated.tomlSuccess indicator: test pass! appears in the output.
./scripts/setup_qemu.sh nimbos
cargo xtask qemu \
--build-config configs/board/qemu-x86_64.toml \
--qemu-config .github/workflows/qemu-x86_64-kvm.toml \
--vmconfigs tmp/vmconfigs/nimbos-x86_64-qemu-smp1.generated.tomlAfter booting, you will enter the Rust user shell (>> prompt). Type usertests to run the test suite. All tests passing will print usertests passed!
Note: NimbOS requires VT-x/KVM. If
/dev/kvmdoes not exist or has insufficient permissions, you will get aPermission deniederror. WSL2 requires nested virtualization support in the kernel to use KVM.
The script automates three steps, eliminating manual work:
- Download images: calls
cargo xtask image downloadto fetch guest images to/tmp/.axvisor-images/ - Generate temp configs: copies VM config templates to
tmp/vmconfigs/*.generated.toml, then usessedto updatekernel_path(andbios_pathfor NimbOS) to actual image paths without modifying tracked files inconfigs/vms/*.toml - Prepare rootfs: copies
rootfs.imgto the project'stmp/directory for QEMU to use
You can also perform these steps manually if you prefer not to use the script.
The kernel_path in the VM config points to a non-existent file. Run ./scripts/setup_qemu.sh <guest> to automatically fix the paths.
Your user is not in the kvm group. See the "KVM Setup" section above.
QEMU is not installed. Run the apt install command from Step 1.
This usually indicates unstable access to GitHub Raw endpoints. scripts/setup_qemu.sh includes one built-in recovery attempt: when the first image download fails, it bootstraps a local registry and retries once automatically. The script also has a default fallback registry (currently pointing to v0.0.22.toml).
If your network is unstable for specific registry URLs, you can override the fallback registry:
export AXVISOR_REGISTRY_FALLBACK_URL="https://raw.githubusercontent.com/arceos-hypervisor/axvisor-guest/refs/heads/main/registry/v0.0.22.toml"
./scripts/setup_qemu.sh arceosThis is expected. AxVisor has many dependencies, and the first compilation needs to download and build all crates. Subsequent incremental builds will be much faster.