anyvm.py 0.4.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- anyvm_py-0.4.7/.gitignore +5 -0
- anyvm_py-0.4.7/LICENSE +21 -0
- anyvm_py-0.4.7/PKG-INFO +424 -0
- anyvm_py-0.4.7/README.md +401 -0
- anyvm_py-0.4.7/anyvm.py +7281 -0
- anyvm_py-0.4.7/pyproject.toml +66 -0
anyvm_py-0.4.7/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 anyvm.org
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
anyvm_py-0.4.7/PKG-INFO
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: anyvm.py
|
|
3
|
+
Version: 0.4.7
|
|
4
|
+
Summary: Run any VM anywhere: bootstrap BSD, Illumos, and Linux guests with QEMU on Linux, macOS, and Windows
|
|
5
|
+
Project-URL: Homepage, https://github.com/anyvm-org/anyvm
|
|
6
|
+
Project-URL: Repository, https://github.com/anyvm-org/anyvm
|
|
7
|
+
Project-URL: Issues, https://github.com/anyvm-org/anyvm/issues
|
|
8
|
+
Author: anyvm.org
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ci,dragonflybsd,freebsd,haiku,illumos,netbsd,openbsd,qemu,solaris,ubuntu,virtual-machine,vm
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: MacOS
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Topic :: Software Development :: Testing
|
|
20
|
+
Classifier: Topic :: System :: Emulators
|
|
21
|
+
Requires-Python: >=3.8
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# Run any VM anywhere
|
|
25
|
+
|
|
26
|
+
[](https://github.com/anyvm-org/anyvm/actions/workflows/test.yml)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
anyvm is a single-file tool for bootstrapping BSD, Illumos, and Linux 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.
|
|
30
|
+
|
|
31
|
+
## 1. Quick launch
|
|
32
|
+
|
|
33
|
+
- Github CodeSpace:
|
|
34
|
+
|
|
35
|
+
[](https://codespaces.new/anyvm-org/anyvm)
|
|
36
|
+
|
|
37
|
+
Enable KVM in Codespaces before running:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
sudo chmod o+rw /dev/kvm
|
|
41
|
+
|
|
42
|
+
sudo apt-get update
|
|
43
|
+
|
|
44
|
+
sudo apt-get --no-install-recommends -y install \
|
|
45
|
+
zstd ovmf xz-utils qemu-utils ca-certificates \
|
|
46
|
+
qemu-system-x86 qemu-system-arm qemu-efi-aarch64 \
|
|
47
|
+
qemu-efi-riscv64 qemu-system-riscv64 qemu-system-misc u-boot-qemu \
|
|
48
|
+
qemu-system-ppc qemu-system-s390x qemu-system-sparc \
|
|
49
|
+
openssh-client
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- Google Cloud Shell:
|
|
54
|
+
|
|
55
|
+
<a href="https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fanyvm-org%2Fanyvm&cloudshell_tutorial=.cloudshell%2Ftutorial.md&show=terminal&ephemeral=true&cloudshell_print=.cloudshell%2Fconsole.md" target="_blank" rel="noopener noreferrer">
|
|
56
|
+
<img src="https://gstatic.com/cloudssh/images/open-btn.svg" alt="Try it Now in Cloud Shell">
|
|
57
|
+
</a>
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## 2. Quick start (local)
|
|
61
|
+
|
|
62
|
+
Install from PyPI (installs the `anyvm.py` and `anyvm` commands):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install anyvm.py
|
|
66
|
+
|
|
67
|
+
anyvm.py --os freebsd
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Or download the single file and run it directly:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
#command line release
|
|
76
|
+
python3 anyvm.py --os freebsd
|
|
77
|
+
python3 anyvm.py --os freebsd --release 15.1
|
|
78
|
+
python3 anyvm.py --os freebsd --release 14.4
|
|
79
|
+
python3 anyvm.py --os freebsd --release 14.4 --arch aarch64
|
|
80
|
+
python3 anyvm.py --os openbsd --release 7.5 --arch aarch64
|
|
81
|
+
python3 anyvm.py --os solaris
|
|
82
|
+
python3 anyvm.py --os tribblix
|
|
83
|
+
python3 anyvm.py --os ubuntu
|
|
84
|
+
python3 anyvm.py --os ubuntu --release 24.04
|
|
85
|
+
python3 anyvm.py --os ghostbsd
|
|
86
|
+
python3 anyvm.py --os blissos
|
|
87
|
+
|
|
88
|
+
python3 anyvm.py --os freebsd --release 14.4 --arch riscv64
|
|
89
|
+
python3 anyvm.py --os freebsd --release 15.1 --arch riscv64
|
|
90
|
+
python3 anyvm.py --os freebsd --release 15.1 --arch powerpc64
|
|
91
|
+
|
|
92
|
+
python3 anyvm.py --os netbsd --release 11.0 --arch sparc64
|
|
93
|
+
python3 anyvm.py --os netbsd --release 11.0 --arch riscv64
|
|
94
|
+
python3 anyvm.py --os openbsd --release 7.9 --arch sparc64
|
|
95
|
+
|
|
96
|
+
python3 anyvm.py --os ubuntu --release 24.04 --arch aarch64
|
|
97
|
+
python3 anyvm.py --os ubuntu --release 24.04 --arch riscv64
|
|
98
|
+
python3 anyvm.py --os ubuntu --release 24.04 --arch s390x
|
|
99
|
+
python3 anyvm.py --os ubuntu --release 24.04 --arch ppc64le
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
#desktop release
|
|
104
|
+
|
|
105
|
+
python3 anyvm.py --os freebsd --release 15.1-xfce
|
|
106
|
+
python3 anyvm.py --os freebsd --release 15.1-gnome
|
|
107
|
+
python3 anyvm.py --os freebsd --release 15.1-kde6
|
|
108
|
+
|
|
109
|
+
python3 anyvm.py --os openbsd --release 7.9-xfce
|
|
110
|
+
python3 anyvm.py --os openbsd --release 7.9-gnome
|
|
111
|
+
python3 anyvm.py --os openbsd --release 7.9-kde6
|
|
112
|
+
python3 anyvm.py --os openbsd --release 7.9-mate
|
|
113
|
+
python3 anyvm.py --os openbsd --release 7.9-lxqt
|
|
114
|
+
python3 anyvm.py --os openbsd --release 7.9-lumina
|
|
115
|
+
python3 anyvm.py --os openbsd --release 7.9-enlightenment
|
|
116
|
+
|
|
117
|
+
python3 anyvm.py --os ghostbsd # MATE (default)
|
|
118
|
+
python3 anyvm.py --os ghostbsd --release 26.1-xfce
|
|
119
|
+
python3 anyvm.py --os ghostbsd --release 26.1-gershwin
|
|
120
|
+
|
|
121
|
+
# BlissOS (Android-x86): root ssh + the Android desktop on the VNC console
|
|
122
|
+
# -v folder sync uses scp (the only backend the Android guest supports).
|
|
123
|
+
python3 anyvm.py --os blissos # latest (16, Android 13)
|
|
124
|
+
python3 anyvm.py --os blissos --release 15 # Android 12L
|
|
125
|
+
python3 anyvm.py --os blissos --release 14 # Android 11
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
# Run a command inside the VM (everything after `--` is sent to the VM via ssh):
|
|
130
|
+
python3 anyvm.py --os freebsd -- uname -a
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## 3. Run in a Docker container
|
|
134
|
+
|
|
135
|
+
Prefer containers? Use the Dockerized wrapper.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
docker run --rm -it ghcr.io/anyvm-org/anyvm:latest --os freebsd
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
More examples and tags: https://github.com/anyvm-org/docker
|
|
142
|
+
|
|
143
|
+
## 4. Guest build matrix (CI)
|
|
144
|
+
|
|
145
|
+
| Guest | x86_64 | aarch64 (arm64) | riscv64 | powerpc64 | sparc64 | s390x | Builder |
|
|
146
|
+
|-------|--------|-----------------|---------|-----------|---------|-------|---------|
|
|
147
|
+
| Ubuntu<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/ubuntu.yml) | ✅ | ✅ | ✅ | ✅ | — | ✅ | [](https://github.com/anyvm-org/ubuntu-builder) |
|
|
148
|
+
| FreeBSD<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/freebsd.yml) | ✅ | ✅ | ✅ | ✅ | — | — | [](https://github.com/anyvm-org/freebsd-builder) |
|
|
149
|
+
| OpenBSD<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/openbsd.yml) | ✅ | ✅ | ✅ | — | ✅ | — | [](https://github.com/anyvm-org/openbsd-builder) |
|
|
150
|
+
| NetBSD<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/netbsd.yml) | ✅ | ✅ | ✅ | — | ✅ | — | [](https://github.com/anyvm-org/netbsd-builder) |
|
|
151
|
+
| DragonFlyBSD<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/dragonflybsd.yml) | ✅ | — | — | — | — | — | [](https://github.com/anyvm-org/dragonflybsd-builder) |
|
|
152
|
+
| MidnightBSD<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/midnightbsd.yml) | ✅ | — | — | — | — | — | [](https://github.com/anyvm-org/midnightbsd-builder) |
|
|
153
|
+
| GhostBSD<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/ghostbsd.yml) | ✅ | — | — | — | — | — | [](https://github.com/anyvm-org/ghostbsd-builder) |
|
|
154
|
+
| Solaris<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/solaris.yml) | ✅ | — | — | — | — | — | [](https://github.com/anyvm-org/solaris-builder) |
|
|
155
|
+
| OmniOS<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/omnios.yml) | ✅ | — | — | — | — | — | [](https://github.com/anyvm-org/omnios-builder) |
|
|
156
|
+
| OpenIndiana<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/openindiana.yml) | ✅ | — | — | — | — | — | [](https://github.com/anyvm-org/openindiana-builder) |
|
|
157
|
+
| Tribblix<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/tribblix.yml) | ✅ | — | — | — | — | — | [](https://github.com/anyvm-org/tribblix-builder) |
|
|
158
|
+
| Haiku<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/haiku.yml) | ✅ | — | — | — | — | — | [](https://github.com/anyvm-org/haiku-builder) |
|
|
159
|
+
| BlissOS (Android)<br>[](https://github.com/anyvm-org/anyvm/actions/workflows/blissos.yml) | ✅ | — | — | — | — | — | [](https://github.com/anyvm-org/blissos-builder) |
|
|
160
|
+
|
|
161
|
+
## 5. Host support
|
|
162
|
+
|
|
163
|
+
| Host | x86_64 guests | aarch64 guests | riscv64 guests | s390x guests | powerpc64 guests | sparc64 guests |
|
|
164
|
+
|------|---------------|----------------|----------------|--------------|------------------|----------------|
|
|
165
|
+
| Linux x86_64 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
166
|
+
| Linux aarch64 (arm64) | — | ✅ | — | — | — | — |
|
|
167
|
+
| Linux s390x (IBM Z) | — | — | — | ✅ (KVM) | — | — |
|
|
168
|
+
| MacOS Apple silicon | ✅ | ✅ | — | — | — | — |
|
|
169
|
+
| Windows x86_64 Native | ✅ | — | — | — | — | — |
|
|
170
|
+
| Windows x86_64 WSL | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
171
|
+
|
|
172
|
+
## 6. Install dependencies
|
|
173
|
+
|
|
174
|
+
### 6.1 Linux (apt-based) [](https://github.com/anyvm-org/anyvm/actions/workflows/test.yml)
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
sudo apt-get --no-install-recommends -y install \
|
|
178
|
+
zstd ovmf xz-utils qemu-utils ca-certificates \
|
|
179
|
+
qemu-system-x86 qemu-system-arm qemu-efi-aarch64 \
|
|
180
|
+
qemu-efi-riscv64 qemu-system-riscv64 qemu-system-misc u-boot-qemu \
|
|
181
|
+
qemu-system-ppc qemu-system-s390x qemu-system-sparc \
|
|
182
|
+
ssh-client
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 6.2 macOS [](https://github.com/anyvm-org/anyvm/actions/workflows/testmacos.yml)
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
brew install qemu
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### 6.3 Windows [](https://github.com/anyvm-org/anyvm/actions/workflows/testwindows.yml)
|
|
192
|
+
|
|
193
|
+
- Download QEMU for Windows: https://www.qemu.org/download/#windows or https://qemu.weilnetz.de/w64/
|
|
194
|
+
- Or install with MSYS2 pacman:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
pacman.exe -S --noconfirm mingw-w64-ucrt-x86_64-qemu
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
- Or install with Chocolatey:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
choco install qemu
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## 7. Notes
|
|
207
|
+
|
|
208
|
+
- Hardware virtualization (KVM, HVF, or Hyper-V) is applied automatically when available for best performance.
|
|
209
|
+
- On a nested AMD KVM host (e.g. KVM inside WSL2 / Hyper-V), AVX512 is
|
|
210
|
+
dropped from `-cpu host` automatically: nested AMD-V corrupts the guest's
|
|
211
|
+
AVX512 state, which makes modern guests (Ubuntu 26.04+) randomly
|
|
212
|
+
segfault. Bare-metal hosts keep full AVX512; override with `--cpu-type`.
|
|
213
|
+
- Click the quick launch buttons above to start in a ready-to-use cloud environment.
|
|
214
|
+
|
|
215
|
+
## 8. VNC Web UI (Display)
|
|
216
|
+
|
|
217
|
+
AnyVM includes a built-in, premium VNC Web UI that allows you to access the VM's graphical console directly from your browser.
|
|
218
|
+
|
|
219
|
+
<img width="1362" height="879" alt="xfce" src="https://github.com/user-attachments/assets/793e9341-4602-4ca0-b098-d5e29fab59f9" />
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
<img width="2348" height="1660" alt="image" src="https://github.com/user-attachments/assets/7f334153-5c89-4323-b6e8-86a1467c80df" />
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
- **Automatic Launch**: Enabled by default (unless `--vnc off` is specified). AnyVM automatically starts a VNC-to-Web proxy.
|
|
226
|
+
- **Modern Interface**: Features a sleek dark mode, glassmorphism aesthetics, and smooth animations.
|
|
227
|
+
- **Clipboard Support**: Use the "Paste Text" button or `Ctrl+V` to send your local clipboard to the VM.
|
|
228
|
+
- **Special Keys**: Dedicated "Ctrl+Alt+Del" button.
|
|
229
|
+
- **Fullscreen**: Toggle fullscreen mode for an immersive experience.
|
|
230
|
+
- **Stats**: Real-time FPS and latency monitoring.
|
|
231
|
+
- **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).
|
|
232
|
+
- **Security**: Protect your VNC session with `--vnc-password <pwd>`. 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**).
|
|
233
|
+
- **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).
|
|
234
|
+
|
|
235
|
+
## 9. CLI options (with examples)
|
|
236
|
+
|
|
237
|
+
All examples below use `python3 anyvm.py ...`. You can also run `python3 anyvm.py --help` to see the built-in help.
|
|
238
|
+
|
|
239
|
+
### Required
|
|
240
|
+
|
|
241
|
+
- `--os <name>`: Target guest OS (required).
|
|
242
|
+
- Supported: `freebsd` / `ghostbsd` / `openbsd` / `netbsd` / `dragonflybsd` / `midnightbsd` / `solaris` / `omnios` / `openindiana` / `tribblix` / `haiku` / `ubuntu` / `blissos`
|
|
243
|
+
- Example:
|
|
244
|
+
- `python3 anyvm.py --os freebsd`
|
|
245
|
+
|
|
246
|
+
### Release / arch / resources
|
|
247
|
+
|
|
248
|
+
- `--release <ver>`: Guest release version. If omitted, anyvm auto-selects an available release.
|
|
249
|
+
- Example: `python3 anyvm.py --os freebsd --release 14.4`
|
|
250
|
+
|
|
251
|
+
- `--arch <arch>`: Guest architecture.
|
|
252
|
+
- Common values: `x86_64` / `aarch64` / `riscv64` / `s390x` / `powerpc64` /
|
|
253
|
+
`ppc64le` / `sparc64`
|
|
254
|
+
- Example: `python3 anyvm.py --os openbsd --release 7.5 --arch aarch64`
|
|
255
|
+
- Notes for ubuntu guests on emulated arches (always TCG, slow):
|
|
256
|
+
- `aarch64` defaults to `-cpu cortex-a72` (distro QEMU 8.2 aborts with a
|
|
257
|
+
`regime_is_user` assertion when the 26.04 kernel uses VHE under
|
|
258
|
+
`-cpu max`).
|
|
259
|
+
- `riscv64` 26.04 requires QEMU >= 9.1 (`-cpu rva23s64` is selected
|
|
260
|
+
automatically; the RVA23 userspace baseline and the 7.0 kernel do not
|
|
261
|
+
run on QEMU 8.2). 22.04 / 24.04 work on stock QEMU.
|
|
262
|
+
- `s390x` works best with QEMU >= 10; the distro 8.2 intermittently
|
|
263
|
+
freezes guest systemd at startup (a TCG-only bug). On a real IBM Z
|
|
264
|
+
host with `/dev/kvm`, KVM is used automatically (`-cpu host`) and
|
|
265
|
+
stock QEMU is fine.
|
|
266
|
+
- `ppc64le` 22.04 requires QEMU >= 10; under the distro 8.2 pseries TCG
|
|
267
|
+
the jammy python3.10 segfaults (every cloud-init / apt run crashes).
|
|
268
|
+
24.04 / 26.04 work on stock QEMU.
|
|
269
|
+
- For the riscv64 26.04, s390x and ppc64le 22.04 cases, on Linux x86_64
|
|
270
|
+
hosts anyvm.py automatically downloads and uses pinned QEMU 10.2.3
|
|
271
|
+
whenever the system QEMU is too old -- no manual setup needed.
|
|
272
|
+
[ubuntu-builder](https://github.com/anyvm-org/ubuntu-builder) compiles
|
|
273
|
+
these from source in its release-files job (they are no longer
|
|
274
|
+
committed to git) and publishes them as release assets; see its
|
|
275
|
+
`files/README.md`.
|
|
276
|
+
- `openbsd --arch sparc64`: anyvm.py automatically downloads the patched
|
|
277
|
+
OpenBIOS firmware the image needs (QEMU's bundled OpenBIOS crashes every
|
|
278
|
+
OpenBSD >= 7.3 sparc64 kernel on cold boot) and passes it via `-bios`.
|
|
279
|
+
[openbsd-builder](https://github.com/anyvm-org/openbsd-builder) rebuilds
|
|
280
|
+
it from source in its release-files job and publishes it as a release
|
|
281
|
+
asset; see its `bios/README.md`.
|
|
282
|
+
- `netbsd --arch sparc64`: host-dir sync (`-v`) defaults to `scp`
|
|
283
|
+
(override with `--sync`). The QEMU sun4u machine boots only off the
|
|
284
|
+
CMD646 PCI IDE, whose TCG emulation loses interrupts under sustained
|
|
285
|
+
concurrent net+disk DMA -- a live `sshfs`/`nfs` mount drives exactly that
|
|
286
|
+
and wedges the guest, and the 11.0 base image ships no `rsync`. A one-shot
|
|
287
|
+
`scp` avoids both. (sparc64 is headless / console-only on either OS.)
|
|
288
|
+
|
|
289
|
+
- `--mem <MB>`: Memory size in MB (default: 2048).
|
|
290
|
+
- Example: `python3 anyvm.py --os freebsd --mem 4096`
|
|
291
|
+
|
|
292
|
+
- `--cpu <num>`: vCPU count (default: all host cores).
|
|
293
|
+
- Example: `python3 anyvm.py --os freebsd --cpu 4`
|
|
294
|
+
|
|
295
|
+
- `--cpu-type <type>`: QEMU CPU model (e.g. `host`, `cortex-a72`).
|
|
296
|
+
- Example: `python3 anyvm.py --os openbsd --arch aarch64 --cpu-type cortex-a72`
|
|
297
|
+
|
|
298
|
+
### Images / builders
|
|
299
|
+
|
|
300
|
+
- `--builder <ver>`: Pin a specific builder version (used to download matching cloud images).
|
|
301
|
+
- Example: `python3 anyvm.py --os netbsd --builder 2.0.1`
|
|
302
|
+
|
|
303
|
+
- `--qcow2 <path>`: Use a local qcow2 image (skip downloading).
|
|
304
|
+
- Example: `python3 anyvm.py --os freebsd --qcow2 .\\output\\freebsd\\freebsd-14.4.qcow2`
|
|
305
|
+
|
|
306
|
+
- `--snapshot`: Enable QEMU snapshot mode. Changes made to the disk are not saved.
|
|
307
|
+
- Works with `--cache-dir` to run directly from the cache without copying to the data directory.
|
|
308
|
+
- Example: `python3 anyvm.py --os freebsd --snapshot`
|
|
309
|
+
|
|
310
|
+
### Networking (user-mode networking / slirp)
|
|
311
|
+
|
|
312
|
+
- `--ssh-port <port>` / `--sshport <port>`: Host port forwarded to guest SSH (`:22`). If omitted, anyvm auto-picks a free port.
|
|
313
|
+
- Example: `python3 anyvm.py --os freebsd --ssh-port 10022`
|
|
314
|
+
|
|
315
|
+
- `--ssh-name <name>`: Add an extra SSH alias name for convenience (so you can `ssh <name>`).
|
|
316
|
+
- Example: `python3 anyvm.py --os freebsd --ssh-name myvm`
|
|
317
|
+
|
|
318
|
+
- `--host-ssh-port <port>`: The host SSH port as reachable from the guest (default: 22). Used for generating a `Host host` entry inside the guest.
|
|
319
|
+
- Example: `python3 anyvm.py --os freebsd --host-ssh-port 2222`
|
|
320
|
+
|
|
321
|
+
- `-p <mapping>`: Additional port forwards (repeatable).
|
|
322
|
+
- Form 1: `host:guest` (TCP by default)
|
|
323
|
+
- Example: `python3 anyvm.py --os freebsd -p 8080:80`
|
|
324
|
+
- Form 2: `tcp:host:guest`
|
|
325
|
+
- Example: `python3 anyvm.py --os freebsd -p tcp:8443:443`
|
|
326
|
+
- Form 3: `udp:host:guest`
|
|
327
|
+
- Example: `python3 anyvm.py --os freebsd -p udp:5353:5353`
|
|
328
|
+
|
|
329
|
+
- `--public`: Listen on `0.0.0.0` for forwarded ports instead of `127.0.0.1`.
|
|
330
|
+
- Example: `python3 anyvm.py --os freebsd --public -p 8080:80`
|
|
331
|
+
|
|
332
|
+
- `--enable-ipv6`: Enable IPv6 in QEMU user networking (slirp).
|
|
333
|
+
- Default: IPv6 is disabled (anyvm adds `ipv6=off` to `-netdev user,...`).
|
|
334
|
+
- Example: `python3 anyvm.py --os freebsd --enable-ipv6`
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
### Shared folders (-v) and sync mode (--sync)
|
|
338
|
+
|
|
339
|
+
- `-v <host:guest>`: Add a shared/synced folder mapping (repeatable).
|
|
340
|
+
- Linux/macOS example: `python3 anyvm.py --os freebsd -v $(pwd):/data`
|
|
341
|
+
- Windows example: `python3 anyvm.py --os freebsd -v D:\\data:/data`
|
|
342
|
+
|
|
343
|
+
- `--sync <mode>`: Sync mechanism used for `-v`. Strictly validated.
|
|
344
|
+
- Supported: `rsync` (default), `sshfs`, `nfs`, `scp`. Empty string also defaults to `rsync`. Any other value will cause an error.
|
|
345
|
+
- Examples:
|
|
346
|
+
- `python3 anyvm.py --os freebsd --sync rsync -v $(pwd):/data`
|
|
347
|
+
- `python3 anyvm.py --os solaris --sync scp -v D:\\data:/data`
|
|
348
|
+
|
|
349
|
+
### Console / display / debugging
|
|
350
|
+
|
|
351
|
+
- `--console` / `-c`: Run in the foreground (console mode).
|
|
352
|
+
- Example: `python3 anyvm.py --os freebsd --console`
|
|
353
|
+
|
|
354
|
+
- `--detach` / `-d`: Run in the background (do not auto-enter SSH).
|
|
355
|
+
- Example: `python3 anyvm.py --os freebsd --detach`
|
|
356
|
+
|
|
357
|
+
- `--serial <port>`: Expose the guest serial console via a host TCP port (if omitted, auto-select starting at 7000).
|
|
358
|
+
- Example: `python3 anyvm.py --os freebsd --serial 7000`
|
|
359
|
+
|
|
360
|
+
- `--vnc <display>`: Enable VNC (e.g. `0` means `:0` / port 5900).
|
|
361
|
+
- **VNC Web UI**: Enabled by default starting at port `6080` (auto-increments if busy). Use `--vnc off` to disable.
|
|
362
|
+
- Example: `python3 anyvm.py --os freebsd --vnc 0`
|
|
363
|
+
|
|
364
|
+
- `--vnc-password <pwd>`: 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**).
|
|
365
|
+
- Example: `python3 anyvm.py --os freebsd --vnc-password mysecret`
|
|
366
|
+
|
|
367
|
+
- `--remote-vnc`: Create a public tunnel for the VNC Web UI using Cloudflare, Localhost.run, Pinggy, or Serveo.
|
|
368
|
+
- Example: `python3 anyvm.py --os freebsd --remote-vnc`
|
|
369
|
+
- Advanced: Use `cf`, `lhr`, `pinggy`, or `serveo` to specify a service: `python3 anyvm.py --os freebsd --remote-vnc cf`
|
|
370
|
+
- Disable: Use `no` to disable (e.g., in Google Cloud Shell where it's default): `python3 anyvm.py --os freebsd --remote-vnc no`
|
|
371
|
+
|
|
372
|
+
- `--mon <port>`: Expose the QEMU monitor via telnet on localhost.
|
|
373
|
+
- Example: `python3 anyvm.py --os freebsd --mon 4444`
|
|
374
|
+
|
|
375
|
+
- `--debug`: Enable verbose debug logging.
|
|
376
|
+
- Example: `python3 anyvm.py --os freebsd --debug`
|
|
377
|
+
|
|
378
|
+
### Boot / platform
|
|
379
|
+
|
|
380
|
+
- `--uefi`: Enable UEFI boot (FreeBSD enables this implicitly).
|
|
381
|
+
- Example: `python3 anyvm.py --os freebsd --uefi`
|
|
382
|
+
|
|
383
|
+
- `--disktype <type>`: Disk interface type (e.g. `virtio`, `ide`).
|
|
384
|
+
- Example: `python3 anyvm.py --os dragonflybsd --disktype ide`
|
|
385
|
+
|
|
386
|
+
- `--boot-timeout-sec <n>`: Boot timeout in seconds before QEMU is killed and retried once. Default: `600` (10 minutes).
|
|
387
|
+
- Exception: OpenBSD on `aarch64` defaults to `1200` (20 minutes) because it boots much slower under emulation.
|
|
388
|
+
- Exception: when running under TCG (no hardware acceleration -- e.g. Windows runners with chocolatey QEMU, or any host without `/dev/kvm` / HVF / WHPX), the default is bumped to `1800` (30 minutes). TCG is 10-50x slower than KVM, and heavy guests like Solaris or DragonFlyBSD often need more time to boot.
|
|
389
|
+
- Both exceptions only apply when `--boot-timeout-sec` is not explicitly passed; an explicit value always wins.
|
|
390
|
+
- Useful for slow hosts (emulated arches, low-resource CI runners) or for failing fast in tests.
|
|
391
|
+
- Example: `python3 anyvm.py --os openbsd --boot-timeout-sec 1200`
|
|
392
|
+
|
|
393
|
+
- `--enable-pmu`: Expose the host PMU (performance monitoring unit / hardware performance counters) to the guest.
|
|
394
|
+
- **Disabled by default.** Exposing the host PMU via `-cpu host` can trigger intermittent `#GP`-in-`wrmsr` crashes during early guest boot when the host CPU generation exposes PMU MSRs that KVM refuses writes to. DragonFlyBSD is the most affected guest; this manifested as random boot failures across CI runners with different Intel CPU generations.
|
|
395
|
+
- Only applies to x86_64 with hardware acceleration (`kvm` / `whpx` / `hvf`). TCG and non-x86 arches are unaffected.
|
|
396
|
+
- Pass `--enable-pmu` if you need `perf` / `pmcstat` / VTune or similar profilers to work inside the guest.
|
|
397
|
+
- Example: `python3 anyvm.py --os ubuntu --enable-pmu -- perf stat ls`
|
|
398
|
+
|
|
399
|
+
- `--tcg`: Force pure software emulation (no KVM / HVF / WHPX). Slow; useful when hardware acceleration is unavailable or misbehaving. Generic -- works for any guest.
|
|
400
|
+
- Example: `python3 anyvm.py --os tribblix --tcg`
|
|
401
|
+
- Historical note: older `tribblix` releases froze a CPU-vendor-specific `libc_hwcap` variant into `/lib/libc.so.1` at build time, which crash-looped (`init` killed by `SIGKILL`) when run under KVM on the other vendor's CPU; anyvm used to auto-fall-back to TCG on Intel hosts to dodge it. Since `v2.0.3` (tribblix-builder's `finalizeImage` hook) the release ships the generic, capability-neutral libc that boots under KVM on both Intel and AMD and re-optimizes per-CPU at first boot, so no fallback is needed. Use `--tcg` only if you must run a pre-`v2.0.3` image on a mismatched CPU.
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
### Data directory
|
|
406
|
+
|
|
407
|
+
- `--data-dir <dir>`: Directory used to store images and caches (default: `./output`).
|
|
408
|
+
- Example: `python3 anyvm.py --os freebsd --data-dir output`
|
|
409
|
+
|
|
410
|
+
### Run a command inside the VM
|
|
411
|
+
|
|
412
|
+
- `-- <cmd...>`: Everything after `--` is passed through to the final `ssh` invocation and executed inside the VM.
|
|
413
|
+
- Examples:
|
|
414
|
+
- `python3 anyvm.py --os freebsd -- uname -a`
|
|
415
|
+
- `python3 anyvm.py --os freebsd -- sh -lc "id; uname -a"`
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|