https://github.com/anyvm-org/anyvm
Run any VM anywhere: run FreeBSD, OpenBSD, NetBSD, Solaris, OmniOS and more on Windows, Linux and Macos
https://github.com/anyvm-org/anyvm
dragonflybsd freebsd netbsd omnios openbsd openindiana solaris vm
Last synced: about 1 month ago
JSON representation
Run any VM anywhere: run FreeBSD, OpenBSD, NetBSD, Solaris, OmniOS and more on Windows, Linux and Macos
- Host: GitHub
- URL: https://github.com/anyvm-org/anyvm
- Owner: anyvm-org
- License: mit
- Created: 2025-11-22T09:10:41.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-01-28T19:35:07.000Z (about 2 months ago)
- Last Synced: 2026-01-29T09:49:25.299Z (about 2 months ago)
- Topics: dragonflybsd, freebsd, netbsd, omnios, openbsd, openindiana, solaris, vm
- Language: Python
- Homepage: https://AnyVM.org
- Size: 520 KB
- Stars: 41
- Watchers: 0
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Run any VM anywhere [](https://github.com/anyvm-org/anyvm/actions/workflows/test.yml)
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.
## 1. Quick launch
- Github CodeSpace:
[](https://codespaces.new/anyvm-org/anyvm)
Enable KVM in Codespaces before running:
```bash
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:
## 2. Quick start (local)
```bash
#desktop release
python3 anyvm.py --os freebsd --release 15.0-xfce
python3 anyvm.py --os freebsd --release 15.0-gnome
python3 anyvm.py --os freebsd --release 15.0-kde6
#command line release
python3 anyvm.py --os freebsd
python3 anyvm.py --os freebsd --release 14.3
python3 anyvm.py --os freebsd --release 14.3 --arch aarch64
python3 anyvm.py --os openbsd --release 7.5 --arch aarch64
python3 anyvm.py --os solaris
python3 anyvm.py --os freebsd --release 14.3 --arch riscv64
# Run a command inside the VM (everything after `--` is sent to the VM via ssh):
python3 anyvm.py --os freebsd -- uname -a
```
## 3. Run in a Docker container
Prefer containers? Use the Dockerized wrapper.
```bash
docker run --rm -it ghcr.io/anyvm-org/anyvm:latest --os freebsd
```
More examples and tags: https://github.com/anyvm-org/docker
## 4. Guest build matrix (CI)
| Guest | Workflow | x86_64 | aarch64 (arm64) | riscv64 | Builder |
|-------|----------|--------|-----------------|---------|---------|
| FreeBSD | [](https://github.com/anyvm-org/anyvm/actions/workflows/freebsd.yml) | ✅ | ✅ | ✅ | [Builder](https://github.com/anyvm-org/freebsd-builder) |
| OpenBSD | [](https://github.com/anyvm-org/anyvm/actions/workflows/openbsd.yml) | ✅ | ✅ | ✅ | [Builder](https://github.com/anyvm-org/openbsd-builder) |
| NetBSD | [](https://github.com/anyvm-org/anyvm/actions/workflows/netbsd.yml) | ✅ | ✅ | ❌ | [Builder](https://github.com/anyvm-org/netbsd-builder) |
| DragonFlyBSD | [](https://github.com/anyvm-org/anyvm/actions/workflows/dragonflybsd.yml) | ✅ | ❌ | ❌ | [Builder](https://github.com/anyvm-org/dragonflybsd-builder) |
| Solaris | [](https://github.com/anyvm-org/anyvm/actions/workflows/solaris.yml) | ✅ | ❌ | ❌ | [Builder](https://github.com/anyvm-org/solaris-builder) |
| OmniOS | [](https://github.com/anyvm-org/anyvm/actions/workflows/omnios.yml) | ✅ | ❌ | ❌ | [Builder](https://github.com/anyvm-org/omnios-builder) |
| OpenIndiana | [](https://github.com/anyvm-org/anyvm/actions/workflows/openindiana.yml) | ✅ | ❌ | ❌ | [Builder](https://github.com/anyvm-org/openindiana-builder) |
| Haiku | [](https://github.com/anyvm-org/anyvm/actions/workflows/haiku.yml) | ✅ | ❌ | ❌ | [Builder](https://github.com/anyvm-org/haiku-builder) |
## 5. Host support
| Host | x86_64 guests | aarch64 guests | riscv64 guests |
|------|---------------|----------------|----------------|
| Linux x86_64 | ✅ | ✅ | ✅ |
| Linux aarch64 (arm64) | ❌ | ✅ | ❌ |
| MacOS Apple silicon | ✅ | ✅ | ❌ |
| Windows x86_64 Native | ✅ | ❌ | ❌ |
| Windows x86_64 WSL | ✅ | ✅ | ✅ |
## 6. Install dependencies
### 6.1 Linux (apt-based) [](https://github.com/anyvm-org/anyvm/actions/workflows/test.yml)
```bash
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-client
```
### 6.2 macOS [](https://github.com/anyvm-org/anyvm/actions/workflows/testmacos.yml)
```bash
brew install qemu
```
### 6.3 Windows [](https://github.com/anyvm-org/anyvm/actions/workflows/testwindows.yml)
- Download QEMU for Windows: https://www.qemu.org/download/#windows or https://qemu.weilnetz.de/w64/
- Or install with MSYS2 pacman:
```bash
pacman.exe -S --noconfirm mingw-w64-ucrt-x86_64-qemu
```
- Or install with Chocolatey:
```bash
choco install qemu
```
## 7. Notes
- 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.
## 8. VNC Web UI (Display)
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 off` is 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+V` to 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.
- **Accessibility**: Available at `http://localhost:6080` by default. If the port is occupied, AnyVM will automatically try the next available port (e.g., 6081, 6082).
- **Security**: Protect your VNC session with `--vnc-password `. When set, the browser will prompt for credentials when accessing the Web UI. (Note: The **username can be anything**, but the **password must be correct**).
- **Remote Access**: Use `--remote-vnc` to automatically create a public, secure tunnel (via Cloudflare, Localhost.run, Pinggy, or Serveo) to access your VM's display from anywhere in the world. (In Google Cloud Shell, this is enabled by default; use `--remote-vnc no` to disable).
## 9. CLI options (with examples)
All examples below use `python3 anyvm.py ...`. You can also run `python3 anyvm.py --help` to see the built-in help.
### Required
- `--os `: Target guest OS (required).
- Supported: `freebsd` / `openbsd` / `netbsd` / `dragonflybsd` / `solaris` / `omnios` / `openindiana` / `haiku`
- Example:
- `python3 anyvm.py --os freebsd`
### Release / arch / resources
- `--release `: Guest release version. If omitted, anyvm auto-selects an available release.
- Example: `python3 anyvm.py --os freebsd --release 14.3`
- `--arch `: Guest architecture.
- Common values: `x86_64` / `aarch64` / `riscv64`
- Example: `python3 anyvm.py --os openbsd --release 7.5 --arch aarch64`
- `--mem `: Memory size in MB (default: 2048).
- Example: `python3 anyvm.py --os freebsd --mem 4096`
- `--cpu `: vCPU count (default: all host cores).
- Example: `python3 anyvm.py --os freebsd --cpu 4`
- `--cpu-type `: QEMU CPU model (e.g. `host`, `cortex-a72`).
- Example: `python3 anyvm.py --os openbsd --arch aarch64 --cpu-type cortex-a72`
### Images / builders
- `--builder `: Pin a specific builder version (used to download matching cloud images).
- Example: `python3 anyvm.py --os netbsd --builder 2.0.1`
- `--qcow2 `: Use a local qcow2 image (skip downloading).
- Example: `python3 anyvm.py --os freebsd --qcow2 .\\output\\freebsd\\freebsd-14.3.qcow2`
- `--snapshot`: Enable QEMU snapshot mode. Changes made to the disk are not saved.
- Works with `--cache-dir` to run directly from the cache without copying to the data directory.
- Example: `python3 anyvm.py --os freebsd --snapshot`
### Networking (user-mode networking / slirp)
- `--ssh-port ` / `--sshport `: Host port forwarded to guest SSH (`:22`). If omitted, anyvm auto-picks a free port.
- Example: `python3 anyvm.py --os freebsd --ssh-port 10022`
- `--ssh-name `: Add an extra SSH alias name for convenience (so you can `ssh `).
- Example: `python3 anyvm.py --os freebsd --ssh-name myvm`
- `--host-ssh-port `: The host SSH port as reachable from the guest (default: 22). Used for generating a `Host host` entry inside the guest.
- Example: `python3 anyvm.py --os freebsd --host-ssh-port 2222`
- `-p `: Additional port forwards (repeatable).
- Form 1: `host:guest` (TCP by default)
- Example: `python3 anyvm.py --os freebsd -p 8080:80`
- Form 2: `tcp:host:guest`
- Example: `python3 anyvm.py --os freebsd -p tcp:8443:443`
- Form 3: `udp:host:guest`
- Example: `python3 anyvm.py --os freebsd -p udp:5353:5353`
- `--public`: Listen on `0.0.0.0` for forwarded ports instead of `127.0.0.1`.
- Example: `python3 anyvm.py --os freebsd --public -p 8080:80`
- `--enable-ipv6`: Enable IPv6 in QEMU user networking (slirp).
- Default: IPv6 is disabled (anyvm adds `ipv6=off` to `-netdev user,...`).
- Example: `python3 anyvm.py --os freebsd --enable-ipv6`
### Shared folders (-v) and sync mode (--sync)
- `-v `: Add a shared/synced folder mapping (repeatable).
- Linux/macOS example: `python3 anyvm.py --os freebsd -v $(pwd):/data`
- Windows example: `python3 anyvm.py --os freebsd -v D:\\data:/data`
- `--sync `: Sync mechanism used for `-v`. Strictly validated.
- Supported: `rsync` (default), `sshfs`, `nfs`, `scp`. Empty string also defaults to `rsync`. Any other value will cause an error.
- Examples:
- `python3 anyvm.py --os freebsd --sync rsync -v $(pwd):/data`
- `python3 anyvm.py --os solaris --sync scp -v D:\\data:/data`
### Console / display / debugging
- `--console` / `-c`: Run in the foreground (console mode).
- Example: `python3 anyvm.py --os freebsd --console`
- `--detach` / `-d`: Run in the background (do not auto-enter SSH).
- Example: `python3 anyvm.py --os freebsd --detach`
- `--serial `: Expose the guest serial console via a host TCP port (if omitted, auto-select starting at 7000).
- Example: `python3 anyvm.py --os freebsd --serial 7000`
- `--vnc `: Enable VNC (e.g. `0` means `:0` / port 5900).
- **VNC Web UI**: Enabled by default starting at port `6080` (auto-increments if busy). Use `--vnc off` to disable.
- Example: `python3 anyvm.py --os freebsd --vnc 0`
- `--vnc-password `: Set a password for the VNC Web UI. Empty or omitted means no password. (Note: On the login page, the **username can be anything**, but the **password must be correct**).
- Example: `python3 anyvm.py --os freebsd --vnc-password mysecret`
- `--remote-vnc`: Create a public tunnel for the VNC Web UI using Cloudflare, Localhost.run, Pinggy, or Serveo.
- Example: `python3 anyvm.py --os freebsd --remote-vnc`
- Advanced: Use `cf`, `lhr`, `pinggy`, or `serveo` to specify a service: `python3 anyvm.py --os freebsd --remote-vnc cf`
- Disable: Use `no` to disable (e.g., in Google Cloud Shell where it's default): `python3 anyvm.py --os freebsd --remote-vnc no`
- `--mon `: Expose the QEMU monitor via telnet on localhost.
- Example: `python3 anyvm.py --os freebsd --mon 4444`
- `--debug`: Enable verbose debug logging.
- Example: `python3 anyvm.py --os freebsd --debug`
### Boot / platform
- `--uefi`: Enable UEFI boot (FreeBSD enables this implicitly).
- Example: `python3 anyvm.py --os freebsd --uefi`
- `--disktype `: Disk interface type (e.g. `virtio`, `ide`).
- Example: `python3 anyvm.py --os dragonflybsd --disktype ide`
### Data directory
- `--data-dir `: Directory used to store images and caches (default: `./output`).
- Example: `python3 anyvm.py --os freebsd --data-dir output`
### Run a command inside the VM
- `-- `: Everything after `--` is passed through to the final `ssh` invocation and executed inside the VM.
- Examples:
- `python3 anyvm.py --os freebsd -- uname -a`
- `python3 anyvm.py --os freebsd -- sh -lc "id; uname -a"`