| SWM-VMM(8) | System Manager's Manual | SWM-VMM(8) |
NAME
swm-vmm —
scrotwmos virtual machine monitor
SYNOPSIS
swm-vmm |
[-d blobdir]
[-F flavor]
[-k fd
[-B] [-K
sha256] [-i
fd [-I
sha256]]] [-t
seconds] [-b
fd] [-p
[-r fd]]
[-M fd]
[-m bytes]
[-c vcpus]
[-G path
[-R fd
[-E fd]]]
[-u
name:uid:gid]
[-C fd
-V fd
[-V fd ...]
-A
addr[,addr ...]
[-U]] [[-f
fd] [-s
fd -g
gid [-S
peers]] [-n
fd [-N
ip]] [-Q
fd] | -T
fd [-D
resolver] [-P
servers] | -W
fd [-Y
n:rfd:ffd:efd
...]] |
DESCRIPTION
swm-vmm runs one virtual machine as one
host process, on KVM. It is the session daemon of a VM session. The root
monitor starts it and hands it every file and socket as an open descriptor.
Nobody runs it by hand. The guest's vCPUs are its threads, and the guest's
memory is its own. When the process ends, everything the guest held is
gone.
The guest's devices are virtio devices. With
-V, they are also whole PCI devices, a GPU or the
net VM's network cards, passed through with VFIO.
By default, it boots the signed guest kernel. It checks the signature before it maps any byte of the kernel. An image that does not check out boots nothing. The launcher starts it as the session's user. Once it is set up, it installs a seccomp filter that leaves it only the system calls a guest needs.
The options are as follows:
-Aaddr[,addr ...]- The functions of the devices the groups of
-Vhold, 1 to 8 of them in all, each as the kernel names a PCI device, 0000:bb:dd.f in lowercase. Each device sits on a slot of its own on the guest's bus: the first named at 00:02, the next at 00:03. Each function sits at its own function number less the lowest named on its device, so the slot has its function 0: 00:14.3 named alone is the guest's 00:02.0. -B- The kernel on
-kis the signed guest kernel, which the launcher found and checked against the signed index itself. The guest's console is then hvc0, as for the signed kernelswm-vmmfinds itself. Without it, a kernel on-kis a configuration's own, and its console is the serial port, ttyS0. -bfd- The guest's disk, an open file, shown to the guest as a virtio disk.
-Cfd,-Vfd- Whole devices for the guest alone: the VFIO container,
/dev/vfio/vfio, and a device's group,
/dev/vfio/n. Each
-Vnames one group, at most 4 in all. The launcher opens each one read-write, with its devices bound to vfio-pci.-C,-Vand-Ago together. They give the guest a whole GPU, or the net VM its NICs.-Vtakes no-G.swm-vmmresets each device and maps all of the guest's memory for their DMA. The map pins the memory underRLIMIT_MEMLOCK, which the launcher sets to the guest's memory.swm-vmmcloses the container and every group before the guest runs. The guest gets no memory balloon. -cvcpus- The guest's processors, 1 to 64; one without
-c. -Dresolver- With
-Tonly: the address of the name server the net VM gives its clients, one IPv4 address. -dblobdir,-Fflavor- Where the signed kernels are, and which flavor to boot. The flavor is
guest-stdunless-T,-W, or-pnames another. Neither goes with-k. -Efd- With
-R: the write end of a pipe, closed when the GPU device ends, so the root monitor learns of it. -ffd- The bus to the host compositor, wired to a port of the guest's virtio console. When the other end hangs up, the guest ends.
-Gpath,-Rfd- A GPU device for the guest, on the path the root monitor picked:
none, drawn by the guest's processors and shown through the pixel window;nctxorvenus, the guest's GPU commands sent to vmm-gfx(8) on-R, a connectedSOCK_SEQPACKETsocket that takes descriptors. When vmm-gfx fails, the GPU device ends and the guest runs on. The GPU device needs-f, as its frames go to the pixel window. -kfd- Boot this kernel instead of the signed one, with
-iits initramfs.-Kand-Igive the sha256 each must have. A file that reads otherwise boots nothing. -Mfd- /dev/kvm, opened read-write by the launcher. Under
the root monitor, the VMM's root holds no /dev.
Without
-M, it opens /dev/kvm itself. -mbytes- The guest's memory. The default is 3 GiB. The guest hands back the pages
it frees, except with
-V. -nfd,-Nip- The guest's network device and its address.
-Pservers- With
-Tonly: the net VM's time servers, 1 to 4 IPv4 addresses separated by commas, none 0.0.0.0 and none twice. -p- The guest is ttvm, with no pixel window. Standalone, the flavor is
ttvm. Needs-f; takes no-G,-T,-W,-s,-V,-C,-A,-Q, or-u. -Qfd- The root monitor's socket to quiesce a session VM's disk: its messages go
to the guest's PID 1 on a third port of the virtio console, and back.
Needs
-b; takes no-p,-T, or-W. -rfd- With
-p, a second disk, an open file read-only, shown to the guest as a read-only virtio disk.swm-vmmrefuses a write. -Speers- The sessions in the share, as
name:uid pairs separated by
commas, so the guest shows their files by name. Needs
-s. -sfd,-ggid- The share, served to the guest as a virtio file system, and its group.
-Tfd- The net VM's trunk: the control socket that the root monitor sends the
switch's ports on. The trunk is the guest's network device, so it takes no
-n,-N, or-s. -tseconds- End the guest after this many seconds.
-U- With
-C,-V, and-A: the GPU is for computing too. The guest is told so on its command line and loads the driver for it. -uname:uid:gid- The session's user, which the guest runs its programs as.
-Wfd- The gfx VM: the guest serves up to four client VMs' GPU devices. The root
monitor gives each client's socket on fd. The
guest's virtio console carries their messages on a third port.
swm-vmmchecks every message on its way in and out. The guest is told its role on its command line. It takes no-G,-R,-E,-T,-n,-N,-s,-g,-S,-C,-V,-A,-b,-p, or-u. Its bus takes no descriptor and has no pixel window. Standalone, the flavor isgfxvm. -Yn:rfd:ffd:efd- With
-Wonly, once for each slot n from 1 to 4, or not at all: slot n's GPU device, on the native context path. rfd is the socket to the slot's vmm-gfx(8) in the host, ffd its frame channel, and efd the write end of its end pipe. Each socket must be a connectedSOCK_SEQPACKETsocket that takes descriptors. The four devices are set up together. A slot whose vmm-gfx(8) fails at setup is dead and never falls back to a 2D device.
The net VM is started with -T,
-D, and -P in place of
-n, -N, and
-s: its trunk to the switch, its name server, and
its time servers. Its uplinks are its NICs, whole, by
-C, -V, and
-A.
The guest's console goes to the standard output: hvc0 on the
virtio console for the signed guest kernel, the serial port, ttyS0, for any
other. The serial port goes there too. SIGTERM and
SIGINT end the guest cleanly.
EXIT STATUS
- 0
- The guest stopped cleanly: it powered off, its bus closed, or a signal ended it.
- 1
swm-vmmfailed.- 2
- The guest lied to a device and was stopped as hostile.
- 3
- The guest crashed.
- 4
- The guest asked to reboot.
- 5
- The GPU of
-Vcould not be set up. - 6
- The GPU's group was refused: the host has no interrupt remapping.
- 7
- The GPU could not be reset.
- 8
- The GPU had ATS turned on after it was attached.
- 9
- The host reported an error of the GPU while the guest ran.
- 10
- The host asked for the GPU back while the guest ran.
The worst of these wins: once a guest is stopped as hostile, the exit is 2, however it ends.
SEE ALSO
swm-wl(1), scrotwmos.conf(5), scrotwmos(7), gpu-probe(8), scrotwmd(8), swm-ntp(8), swm-tt(8), vmm-gfx(8)
AUTHORS
Marco Peereboom <marco@peereboom.us>
| October 19, 2026 | Void Linux |