anyvm is a single-file tool for bootstrapping BSD and Illumos guests with QEMU on Linux, macOS, and Windows. It downloads cloud images, sets up firmware, and starts the VM with sane defaults so you can focus on the guest.
-
Github CodeSpace:
Enable KVM in Codespaces before running:
sudo chmod o+rw /dev/kvm sudo apt-get --no-install-recommends -y install \ zstd ovmf xz-utils qemu-utils ca-certificates \ qemu-system-x86 qemu-system-arm qemu-efi-aarch64 \ qemu-efi-riscv64 qemu-system-riscv64 qemu-system-misc u-boot-qemu \ openssh-client
-
Google Cloud Shell:
python anyvm.py --os freebsd
python anyvm.py --os freebsd --release 14.3
python anyvm.py --os freebsd --release 14.3 --arch aarch64
python anyvm.py --os openbsd --release 7.5 --arch aarch64
python anyvm.py --os solaris
python anyvm.py --os freebsd --release 14.3 --arch riscv64
# Run a command inside the VM (everything after `--` is sent to the VM via ssh):
python anyvm.py --os freebsd -- uname -aPrefer containers? Use the Dockerized wrapper.
docker run --rm -it ghcr.io/anyvm-org/anyvm:latest --os freebsdMore examples and tags: https://github.com/anyvm-org/docker
| Guest | Workflow | x86_64 | aarch64 (arm64) | riscv64 |
|---|---|---|---|---|
| FreeBSD | ✅ | ✅ | ✅ | |
| OpenBSD | ✅ | ✅ | ✅ | |
| NetBSD | ✅ | ✅ | ❌ | |
| DragonFlyBSD | ✅ | ❌ | ❌ | |
| Solaris | ✅ | ❌ | ❌ | |
| OmniOS | ✅ | ❌ | ❌ | |
| OpenIndiana | ✅ | ❌ | ❌ | |
| Haiku | ✅ | ❌ | ❌ |
| Host | x86_64 guests | aarch64 guests | riscv64 guests |
|---|---|---|---|
| Linux x86_64 | ✅ | ✅ | ✅ |
| Linux aarch64 (arm64) | ❌ | ✅ | ❌ |
| MacOS Apple silicon | ✅ | ✅ | ❌ |
| Windows x86_64 | ✅ | ❌ | ❌ |
sudo apt-get --no-install-recommends -y install \
zstd ovmf xz-utils qemu-utils ca-certificates \
qemu-system-x86 qemu-system-arm qemu-efi-aarch64 \
qemu-efi-riscv64 qemu-system-riscv64 u-boot-qemu \
ssh-clientbrew install qemu- Download QEMU for Windows: https://www.qemu.org/download/#windows or https://qemu.weilnetz.de/w64/
- Or install with MSYS2 pacman:
pacman.exe -S --noconfirm mingw-w64-ucrt-x86_64-qemu- Or install with Chocolatey:
choco install qemu- Hardware virtualization (KVM, HVF, or Hyper-V) is applied automatically when available for best performance.
- Click the quick launch buttons above to start in a ready-to-use cloud environment.
AnyVM includes a built-in, premium VNC Web UI that allows you to access the VM's graphical console directly from your browser.
- Automatic Launch: Enabled by default (unless
--vnc offis specified). AnyVM automatically starts a VNC-to-Web proxy. - Modern Interface: Features a sleek dark mode, glassmorphism aesthetics, and smooth animations.
- Clipboard Support: Use the "Paste Text" button or
Ctrl+Vto send your local clipboard to the VM. - Special Keys: Dedicated "Ctrl+Alt+Del" button.
- Fullscreen: Toggle fullscreen mode for an immersive experience.
- Stats: Real-time FPS and latency monitoring.
- Clipboard Support: Use the "Paste Text" button or
- Accessibility: Available at
http://localhost:6080by default. If the port is occupied, AnyVM will automatically try the next available port (e.g., 6081, 6082).
All examples below use python anyvm.py .... You can also run python anyvm.py --help to see the built-in help.
--os <name>: Target guest OS (required).- Supported:
freebsd/openbsd/netbsd/dragonflybsd/solaris/omnios/openindiana/haiku - Example:
python anyvm.py --os freebsd
- Supported:
-
--release <ver>: Guest release version. If omitted, anyvm auto-selects an available release.- Example:
python anyvm.py --os freebsd --release 14.3
- Example:
-
--arch <arch>: Guest architecture.- Common values:
x86_64/aarch64/riscv64 - Example:
python anyvm.py --os openbsd --release 7.5 --arch aarch64
- Common values:
-
--mem <MB>: Memory size in MB (default: 2048).- Example:
python anyvm.py --os freebsd --mem 4096
- Example:
-
--cpu <num>: vCPU count (default: all host cores).- Example:
python anyvm.py --os freebsd --cpu 4
- Example:
-
--cpu-type <type>: QEMU CPU model (e.g.host,cortex-a72).- Example:
python anyvm.py --os openbsd --arch aarch64 --cpu-type cortex-a72
- Example:
-
--builder <ver>: Pin a specific builder version (used to download matching cloud images).- Example:
python anyvm.py --os netbsd --builder 2.0.1
- Example:
-
--qcow2 <path>: Use a local qcow2 image (skip downloading).- Example:
python anyvm.py --os freebsd --qcow2 .\\output\\freebsd\\freebsd-14.3.qcow2
- Example:
-
--snapshot: Enable QEMU snapshot mode. Changes made to the disk are not saved.- Works with
--cache-dirto run directly from the cache without copying to the data directory. - Example:
python anyvm.py --os freebsd --snapshot
- Works with
-
--ssh-port <port>/--sshport <port>: Host port forwarded to guest SSH (:22). If omitted, anyvm auto-picks a free port.- Example:
python anyvm.py --os freebsd --ssh-port 10022
- Example:
-
--ssh-name <name>: Add an extra SSH alias name for convenience (so you canssh <name>).- Example:
python anyvm.py --os freebsd --ssh-name myvm
- Example:
-
--host-ssh-port <port>: The host SSH port as reachable from the guest (default: 22). Used for generating aHost hostentry inside the guest.- Example:
python anyvm.py --os freebsd --host-ssh-port 2222
- Example:
-
-p <mapping>: Additional port forwards (repeatable).- Form 1:
host:guest(TCP by default)- Example:
python anyvm.py --os freebsd -p 8080:80
- Example:
- Form 2:
tcp:host:guest- Example:
python anyvm.py --os freebsd -p tcp:8443:443
- Example:
- Form 3:
udp:host:guest- Example:
python anyvm.py --os freebsd -p udp:5353:5353
- Example:
- Form 1:
-
--public: Listen on0.0.0.0for forwarded ports instead of127.0.0.1.- Example:
python anyvm.py --os freebsd --public -p 8080:80
- Example:
-
--enable-ipv6: Enable IPv6 in QEMU user networking (slirp).- Default: IPv6 is disabled (anyvm adds
ipv6=offto-netdev user,...). - Example:
python anyvm.py --os freebsd --enable-ipv6
- Default: IPv6 is disabled (anyvm adds
-
-v <host:guest>: Add a shared/synced folder mapping (repeatable).- Linux/macOS example:
python anyvm.py --os freebsd -v $(pwd):/data - Windows example:
python anyvm.py --os freebsd -v D:\\data:/data
- Linux/macOS example:
-
--sync <mode>: Sync mechanism used for-v.- Supported:
sshfs(default),nfs,rsync,scp - Examples:
python anyvm.py --os freebsd --sync rsync -v $(pwd):/datapython anyvm.py --os solaris --sync scp -v D:\\data:/data
- Supported:
-
--console/-c: Run in the foreground (console mode).- Example:
python anyvm.py --os freebsd --console
- Example:
-
--detach/-d: Run in the background (do not auto-enter SSH).- Example:
python anyvm.py --os freebsd --detach
- Example:
-
--serial <port>: Expose the guest serial console via a host TCP port (if omitted, auto-select starting at 7000).- Example:
python anyvm.py --os freebsd --serial 7000
- Example:
-
--vnc <display>: Enable VNC (e.g.0means:0/ port 5900).- VNC Web UI: Enabled by default starting at port
6080(auto-increments if busy). Use--vnc offto disable. - Example:
python anyvm.py --os freebsd --vnc 0
- VNC Web UI: Enabled by default starting at port
-
--mon <port>: Expose the QEMU monitor via telnet on localhost.- Example:
python anyvm.py --os freebsd --mon 4444
- Example:
-
--debug: Enable verbose debug logging.- Example:
python anyvm.py --os freebsd --debug
- Example:
-
--uefi: Enable UEFI boot (FreeBSD enables this implicitly).- Example:
python anyvm.py --os freebsd --uefi
- Example:
-
--disktype <type>: Disk interface type (e.g.virtio,ide).- Example:
python anyvm.py --os dragonflybsd --disktype ide
- Example:
-
--whpx: (Windows) Attempt to use WHPX acceleration.- Example:
python anyvm.py --os freebsd --whpx
- Example:
--data-dir <dir>/--workingdir <dir>: Directory used to store images and caches (default:./output).- Example:
python anyvm.py --os freebsd --data-dir .\\output
- Example:
-- <cmd...>: Everything after--is passed through to the finalsshinvocation and executed inside the VM.- Examples:
python anyvm.py --os freebsd -- uname -apython anyvm.py --os freebsd -- sh -lc "id; uname -a"
- Examples: