OS Manuals

/usr/bin/systemd-vmspawn

systemd container tools

From systemd-container 262.2-r1 (os), captured 2026-11-05 by running systemd-vmspawn --help (exit 0). permalink

> systemd-vmspawn [OPTION…] [ARGUMENTS…]

Spawn a command or OS in a virtual machine.

Options:
  -h --help                                                 Show this help
     --version                                              Show package version
  -q --quiet                                                Do not show status information
     --no-pager                                             Do not start a pager
     --no-ask-password                                      Do not prompt for password
     --system                                               Run in the system service manager scope
     --user                                                 Run in the user service manager scope

Image:
  -D --directory=PATH                                       Root directory for the VM
  -x --ephemeral                                            Run VM with snapshot of the disk or
                                                            directory
  -i --image=FILE|DEVICE                                    Root file system disk image or device
                                                            for the VM
     --image-format=FORMAT                                  Specify disk image format (raw, qcow2;
                                                            default: raw)
     --image-disk-type=TYPE                                 Specify disk type (virtio-blk,
                                                            virtio-scsi, nvme, scsi-cd; default:
                                                            virtio-blk)
     --discard-disk=BOOL                                    Control processing of discard requests
  -G --grow-image=BYTES                                     Grow image file to specified size in
                                                            bytes

Host Configuration:
     --cpus=CPUS                                            Configure number of CPUs in guest
     --ram=BYTES[:MAXBYTES[:SLOTS]]                         Configure guest's RAM size (and
                                                            max/slots for hotplug)
     --kvm=BOOL                                             Enable use of KVM
     --vsock=BOOL                                           Override autodetection of VSOCK support
     --vsock-cid=CID                                        Specify the CID to use for the guest's
                                                            VSOCK support
     --tpm=BOOL                                             Enable use of a virtual TPM
     --tpm-state=off|auto|PATH                              Where to store TPM state
     --efi-nvram-template=PATH                              Set the path to the EFI NVRAM template
                                                            file to use
     --efi-nvram-state=off|auto|PATH                        Where to store EFI Variable NVRAM state
     --secure-boot=BOOL|auto                                Enable searching for firmware supporting
                                                            SecureBoot
     --firmware=auto|uefi|bios|none|PATH|list|describe      Select firmware to use, or a firmware
                                                            definition file (or list/describe
                                                            available)
     --firmware-features=FEATURE,...|list                   Require/exclude specific firmware
                                                            features
     --coco=no|sev-snp|tdx                                  Run the guest as a confidential VM

Networking:
  -n --network-tap                                          Create a TAP device for networking
     --network-user-mode                                    Use user mode networking

Execution:
     --linux=PATH                                           Specify the linux kernel for direct
                                                            kernel boot
     --initrd=PATH                                          Specify the initrd for direct kernel
                                                            boot
  -s --smbios11=STRING                                      Pass an arbitrary SMBIOS Type #11 string
                                                            to the VM
     --notify-ready=BOOL                                    Wait for ready notification from the VM

System Identity:
  -M --machine=NAME                                         Set the machine name for the VM
     --uuid=UUID                                            Set a specific machine UUID for the VM

Properties:
  -S --slice=SLICE                                          Place the VM in the specified slice
     --property=NAME=VALUE                                  Set scope unit property
     --register=BOOLEAN                                     Register VM as machine
     --keep-unit                                            Do not register a scope for the machine,
                                                            reuse the service unit vmspawn is
                                                            running in

User Namespacing:
     --private-users=UIDBASE[:NUIDS]                        Configure the UID/GID range to map into
                                                            the virtiofsd namespace

Mounts:
     --bind=SOURCE[:TARGET]                                 Mount a file or directory from the host
                                                            into the VM
     --bind-ro=SOURCE[:TARGET]                              Mount a file or directory, but read-only
     --extra-drive=[FORMAT:][DISKTYPE:]PATH                 Adds an additional disk to the VM
     --bind-volume=PROVIDER:VOLUME[:CONFIG][:KEY=VALUE,...] Acquire a storage volume from a
                                                            StorageProvider and attach it to the VM
     --bind-user=NAME                                       Bind user from host to virtual machine
     --bind-user-shell=BOOL|PATH                            Configure the shell to use for
                                                            --bind-user= users
     --bind-user-group=GROUP                                Add an auxiliary group to --bind-user=
                                                            users

Logging:
     --forward-journal=FILE|DIR                             Forward the VM's journal to the host
     --forward-journal-max-use=BYTES                        Maximum disk space for forwarded journal
     --forward-journal-keep-free=BYTES                      Minimum disk space to keep free
     --forward-journal-max-file-size=BYTES                  Maximum size of individual journal files
     --forward-journal-max-files=N                          Maximum number of journal files to keep

SSH:
     --pass-ssh-key=BOOL                                    Create an SSH key to access the VM
     --ssh-key-type=TYPE                                    Choose what type of SSH key to pass

Input/Output:
     --console=MODE                                         Console mode (interactive, native, gui,
                                                            read-only or headless)
     --console-transport=TRANSPORT                          Console transport (virtio or serial)
     --background=COLOR                                     Set ANSI color for background

Credentials:
     --set-credential=ID:VALUE                              Pass a credential with literal value to
                                                            the VM
     --load-credential=ID:PATH                              Load credential for the VM from file or
                                                            AF_UNIX stream socket

See the systemd-vmspawn(1) man page for details.
Options (58)
OptionDescriptionSource
-h --helpShow this helphelp
--versionShow package versionhelp
-q --quietDo not show status informationhelp
--no-pagerDo not start a pagerhelp
--no-ask-passwordDo not prompt for passwordhelp
--systemRun in the system service manager scopehelp
--userRun in the user service manager scopehelp
-D --directory=PATHRoot directory for the VMhelp
-x --ephemeralRun VM with snapshot of the disk or directoryhelp
-i --image=FILE|DEVICERoot file system disk image or device for the VMhelp
--image-format FORMATSpecify disk image format (raw, qcow2;help
--image-disk-type TYPESpecify disk type (virtio-blk, virtio-scsi, nvme, scsi-cd;help
--discard-disk BOOLControl processing of discard requestshelp
-G --grow-image=BYTESGrow image file to specified size in byteshelp
--cpus CPUSConfigure number of CPUs in guesthelp
--ram BYTES[:MAXBYTES[:SLOTSConfigure guest's RAM size (and max/slots for hotplug)help
--kvm BOOLEnable use of KVMhelp
--vsock BOOLOverride autodetection of VSOCK supporthelp
--vsock-cid CIDSpecify the CID to use for the guest's VSOCK supporthelp
--tpm BOOLEnable use of a virtual TPMhelp
--tpm-state off|auto|PATHWhere to store TPM statehelp
--efi-nvram-template PATHSet the path to the EFI NVRAM template file to usehelp
--efi-nvram-state off|auto|PATHWhere to store EFI Variable NVRAM statehelp
--secure-boot BOOL|autoEnable searching for firmware supporting SecureBoothelp
--firmware auto|uefi|bios|none|PATH|list|describeSelect firmware to use, or a firmware definition file (or list/describe available)help
--firmware-features FEATURERequire/exclude specific firmware featureshelp
--coco no|sev-snp|tdxRun the guest as a confidential VMhelp
-n --network-tapCreate a TAP device for networkinghelp
--network-user-modeUse user mode networkinghelp
--linux PATHSpecify the linux kernel for direct kernel boothelp
--initrd PATHSpecify the initrd for direct kernel boothelp
-s --smbios11=STRINGPass an arbitrary SMBIOS Type #11 string to the VMhelp
--notify-ready BOOLWait for ready notification from the VMhelp
-M --machine=NAMESet the machine name for the VMhelp
--uuid UUIDSet a specific machine UUID for the VMhelp
-S --slice=SLICEPlace the VM in the specified slicehelp
--property NAME=VALUESet scope unit propertyhelp
--register BOOLEANRegister VM as machinehelp
--keep-unitDo not register a scope for the machine, reuse the service unit vmspawn is running inhelp
--private-users UIDBASE[:NUIDSConfigure the UID/GID range to map into the virtiofsd namespacehelp
--bind SOURCE[:TARGETMount a file or directory from the host into the VMhelp
--bind-ro SOURCE[:TARGETMount a file or directory, but read-onlyhelp
--extra-drive FORMAT:][DISKTYPE:]PATHAdds an additional disk to the VMhelp
--bind-user NAMEBind user from host to virtual machinehelp
--bind-user-shell BOOL|PATHConfigure the shell to use forhelp
--bind-user-group GROUPAdd an auxiliary group to --bind-user= usershelp
--forward-journal FILE|DIRForward the VM's journal to the hosthelp
--forward-journal-max-use BYTESMaximum disk space for forwarded journalhelp
--forward-journal-keep-free BYTESMinimum disk space to keep freehelp
--forward-journal-max-file-size BYTESMaximum size of individual journal fileshelp
--forward-journal-max-files NMaximum number of journal files to keephelp
--pass-ssh-key BOOLCreate an SSH key to access the VMhelp
--ssh-key-type TYPEChoose what type of SSH key to passhelp
--console MODEConsole mode (interactive, native, gui, read-only or headless)help
--console-transport TRANSPORTConsole transport (virtio or serial)help
--background COLORSet ANSI color for backgroundhelp
--set-credential ID:VALUEPass a credential with literal value to the VMhelp
--load-credential ID:PATHLoad credential for the VM from file or AF_UNIX stream sockethelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.