xl.cfg(5)

๐Ÿ’– xl.cfg(5) โ€” xl domain configuration file syntax ๐Ÿ’–

okay bestie, this is the manual page for xl.cfg(5), aka the glow-up guide for Xen domain config files. it's long, so buckle up ๐Ÿ’…


๐ŸŒธ NAME ๐ŸŒธ

xl.cfg โ€” xl domain configuration file syntax. that's the whole name vibe.

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

/etc/xen/xldomain

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

Creating a VM โ€” a domain in Xen terminology, sometimes called a guest โ€” with xl requires the provision of a domain configuration file. Typically, these live in /etc/xen/DOMAIN.cfg, where DOMAIN is the name of the domain.

โœจ SYNTAX โœจ

A domain configuration file consists of a series of options, specified by using "KEY=VALUE" pairs.

Some KEYs are mandatory, some are general options which apply to any guest type, while others relate only to specific guest types (e.g. PV or HVM guests).

A VALUE can be one of:

  • "STRING" โ€” a string, surrounded by either single or double quotes. But if the STRING is part of a SPEC_STRING, the quotes should be omitted.
  • NUMBER โ€” a number, in either decimal, octal (using a 0 prefix) or hexadecimal (using a "0x" prefix) format.
  • BOOLEAN โ€” a NUMBER interpreted as False (0) or True (any other value).
  • [ VALUE, VALUE, ... ] โ€” a list of VALUEs of the above types. Lists can be heterogeneous and nested.

The semantics of each KEY defines which type of VALUE is required.

Pairs may be separated either by a newline or a semicolon. Both of the following are valid:

name="h0"
type="hvm"
name="h0"; type="hvm"

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

๐Ÿ’… Mandatory Configuration Items ๐Ÿ’…

The following key is mandatory for any guest type.

  • name="NAME" โ€” specifies the name of the domain. Names of domains existing on a single host must be unique. no duplicates, bestie, it's giving "one name per host" energy.

๐Ÿงš Selecting Guest Type ๐Ÿงš

  • type="pv" โ€” specifies that this is to be a PV domain, suitable for hosting Xen-aware guest operating systems. This is the default on x86.
  • type="pvh" โ€” specifies that this is to be an PVH domain. That is a lightweight HVM-like guest without a device model and without many of the emulated devices available to HVM guests. Note that this mode requires a PVH aware kernel on x86. This is the default on Arm.
  • type="hvm" โ€” specifies that this is to be an HVM domain. That is, a fully virtualised computer with emulated BIOS, disk and network peripherals, etc.

Deprecated guest type selection

Note that the builder option is being deprecated in favor of the type option.

  • builder="generic" โ€” specifies that this is to be a PV domain, suitable for hosting Xen-aware guest operating systems. This is the default.
  • builder="hvm" โ€” specifies that this is to be an HVM domain. That is, a fully virtualised computer with emulated BIOS, disk and network peripherals, etc.

๐ŸŒˆ General Options ๐ŸŒˆ

The following options apply to guests of any type.

๐Ÿ“ CPU Allocation ๐Ÿ“

  • pool="CPUPOOLNAME" โ€” put the guest's vCPUs into the named CPU pool.
  • vcpus=N โ€” start the guest with N vCPUs initially online.
  • maxvcpus=M โ€” allow the guest to bring up a maximum of M vCPUs. When starting the guest, if vcpus=N is less than maxvcpus=M then the first N vCPUs will be created online and the remainder will be created offline.
  • cpus="CPULIST" โ€” list of host CPUs the guest is allowed to use. Default is no pinning at all (more on this below). A "CPULIST" may be specified as follows:
    • "all" โ€” to allow all the vCPUs of the guest to run on all the CPUs on the host.
    • "0-3,5,^1" โ€” to allow all the vCPUs of the guest to run on CPUs 0,2,3,5. It is possible to combine this with "all", meaning "all,^7" results in all the vCPUs of the guest being allowed to run on all the CPUs of the host except CPU 7.
    • "nodes:0-3,^node:2" โ€” to allow all the vCPUs of the guest to run on the CPUs from NUMA nodes 0,1,3 of the host. So, if CPUs 0-3 belong to node 0, CPUs 4-7 belong to node 1, CPUs 8-11 to node 2 and CPUs 12-15 to node 3, the above would mean all the vCPUs of the guest would be allowed to run on CPUs 0-7,12-15.

Combining this notation with the one above is possible. For instance, "1,node:1,^6", means all the vCPUs of the guest will run on CPU 1 and on all the CPUs of NUMA node 1, but not on CPU 6. Following the same example as above, that would be CPUs 1,4,5,7.

Combining this with "all" is also possible, meaning "all,^node:1" results in all the vCPUs of the guest running on all the CPUs on the host, except for the CPUs belonging to the host NUMA node 1.

  • ["2", "3-8,^5"] โ€” to ask for specific vCPU mapping. That means (in this example), vCPU 0 of the guest will run on CPU 2 of the host and vCPU 1 of the guest will run on CPUs 3,4,6,7,8 of the host (excluding CPU 5).

More complex notation can be also used, exactly as described above. So "all,^5-8", or just "all", or "node:0,node:2,^9-11,18-20" are all legal, for each element of the list.

If this option is not specified, no vCPU to CPU pinning is established, and the vCPUs of the guest can run on all the CPUs of the host. If this option is specified, the intersection of the vCPU pinning mask, provided here, and the soft affinity mask, if provided via cpus_soft=, is utilized to compute the domain node-affinity for driving memory allocations.

  • cpus_soft="CPULIST" โ€” exactly as cpus=, but specifies soft affinity, rather than pinning (hard affinity). When using the credit scheduler, this means what CPUs the vCPUs of the domain prefer.

A "CPULIST" is specified exactly as for cpus=, detailed earlier in the manual.

If this option is not specified, the vCPUs of the guest will not have any preference regarding host CPUs. If this option is specified, the intersection of the soft affinity mask, provided here, and the vCPU pinning, if provided via cpus=, is utilized to compute the domain node-affinity for driving memory allocations.

If this option is not specified (and cpus= is not specified either), libxl automatically tries to place the guest on the least possible number of nodes. A heuristic approach is used for choosing the best node (or set of nodes), with the goal of maximizing performance for the guest and, at the same time, achieving efficient utilization of host CPUs and memory. In that case, the soft affinity of all the vCPUs of the domain will be set to host CPUs belonging to NUMA nodes chosen during placement.

For more details, see xl-numa-placement(7).

โญ CPU Scheduling โญ

  • cpu_weight=WEIGHT โ€” a domain with a weight of 512 will get twice as much CPU as a domain with a weight of 256 on a contended host. Legal weights range from 1 to 65535 and the default is 256. Honoured by the credit and credit2 schedulers.
  • cap=N โ€” the cap optionally fixes the maximum amount of CPU a domain will be able to consume, even if the host system has idle CPU cycles. The cap is expressed as a percentage of one physical CPU: 100 is 1 physical CPU, 50 is half a CPU, 400 is 4 CPUs, etc. The default, 0, means there is no cap. Honoured by the credit and credit2 schedulers.
NOTE: Many systems have features that will scale down the computing power of a CPU that is not 100% utilized. This can be done in the operating system, but can also sometimes be done below the operating system, in the BIOS. If you set a cap such that individual cores are running at less than 100%, this may have an impact on the performance of your workload over and above the impact of the cap. For example, if your processor runs at 2GHz, and you cap a VM at 50%, the power management system may also reduce the clock speed to 1GHz; the effect will be that your VM gets 25% of the available power (50% of 1GHz) rather than 50% (50% of 2GHz). If you are not getting the performance you expect, look at performance and CPU frequency options in your operating system and your BIOS.

๐Ÿงธ Memory Allocation ๐Ÿงธ

  • memory=MBYTES โ€” start the guest with MBYTES megabytes of RAM.
  • maxmem=MBYTES โ€” specifies the maximum amount of memory a guest can ever see. The value of maxmem= must be equal to or greater than that of memory=.

In combination with memory= it will start the guest "pre-ballooned", if the values of memory= and maxmem= differ. A "pre-ballooned" HVM guest needs a balloon driver, without a balloon driver it will crash.

NOTE: Because of the way ballooning works, the guest has to allocate memory to keep track of maxmem pages, regardless of how much memory it actually has available to it. A guest with maxmem=262144 and memory=8096 will report significantly less memory available for use than a system with maxmem=8096 memory=8096 due to the memory overhead of having to track the unused pages.

๐Ÿฆ„ Guest Virtual NUMA Configuration ๐Ÿฆ„

  • vnuma=[ VNODE_SPEC, VNODE_SPEC, ... ] โ€” specify virtual NUMA configuration with positional arguments. The nth VNODE_SPEC in the list specifies the configuration of the nth virtual node.

Note that virtual NUMA is not supported for PV guests yet, because there is an issue with the CPUID instruction handling that affects PV virtual NUMA. Furthermore, guests with virtual NUMA cannot be saved or migrated because the migration stream does not preserve node information.

Each VNODE_SPEC is a list, which has a form of "[VNODE_CONFIG_OPTION, VNODE_CONFIG_OPTION, ... ]" (without the quotes).

For example, vnuma = [ ["pnode=0","size=512","vcpus=0-4","vdistances=10,20"] ] means vnode 0 is mapped to pnode 0, has 512MB ram, has vcpus 0 to 4, the distance to itself is 10 and the distance to vnode 1 is 20.

Each VNODE_CONFIG_OPTION is a quoted "KEY=VALUE" pair. Supported VNODE_CONFIG_OPTIONs are (they are all mandatory at the moment):

  • pnode=NUMBER โ€” specifies which physical node this virtual node maps to.
  • size=MBYTES โ€” specifies the size of this virtual node. The sum of memory sizes of all vnodes will become maxmem=. If maxmem= is specified separately, a check is performed to make sure the sum of all vnode memory matches maxmem=.
  • vcpus="CPUSTRING" โ€” specifies which vCPUs belong to this node. "CPUSTRING" is a string of numerical values separated by a comma. You can specify a range and/or a single CPU. An example would be vcpus=0-5,8, which means you specified vCPU 0 to vCPU 5, and vCPU 8.
  • vdistances=NUMBER, NUMBER, ... โ€” okay so this one lists the virtual distance from this node to every other node (yes, including itself ๐Ÿ’ซ) using positional args. So like, "vdistance=10,20" for vnode 0 means distance from vnode 0 โ†’ vnode 0 is 10, and vnode 0 โ†’ vnode 1 is 20. The number of args you hand over has to match the total number of vnodes, no skipping. Ngl the easy way to fill this list is just grabbing the values from xl info -n or numactl --hardware. ๐Ÿซถ

๐ŸŽฌ Event Actions

  • on_poweroff="ACTION" โ€” tells xl what to do with the domain when it shuts itself down. The ACTIONs, bestie:
    • destroy โ€” destroy the domain. ๐Ÿ’€
    • restart โ€” destroy the domain and immediately create a new domain with the same configuration. ๐Ÿ”
    • rename-restart โ€” rename the domain that terminated, then immediately create a new domain with the same configuration as the original.
    • preserve โ€” keep the domain. It can be examined, and later destroyed with xl destroy. ๐ŸŽ€
    • coredump-destroy โ€” write a "coredump" of the domain to /var/lib/xen/dump/NAME and then destroy the domain.
    • coredump-restart โ€” write a "coredump" of the domain to /var/lib/xen/dump/NAME and then restart the domain.
    • soft-reset โ€” reset all Xen specific interfaces for the Xen-aware HVM domain, letting it reestablish those interfaces and continue executing the domain. PV and non-Xen-aware HVM guests are not supported. ๐Ÿ™ˆ

The default for on_poweroff is destroy.

  • on_reboot="ACTION" โ€” action to take if the domain shuts down with a reason code requesting a reboot. Default is restart. โœจ
  • on_watchdog="ACTION" โ€” action to take if the domain shuts down due to a Xen watchdog timeout. Default is destroy. โฐ
  • on_crash="ACTION" โ€” action to take if the domain crashes. Default is destroy. ๐Ÿ˜ญ
  • on_soft_reset="ACTION" โ€” action to take if the domain performs a 'soft reset' (like, it does kexec). Default is soft-reset.

๐Ÿง Direct Kernel Boot

So direct kernel boot lets you boot guests with a kernel and an initrd that live on a filesystem the host physical machine can actually see โ€” which is iconic because command line args can be passed directly. ๐ŸŽ€

PV guest direct kernel boot is supported. HVM guest direct kernel boot is supported with some limitations โ€” it's supported when using qemu-xen and the default BIOS seabios, but not supported in case of using stubdom-dm and the old rombios. Noted, don't @ me. ๐Ÿ’…

  • kernel="PATHNAME" โ€” load the specified file as the kernel image.
  • ramdisk="PATHNAME" โ€” load the specified file as the ramdisk.
  • cmdline="STRING" โ€” append STRING to the kernel command line. (Note: the meaning of this is guest specific). It can replace root="STRING" along with extra="STRING" and is preferred. When cmdline="STRING" is set, root="STRING" and extra="STRING" will be ignored. ๐Ÿ‘‘
  • root="STRING" โ€” append root=STRING to the kernel command line (Note: the meaning of this is guest specific).
  • extra="STRING" โ€” append STRING to the kernel command line. (Note: the meaning of this is guest specific).

๐ŸŒˆ Non direct Kernel Boot

Non direct kernel boot lets you boot guests with a firmware. Every type of guest can use this, though the options you pick differ depending on the guest type.

This option gives you the flexibility of letting the guest decide which kernel it wants to boot, while preventing having to poke at the guest filesystem from the toolstack domain. Like, the guest is the main character here. โœจ

๐Ÿ’œ PV guest options

  • firmware="pvgrub32|pvgrub64" โ€” boots a guest using a para-virtualized version of grub that runs inside the guest. You gotta know the bitness of the guest so the right version of pvgrub gets selected.
Heads up bestie: xl expects to find the pvgrub32.bin and pvgrub64.bin binaries in /usr/lib/xen-4.20/boot. ๐Ÿ“

๐Ÿฆ‹ HVM guest options

  • firmware="bios" โ€” boot the guest using the default BIOS firmware, which depends on the chosen device model.
  • firmware="uefi" โ€” boot the guest using the default UEFI firmware, currently OVMF.
  • firmware="seabios" โ€” boot the guest using the SeaBIOS BIOS firmware.
  • firmware="rombios" โ€” boot the guest using the ROMBIOS BIOS firmware.
  • firmware="ovmf" โ€” boot the guest using the OVMF UEFI firmware.
  • firmware="PATH" โ€” load the specified file as firmware for the guest.

๐ŸŒธ PVH guest options

Currently there's no firmware available for PVH guests โ€” they should be booted using the Direct Kernel Boot method or the bootloader option. That's just how it is, fr fr. ๐Ÿ™ˆ

  • pvshim=BOOLEAN โ€” whether to boot this guest as a PV guest within a PVH container. Ie, the guest will experience a PV environment, but processor hardware extensions are used to separate its address space to mitigate the Meltdown attack (CVE-2017-5754). ๐Ÿ›ก๏ธ Default is false.
  • pvshim_path="PATH" โ€” the PV shim is a specially-built firmware-like executable constructed from the hypervisor source tree. This option specifies to use a non-default shim. Ignored if pvhsim is false.
  • pvshim_cmdline="STRING" โ€” command line for the shim. Default is "pv-shim console=xen,pv". Ignored if pvhsim is false.
  • pvshim_extra="STRING" โ€” extra command line arguments for the shim. If supplied, appended to the value for pvshim_cmdline. Default is empty. Ignored if pvhsim is false. โœจ

๐ŸŽ€ Other Options

  • uuid="UUID" โ€” specifies the UUID of the domain. If you don't specify one, a fresh unique UUID gets generated for you. Slay, automatic.
  • seclabel="LABEL" โ€” assign an XSM security label to this domain. ๐Ÿ”
  • init_seclabel="LABEL" โ€” specify an XSM security label used for this domain temporarily during its build. The domain's XSM label will be changed to the execution seclabel (specified by seclabel) once the build is complete, prior to unpausing the domain. With a properly constructed security policy (such as nomigrate_t in the example policy), this can be used to build a domain whose memory is not accessible to the toolstack domain. Big brain energy. ๐Ÿง โœจ
  • max_grant_frames=NUMBER โ€” the maximum number of grant frames the domain is allowed to have. This value controls how many pages the domain is able to grant access to for other domains, needed e.g. for the operation of paravirtualized devices. The default is settable via xl.conf(5).
  • max_maptrack_frames=NUMBER โ€” the maximum number of grant maptrack frames the domain is allowed to have. This value controls how many pages of foreign domains can be accessed via the grant mechanism by this domain. The default value is settable via xl.conf(5).
  • max_grant_version=NUMBER โ€” the maximum grant table version the domain is allowed to use. The default value is settable via xl.conf(5).
  • nomigrate=BOOLEAN โ€” disable migration of this domain. This enables certain other features which are incompatible with migration. Currently this is limited to enabling the invariant TSC feature flag in CPUID results when TSC is not emulated. ๐Ÿšซโœˆ๏ธ
  • driver_domain=BOOLEAN โ€” specify that this domain is a driver domain. This enables certain features needed in order to run a driver domain. ๐Ÿš—
  • device_tree=PATH โ€” specify a partial device tree (compiled via the Device Tree Compiler). Everything under the node "/passthrough" will be copied into the guest device tree. For convenience, the node "/aliases" is also copied, so you can define aliases which the guest kernel can use. ๐ŸŒณ

Given the complexity of verifying the validity of a device tree, this option should only be used with a trusted device tree. For real, don't play with this one.

Note that the partial device tree should avoid using the phandle 65000 which is reserved by the toolstack. ๐Ÿ’…
  • passthrough="STRING" โ€” specify whether IOMMU mappings are enabled for the domain and hence whether it will be enabled for passthrough hardware. The valid values are:
    • disabled โ€” IOMMU mappings are disabled for the domain and so hardware may not be passed through. This option is the default if no passthrough hardware is specified in the domain's configuration.
    • enabled โ€” this option enables IOMMU mappings and selects an appropriate default operating mode (see below for details of the operating modes). For HVM/PVH domains running on platforms where the option is available, this is equivalent to share_pt. Otherwise, and also for PV domains, this option is equivalent to sync_pt. This option is the default if passthrough hardware is specified in the domain's configuration.
    • sync_pt โ€” this option means that IOMMU mappings will be synchronized with the domain's P2M table as follows:
      • For a PV domain, all writable pages assigned to the domain are identity mapped by MFN in the IOMMU page table. Thus a device driver running in the domain may program passthrough hardware for DMA using MFN values (i.e. host/machine frame numbers) looked up in its P2M.
      • For an HVM/PVH domain, all non-foreign RAM pages present in its P2M will be mapped by GFN in the IOMMU page table. Thus a device driver running in the domain may program passthrough hardware using GFN values (i.e. guest physical frame numbers) without any further translation.
      • This option is not currently available on Arm. ๐Ÿ™…
    • share_pt โ€” this option is unavailable for a PV domain. For an HVM/PVH domain, this option means that the IOMMU will be programmed to directly reference the domain's P2M table as its page table. From the point of view of a device driver running in the domain this is functionally equivalent to sync_pt but places less load on the hypervisor and so should generally be selected in preference. However, the availability of this option is hardware specific. If xl info reports virt_caps containing iommu_hap_pt_share then this option may be used. ๐Ÿ”
    • default โ€” the default, which chooses between disabled and enabled according to whether passthrough devices are enabled in the config file.
  • xend_suspend_evtchn_compat=BOOLEAN โ€” if this option is true the xenstore path for the domain's suspend event channel will not be created. Instead the old xend behaviour of making the whole xenstore device sub-tree writable by the domain will be re-instated. Throwback behaviour, iykyk. ๐Ÿ•ฐ๏ธ

โ€ฆand okay one more thing about that one, because it lowkey matters ๐Ÿ’…: the existence of the suspend event channel path can cause problems with certain PV drivers running in the guest (e.g. old Red Hat PV drivers for Windows).

If this option is not specified then it will default to false.

  • vmtrace_buf_kb=KBYTES โ€” sets the size of the vmtrace buffer that gets allocated for each vCPU belonging to this domain ๐Ÿงš. It's disabled by default, i.e. vmtrace_buf_kb=0.
NOTE: acceptable values are platform specific, bestie โ€” no universal answer here ๐Ÿ˜ญ. For Intel Processor Trace, this value must be a power of 2 between 4k and 16M.
  • vpmu=BOOLEAN โ€” currently ARM only, just so you know ๐Ÿ‘€. It specifies whether to enable access to PMU registers by disabling the PMU traps.

The PMU registers are not virtualized, and the physical registers are directly accessible when this parameter is enabled ๐Ÿซถ. There is no interrupt support, and Xen will not save/restore the register values on context switches.

vPMU, by design and purpose, exposes system level performance information to the guest. Only to be used by sufficiently privileged domains โš ๏ธ. This feature is currently in experimental state.

If this option is not specified then it will default to false.

๐ŸŽฎ Devices ๐ŸŽฎ

The following options define the paravirtual, emulated and physical devices which the guest will contain. Basically: what hardware is this bb getting ๐Ÿ‘‘.

  • disk=[ "DISK_SPEC_STRING", "DISK_SPEC_STRING", ...] โ€” specifies the disks (both emulated disks and Xen virtual block devices) which are to be provided to the guest, and what objects on the host they should map to. See xl-disk-configuration(5) for more details ๐Ÿ’พ.
  • vif=[ "NET_SPEC_STRING", "NET_SPEC_STRING", ...] โ€” specifies the network interfaces (both emulated network adapters and Xen virtual interfaces) which are to be provided to the guest. See xl-network-configuration(5) for more details ๐ŸŒ.
  • vtpm=[ "VTPM_SPEC_STRING", "VTPM_SPEC_STRING", ...] โ€” specifies the Virtual Trusted Platform module to be provided to the guest. See xen-vtpm(7) for more details ๐Ÿ”.

Each VTPM_SPEC_STRING is a comma-separated list of "KEY=VALUE" settings from the following list:

  • backend=domain-id โ€” specifies the backend domain name or id. This value is required! ๐Ÿšจ If this domain is a guest, the backend should be set to the vTPM domain name. If this domain is a vTPM, the backend should be set to the vTPM manager domain name.
  • uuid=UUID โ€” specifies the UUID of this vTPM device. The UUID is used to uniquely identify the vTPM device. You can create one using the uuidgen(1) program on unix systems. If left unspecified, a new UUID will be randomly generated every time the domain boots ๐Ÿ™ˆ. If this is a vTPM domain, you should specify a value. The value is optional if this is a guest domain.
  • p9=[ "9PFS_SPEC_STRING", "9PFS_SPEC_STRING", ...] โ€” creates a Xen 9pfs connection to share a filesystem from the backend to the frontend ๐Ÿฆ‹.

Each 9PFS_SPEC_STRING is a comma-separated list of "KEY=VALUE" settings, from the following list:

  • type=TYPE โ€” the backendtype for the PV device. Supported values are qemu and xen_9pfsd. The default is qemu.
  • tag=STRING โ€” 9pfs tag to identify the filesystem share. The tag is needed on the guest side to mount it. For the backendtype of xen_9pfsd the tag defaults to "Xen".
  • security_model="none" โ€” only "none" is supported today, which means that the files are stored using the same credentials as those they have in the guest (no user ownership squash or remap).
  • path=STRING โ€” filesystem path on the backend to export. For the backendtype of xen_9pfsd the path defaults to "/var/log/xen/guests/<guest-name>".
  • backend=domain-id โ€” specify the backend domain name or id, defaults to dom0.
  • max-files=NUMBER โ€” specify the maximum number of files below path. A value of 0 (which is the default) doesn't limit the number of files. Only valid for type=xen_9pfsd.
  • max-open-files=NUMBER โ€” specify the maximum number of concurrently opened files below path. Multiple opens of the same file are counted individually. Only valid for type=xen_9pfsd, which has a default of max-open-files=5.
  • max-space=NUMBER โ€” specify the maximum used disk space in MiB below path. A value of 0 (which is the default) doesn't limit the usable disk space. Only valid for type=xen_9pfsd.
  • auto-delete=BOOLEAN โ€” when set, the backend will delete the oldest file which is currently not opened by the guest in case the disk space limit set via max-space or the file limit set via max-files is being reached ๐Ÿ™Š. Only valid for type=xen_9pfsd.
  • pvcalls=[ "backend=domain-id", ... ] โ€” creates a Xen pvcalls connection to handle pvcalls requests from frontend to backend. It can be used as an alternative networking model. For more information about the protocol, see https://xenbits.xenproject.org/docs/unstable/misc/pvcalls.html ๐Ÿซง.
  • vfb=[ "VFB_SPEC_STRING", "VFB_SPEC_STRING", ...] โ€” specifies the paravirtual framebuffer devices which should be supplied to the domain ๐Ÿ–ผ๏ธ.

This option does not control the emulated graphics card presented to an HVM guest. See Emulated VGA Graphics Device below for how to configure the emulated device. If Emulated VGA Graphics Device options are used in a PV guest configuration, xl will pick up vnc, vnclisten, vncpasswd, vncdisplay, vncunused, sdl, opengl and keymap to construct the paravirtual framebuffer device for the guest ๐Ÿ‘€.

Each VFB_SPEC_STRING is a comma-separated list of "KEY=VALUE" settings, from the following list:

  • vnc=BOOLEAN โ€” allow access to the display via the VNC protocol. This enables the other VNC-related settings. Default is 1 (enabled).
  • vnclisten=ADDRESS[:DISPLAYNUM] โ€” specifies the IP address, and optionally the VNC display number, to use.
Note: if you specify the display number here, you should not use the vncdisplay option ๐Ÿ˜ค.
  • vncdisplay=DISPLAYNUM โ€” specifies the VNC display number to use. The actual TCP port number will be DISPLAYNUM+5900.
Note: you should not use this option if you set the DISPLAYNUM in the vnclisten option.
  • vncunused=BOOLEAN โ€” requests that the VNC display setup searches for a free TCP port to use. The actual display used can be accessed with xl vncviewer ๐Ÿ•ต๏ธ.
  • vncpasswd=PASSWORD โ€” specifies the password for the VNC server. If the password is set to an empty string, authentication on the VNC server will be disabled, allowing any user to connect ๐Ÿ’€.
  • sdl=BOOLEAN โ€” specifies that the display should be presented via an X window (using Simple DirectMedia Layer). The default is 0 (not enabled).
  • display=DISPLAY โ€” specifies the X Window display that should be used when the sdl option is used.
  • xauthority=XAUTHORITY โ€” specifies the path to the X authority file that should be used to connect to the X server when the sdl option is used.
  • opengl=BOOLEAN โ€” enable OpenGL acceleration of the SDL display. Only effects machines using device_model_version="qemu-xen-traditional" and only if the device-model was compiled with OpenGL support. The default is 0 (disabled).
  • keymap=LANG โ€” configure the keymap to use for the keyboard associated with this display โŒจ๏ธ. If the input method does not easily support raw keycodes (e.g. this is often the case when using VNC) then this allows us to correctly map the input keys into keycodes seen by the guest. The specific values which are accepted are defined by the version of the device-model which you are using. See Keymaps below or consult the qemu(1) manpage. The default is en-us.
  • channel=[ "CHANNEL_SPEC_STRING", "CHANNEL_SPEC_STRING", ...] โ€” specifies the virtual channels to be provided to the guest. A channel is a low-bandwidth, bidirectional byte stream, which resembles a serial link โœจ. Typical uses for channels include transmitting VM configuration after boot and signalling to in-guest agents. Please see xen-pv-channel(7) for more details.

Each CHANNEL_SPEC_STRING is a comma-separated list of "KEY=VALUE" settings. Leading and trailing whitespace is ignored in both KEY and VALUE. Neither KEY nor VALUE may contain ',', '=' or '"'. Defined values are:

  • backend=domain-id โ€” specifies the backend domain name or id. This parameter is optional. If this parameter is omitted then the toolstack domain will be assumed.
  • name=NAME โ€” specifies the name for this device. This parameter is mandatory! ๐Ÿšจ This should be a well-known name for a specific application (e.g. guest agent) and should be used by the frontend to connect the application to the right channel device. There is no formal registry of channel names, so application authors are encouraged to make their names unique by including the domain name and a version number in the string (e.g. org.mydomain.guestagent.1).
  • connection=CONNECTION โ€” specifies how the backend will be implemented. The following options are available:
    • SOCKET โ€” the backend will bind a Unix domain socket (at the path given by path=PATH), listen for and accept connections. The backend will proxy data between the channel and the connected socket.
    • PTY โ€” the backend will create a pty and proxy data between the channel and the master device. The command xl channel-list can be used to discover the assigned slave device ๐Ÿงš.
  • rdm="RDM_RESERVATION_STRING" โ€” HVM/x86 only! โš ๏ธ Specifies information about Reserved Device Memory (RDM), which is necessary to enable robust device passthrough. One example of RDM is reporting through the ACPI Reserved Memory Region Reporting (RMRR) structure on the x86 platform.

RDM_RESERVATION_STRING is a comma separated list of "KEY=VALUE" settings, from the following list:

  • strategy=STRING โ€” currently there is only one valid type, and that is "host" ๐Ÿ‘‘.

host

okay so if you set this to "host" it literally means every single reserved device memory region on this platform gets checked so we can reserve regions in this VM's address space ๐Ÿ’…. this global RDM parameter lets you spell out reserved regions explicitly, and using "host" pulls in all the reserved regions reported on this platform โ€” which is lowkey a serve when you're doing hotplug โœจ.

by default this isn't set, so we don't check all RDMs. instead we just check the RDM specific to a given device if we're assigning that kind of a device ๐ŸŽ€.

Note: this option is not recommended unless you can make sure that no conflicts exist. fr fr, be careful ๐Ÿ™ˆ

for example, say you're trying to set memory = 2800 to allocate memory to one given VM but the platform owns two RDM regions like:

Device A [sbdf_A]: RMRR region_A: base_addr ac6d3000
end_address ac6e6fff

Device B [sbdf_B]: RMRR region_B: base_addr ad800000
end_address afffffff

in this conflict case:

  1. if strategy is set to "host", for example rdm = "strategy=host,policy=strict" or rdm = "strategy=host,policy=relaxed" โ€” it means all conflicts will be handled according to the policy introduced by policy as described below ๐Ÿ‘‘
  2. if strategy is not set at all, but pci = [ 'sbdf_A, rdm_policy=xxxxx' ] โ€” it means only one conflict of region_A will be handled according to the policy introduced by rdm_policy=STRING as described inside pci options ๐Ÿฆ‹

policy=STRING

specifies how to deal with conflicts when reserving already-reserved device memory in the guest address space. it's giving conflict resolution era ๐Ÿ’…

  • strict โ€” specifies that in case of an unresolved conflict the VM can't be created, or the associated device can't be attached in the case of hotplug ๐Ÿ˜ญ
  • relaxed โ€” specifies that in case of an unresolved conflict the VM is allowed to be created but may cause the VM to crash if a pass-through device accesses RDM ๐Ÿ’€ for example, the Windows IGD GFX driver always accesses RDM regions so it leads to a VM crash.
Note: this may be overridden by the rdm_policy option in the pci device configuration ๐Ÿ‘€

usbctrl=[ "USBCTRL_SPEC_STRING", "USBCTRL_SPEC_STRING", ...]

specifies the USB controllers created for this guest ๐ŸŽ€โœจ. each USBCTRL_SPEC_STRING is a comma-separated list of "KEY=VALUE" settings, from the following list:

type=TYPE

specifies the usb controller type ๐ŸŒธ

  • pv โ€” specifies a kernel based PVUSB backend
  • qusb โ€” specifies a QEMU based PVUSB backend
  • devicemodel โ€” specifies a USB controller emulated by QEMU. it will show up as a PCI-device in the guest ๐Ÿ’…
  • auto โ€” determines whether a kernel based backend is installed. if this is the case, pv is used, otherwise qusb will be used. for HVM domains devicemodel will be selected. this option is the default โญ

version=VERSION

specifies the usb controller version. possible values include 1 (USB1.1), 2 (USB2.0) and 3 (USB3.0). default is 2 (USB2.0). value 3 (USB3.0) is available for the devicemodel type only ๐Ÿฆ‹

ports=PORTS

specifies the total number of ports of the usb controller. the maximum number is 31. the default is 8. with the type devicemodel the number of ports is more limited: a USB1.1 controller always has 2 ports, a USB2.0 controller always has 6 ports and a USB3.0 controller can have up to 15 ports ๐Ÿ˜ฎโ€๐Ÿ’จ

USB controller ids start from 0. in line with the USB specification, however, ports on a controller start from 1 ๐Ÿ‘‘

EXAMPLE

usbctrl=["version=1,ports=4", "version=2,ports=8"]

the first controller is USB1.1 and has:

controller id = 0, and ports 1,2,3,4.

the second controller is USB2.0 and has:

controller id = 1, and ports 1,2,3,4,5,6,7,8.

usbdev=[ "USBDEV_SPEC_STRING", "USBDEV_SPEC_STRING", ...]

specifies the USB devices to be attached to the guest at boot ๐Ÿซถโœจ. each USBDEV_SPEC_STRING is a comma-separated list of "KEY=VALUE" settings, from the following list:

type=hostdev

specifies USB device type. currently only "hostdev" is supported ๐Ÿ’…

hostbus=busnum

specifies busnum of the USB device from the host perspective ๐ŸŽ€

hostaddr=devnum

specifies devnum of the USB device from the host perspective ๐ŸŒธ

controller=CONTROLLER

specifies the USB controller id โ€” like, which controller the USB device is attached to ๐Ÿฆ‹

if no controller is specified, an available controller:port combination will be used. if there are no available controller:port combinations, a new controller will be created ๐Ÿ‘‘

port=PORT

specifies the USB port to which the USB device is attached. the port option is valid only when the controller option is specified โญ


pci=[ "PCI_SPEC_STRING", "PCI_SPEC_STRING", ...]

specifies the host PCI devices to passthrough to this guest ๐Ÿ’– see xl-pci-configuration(5) for more details ๐Ÿ“–


pci_permissive=BOOLEAN

changes the default value of permissive for all PCI devices passed through to this VM. see permissive above ๐Ÿ‘€


pci_msitranslate=BOOLEAN

changes the default value of msitranslate for all PCI devices passed through to this VM. see msitranslate above ๐Ÿ‘€


pci_seize=BOOLEAN

changes the default value of seize for all PCI devices passed through to this VM. see seize above ๐Ÿ‘€


pci_power_mgmt=BOOLEAN

(HVM only) changes the default value of power_mgmt for all PCI devices passed through to this VM. see power_mgmt above ๐Ÿ‘€


gfx_passthru=BOOLEAN|"STRING"

enable graphics device PCI passthrough ๐Ÿ”ฅ this option makes an assigned PCI graphics card become the primary graphics card in the VM. the QEMU emulated graphics adapter is disabled and the VNC console for the VM will not have any graphics output ๐Ÿ˜ญ. all graphics output โ€” including boot time QEMU BIOS messages from the VM โ€” will go to the physical outputs of the passed through physical graphics card ๐Ÿ’…

the graphics card PCI device to pass through is chosen with the pci option, in exactly the same way a normal Xen PCI device passthrough/assignment is done. note that gfx_passthru does not do any kind of sharing of the GPU, so you can assign the GPU to only one single VM at a time โ€” it's giving exclusive main character energy ๐Ÿ‘‘.

gfx_passthru also enables various legacy VGA memory ranges, BARs, MMIOs, and ioports to be passed through to the VM, since those are required for correct operation of things like VGA BIOS, text mode, VBE, etc. ๐ŸŽ€

enabling the gfx_passthru option also copies the physical graphics card video BIOS to the guest memory, and executes the VBIOS in the guest to initialize the graphics card โœจ

most graphics adapters require vendor specific tweaks for properly working graphics passthrough ๐Ÿซถ. see the XenVGAPassthroughTestedAdapters wiki page for graphics cards currently supported by gfx_passthru:

https://wiki.xenproject.org/wiki/XenVGAPassthroughTestedAdapters

gfx_passthru is currently supported both with the qemu-xen-traditional device-model and upstream qemu-xen device-model ๐ŸŒˆ

when given as a boolean the gfx_passthru option either disables graphics card passthrough or enables autodetection ๐Ÿ’…

when given as a string the gfx_passthru option describes the type of device to enable. note that this behavior is only supported with the upstream qemu-xen device-model ๐Ÿฆ‹. with qemu-xen-traditional IGD (Intel Graphics Device) is always assumed and options other than autodetect or explicit IGD will result in an error ๐Ÿ’€

currently, valid values for the option are:

  • 0 โ€” disables graphics device PCI passthrough
  • 1, "default" โ€” enables graphics device PCI passthrough and autodetects the type of device which is being used โญ
  • "igd" โ€” enables graphics device PCI passthrough but forcing the type of device to Intel Graphics Device ๐Ÿ‘‘

note that some graphics cards (AMD/ATI cards, for example) do not necessarily require the gfx_passthru option, so you can use the normal Xen PCI passthrough to assign the graphics card as a secondary graphics card to the VM ๐ŸŽ€. the QEMU-emulated graphics card remains the primary graphics card, and VNC output is available from the QEMU-emulated primary adapter โœจ

more information about the Xen gfx_passthru feature is available on the XenVGAPassthrough wiki page:

https://wiki.xenproject.org/wiki/XenVGAPassthrough


rdm_mem_boundary=MBYTES

number of megabytes to set for a boundary when checking for RDM conflicts ๐Ÿฆ‹

when RDM conflicts with RAM, RDM is probably scattered over the whole RAM space ๐Ÿ˜ฎโ€๐Ÿ’จ. having multiple RDM entries would worsen this and lead to a complicated memory layout. here we're trying to figure out a simple solution to avoid breaking the existing layout. when a conflict occurs:

  1. above a predefined boundary
    • move lowmem_end below the reserved region to solve the conflict โœจ
  2. below a predefined boundary
    • check if the policy is strict or relaxed. a "strict" policy leads to a fail in libxl ๐Ÿ’€. note that when both policies are specified on a given region, "strict" is always preferred ๐Ÿ‘‘. the "relaxed" policy issues a warning message and also masks this entry INVALID to indicate we shouldn't expose this entry to hvmloader ๐ŸŽ€

the default value is 2048 โญ


dtdev=[ "DTDEV_PATH", "DTDEV_PATH", ...]

specifies the host device tree nodes to passthrough to this guest ๐ŸŒธ. each DTDEV_PATH is an absolute path in the device tree ๐Ÿฆ‹


ioports=[ "IOPORT_RANGE", "IOPORT_RANGE", ...]

allow the guest to access specific legacy I/O ports ๐Ÿ’…. each IOPORT_RANGE is given in hexadecimal format and may either be a range, e.g. "2f8-2ff" (inclusive), or a single I/O port, e.g. "2f8" โœจ

it is recommended to only use this option for trusted VMs under administrator's control ๐Ÿ”’ โ€” no cap, don't hand random VMs the keys to the port kingdom ๐Ÿ™ˆ

๐Ÿ’พ iomem

iomem=[ "IOMEM_START,NUM_PAGES[@GFN]", "IOMEM_START,NUM_PAGES[@GFN]", ...]

okay so this one lets auto-translated domains reach specific hardware I/O memory pages. very "let me just squeeze through here" energy ๐Ÿซถ

  • IOMEM_START โ€” a physical page number.
  • NUM_PAGES โ€” how many pages you're opening up, starting from START_PAGE.
  • GFN โ€” the guest frame number where the mapping kicks off inside the guest's address space. If you don't give GFN, the mapping just uses IOMEM_START as the start in the guest's address space too โ€” so by default you get a 1:1 mapping, cute and simple ๐Ÿ’…

All of these values must be given in hexadecimal format. no decimal sneaking in, bestie, hex only ๐Ÿ”ฅ

โš ๏ธ heads up: the IOMMU does not get updated with the mappings you specify here. So do not use this option to pass through any IOMMU-protected devices. like, seriously, don't fr fr ๐Ÿ˜ญ
๐Ÿ›ก๏ธ also, it's recommended to only use this option for trusted VMs under the administrator's control.

๐ŸŽฏ irqs

irqs=[ NUMBER, NUMBER, ...]

lets a guest access specific physical IRQs. straight up handing over interrupt numbers ๐Ÿ‘‘

๐Ÿ›ก๏ธ same vibe check as before: it's recommended to only use this option for trusted VMs under the administrator's control.
๐Ÿ“Œ if the vuart console is enabled, then IRQ 32 is reserved for it. See "vuart="uart"" to know how to enable the vuart console.

๐ŸŽŸ๏ธ max_event_channels=N

caps the guest at using at most N event channels (those are PV interrupts, iykyk). every event channel a guest uses eats hypervisor resources, so this is your little budget line item ๐Ÿ’ธ

The default of 1023 should be plenty for typical guests. The maximum value depends on what your guest actually supports:

  • Guests supporting the FIFO-based event channel ABI โ†’ up to 131,071 event channels ๐Ÿš€
  • Other guests โ†’ limited to 4095 on 64-bit x86 and ARM, or 1023 on 32-bit x86.

๐Ÿ–ฅ๏ธ vdispl

vdispl=[ "VDISPL_SPEC_STRING", "VDISPL_SPEC_STRING", ...]

Specifies the virtual display devices to be provided to the guest. โœจ

Each VDISPL_SPEC_STRING is a comma-separated list of "KEY=VALUE" settings, pulled from this list:

backend=DOMAIN

Specifies the backend domain name or id. If you don't specify it, Domain-0 is used.

be-alloc=BOOLEAN

Indicates whether the backend can be a buffer provider/allocator for this domain. See the display protocol for details.

connectors=CONNECTORS

Specifies virtual connectors for the device, in this format: <id>:<W>x<H>;<id>:<W>x<H>... where:

  • id โ€” string connector unique id. Space and comma symbols are not allowed. keep it clean bestie ๐Ÿ™ˆ
  • W โ€” connector width in pixels.
  • H โ€” connector height in pixels.

EXAMPLE

connectors=id0:1920x1080;id1:800x600;id2:640x480

๐Ÿ”’ dm_restrict=BOOLEAN

Restricts the device model after startup, so that if โ€” hypothetically, allegedly โ€” a security vulnerability shows up in qemu, the consequences stay contained ๐Ÿงฏ

See docs/features/qemu-depriv.pandoc for more info on Linux and QEMU version requirements, device model user setup, and the current limitations.

๐Ÿ’€ this feature is a technology preview. See SUPPORT.md for a security support statement.

๐Ÿ‘ค device_model_user=USERNAME

When you're running dm_restrict, run the device model as this user.

๐Ÿ“ฃ NOTE: Each domain MUST have a SEPARATE username. no sharing accounts, bestie, that's the whole point ๐Ÿ˜ค

See docs/features/qemu-depriv.pandoc for more information.


๐Ÿ”Š vsnd

vsnd=[ VCARD_SPEC, VCARD_SPEC, ... ]

Specifies the virtual sound cards to be provided to the guest. ๐ŸŽถ Each VCARD_SPEC is a list that looks like "[VSND_ITEM_SPEC, VSND_ITEM_SPEC, ... ]" (without the quotes, obviously). The virtual sound card has a whole hierarchical structure going on โ€” every card has a set of PCM devices and streams, and each one can be individually configured. it's giving family tree ๐ŸŒณ

VSND_ITEM_SPEC describes the individual item parameters. It's a string of comma-separated item parameters, headed by the item identifier. Each item parameter is a "KEY=VALUE" pair:

"identifier, param = value, ..."

The identifier shall be one of these values: CARD, PCM, STREAM. A child item is treated as belonging to the previously defined parent item. ๐Ÿ‘ฉโ€๐Ÿ‘ง

All parameters are optional. ๐Ÿ‘‘

There's a group of parameters common to all items. This group can be defined at a higher level of the hierarchy and gets fully or partially re-used by the layers underneath. These parameters are:

  • number of channels (min/max)
  • supported sample rates
  • supported sample formats

E.g. you can define these values for the whole card, device or stream. Every underlying layer in turn can re-define some or all of them to better fit its needs. For example, a card may define the number of channels to be in the [1; 8] range, and some particular stream may be limited to [1; 2] only. The rule is that the underlying layer must be a subset of the upper layer range. no going rogue with extra channels ๐Ÿšซ

COMMON parameters:

sample-rates=RATES

List of integer values separated by semicolon: sample-rates=8000;22050;44100

sample-formats=FORMATS

List of string values separated by semicolon: sample-formats=s16_le;s8;u32_be

Supported formats: s8, u8, s16_le, s16_be, u16_le, u16_be, s24_le, s24_be, u24_le, u24_be, s32_le, s32_be, u32_le, u32_be, float_le, float_be, float64_le, float64_be, iec958_subframe_le, iec958_subframe_be, mu_law, a_law, ima_adpcm, mpeg, gsm

channels-min=NUMBER

The minimum amount of channels.

channels-max=NUMBER

The maximum amount of channels.

buffer-size=NUMBER

The maximum size in octets of the buffer to allocate per stream.

CARD specification:

backend=domain-id

Specify the backend domain name or id, defaults to dom0.

short-name=STRING

Short name of the virtual sound card.

long-name=STRING

Long name of the virtual sound card.

PCM specification:

name=STRING

Name of the PCM sound device within the virtual sound card.

STREAM specification:

unique-id=STRING

Unique stream identifier.

type=TYPE

Stream type: "p" for playback stream, "c" for capture stream.

EXAMPLE:

vsnd = [
    ['CARD, short-name=Main, sample-formats=s16_le;s8;u32_be',
        'PCM, name=Main',
            'STREAM, id=0, type=p',
            'STREAM, id=1, type=c, channels-max=2'
    ],
    ['CARD, short-name=Second',
        'PCM, name=Second, buffer-size=1024',
            'STREAM, id=2, type=p',
            'STREAM, id=3, type=c'
    ]
]

โŒจ๏ธ vkb

vkb=[ "VKB_SPEC_STRING", "VKB_SPEC_STRING", ...]

Specifies the virtual keyboard device to be provided to the guest. ๐ŸŽน

Each VKB_SPEC_STRING is a comma-separated list of "KEY=VALUE" settings from this list:

unique-id=STRING

Specifies the unique input device id.

backend=domain-id

Specifies the backend domain name or id.

backend-type=type

Specifies the backend type: qemu for the QEMU backend, or linux for a Linux PV domain.

feature-disable-keyboard=BOOLEAN

Indicates if the keyboard device is disabled.

feature-disable-pointer=BOOLEAN

Indicates if the pointer device is disabled.

feature-abs-pointer=BOOLEAN

Indicates if the pointer device can return absolute coordinates.

feature-raw-pointer=BOOLEAN

Indicates if the pointer device can return raw (unscaled) absolute coordinates.

feature-multi-touch=BOOLEAN

Indicates if the input device supports multi touch. ๐Ÿ‘†๐Ÿ‘†

multi-touch-width=MULTI_TOUCH_WIDTH

Set maximum width for the multi touch device.

multi-touch-height=MULTI_TOUCH_HEIGHT

Set maximum height for the multi touch device.

multi-touch-num-contacts=MULTI_TOUCH_NUM_CONTACTS

Set maximum contacts number for the multi touch device.

width=WIDTH

Set maximum width for the pointer device.

height=HEIGHT

Set maximum height for the pointer device.


๐Ÿงฉ virtio

virtio=[ "VIRTIO_DEVICE_STRING", "VIRTIO_DEVICE_STRING", ...]

Specifies the Virtio devices to be provided to the guest. ๐Ÿ’ซ

Each VIRTIO_DEVICE_STRING is a comma-separated list of "KEY=VALUE" settings from the list below. As a special case, a single comma is allowed in the VALUE of the type KEY, where the VALUE is set with "virtio,device<N>". (yes, just the one comma, don't get carried away ๐Ÿ™ˆ)

backend=domain-id

Specifies the backend domain name or id, defaults to dom0.

type=STRING

Specifies the compatible string for the specific Virtio device. The same will be written in the Device Tree compatible property of the Virtio device. For example, "type=virtio,device22" for the I2C device, whose device-tree binding is present here:

<https://www.kernel.org/doc/Documentation/devicetree/bindings/i2c/i2c-virtio.yaml>

For other generic virtio devices, where we don't need to set special or compatible properties in the Device Tree, the type field must be set to "virtio,device" or "virtio,device<N>", where N is the virtio device id in hexadecimal format, without the 0x prefix and all in lower case โ€” like "virtio,device1a" for the file system device. lowercase supremacy ๐Ÿ’…

transport=STRING

Specifies the transport mechanism for the Virtio device. Only "mmio" is supported for now.

grant_usage=BOOLEAN

If this option is true, the Xen grants are always enabled. If this option is false, the Xen grants are always disabled.

If this option is missing, then the default grant setting will be used, i.e. enable grants if backend-domid != 0.


๐Ÿ›ก๏ธ tee="STRING"

Arm only. ๐Ÿ‘‘ Sets the TEE type for the guest. TEE is a Trusted Execution Environment โ€” a separate secure OS found on some platforms. STRING can be one of:

none

Don't allow the guest to use TEE if present on the platform. This is the default value.

optee

Allow a guest to access the host OP-TEE OS. Xen will mediate the access to OP-TEE and the resource isolation will be provided directly by OP-TEE. OP-TEE itself may limit the number of guests that can concurrently use it. This requires a virtualization-aware OP-TEE for this to work โ€” so like, check that first bestie ๐Ÿ”

You can refer to the OP-TEE docs at <https://optee.readthedocs.io/en/latest/architecture/virtualization.html> for more info on how to enable and configure virtualization support in OP-TEE.

โš ๏ธ This feature is a technology preview.
  • ffa โ€” Arm only, bestie. Allows a guest to communicate via FF-A with Secure Partitions (SP), default false.

Ngl, currently only a small subset of the FF-A spec is supported โ€” just enough to communicate with OP-TEE. In general that means only direct messaging and sharing memory with one SP. More advanced use cases where memory might be shared or donated to multiple SPs are not supported.

See <https://developer.arm.com/documentation/den0077/latest> for more info about FF-A.

โš ๏ธ This feature is a technology preview.

๐Ÿซถ Paravirtualised (PV) Guest Specific Options ๐Ÿซถ

The following options apply only to Paravirtual (PV) guests.

  • bootloader="PROGRAM" โ€” Run "PROGRAM" to find the kernel image and ramdisk to use. Normally "PROGRAM" would be "pygrub", which is an emulation of grub/grub2/syslinux. Either kernel or bootloader must be specified for PV guests. ๐Ÿ’…
  • bootloader_args=[ "ARG", "ARG", ...] โ€” Append ARGs to the arguments to the bootloader program. Alternatively, if the argument is a simple string then it will be split into words at whitespace โ€” but bestie, this second option is deprecated.
  • bootloader_restrict=BOOLEAN โ€” Attempt to restrict the bootloader after startup, to limit the consequences of security vulnerabilities due to parsing guest owned image files.

See docs/features/qemu-deprivilege.pandoc for more information on how to setup the unprivileged users.

Note that running the bootloader in restricted mode also implies using non-interactive mode, and the disk image must be readable by the restricted user.
  • bootloader_user=USERNAME โ€” When using bootloader_restrict, run the bootloader as this user. If not set, the default QEMU restrict users will be used.
NOTE: Each domain MUST have a SEPARATE username. Fr fr, do not skip this.

See docs/features/qemu-deprivilege.pandoc for more information.

  • e820_host=BOOLEAN โ€” Selects whether to expose the host e820 (memory map) to the guest via the virtual e820. When this option is false (0), the guest pseudo-physical address space consists of a single contiguous RAM region. When this option is specified, the virtual e820 instead reflects the host e820 and contains the same PCI holes. The total amount of RAM represented by the memory map is always the same โ€” this option configures only how it is laid out. ๐Ÿง 

Exposing the host e820 to the guest gives the guest kernel the opportunity to set aside the required part of its pseudo-physical address space in order to provide address space to map passedthrough PCI devices. It is guest Operating System dependent whether this option is required; specifically it is required when using a mainline Linux ("pvops") kernel. This option defaults to true (1) if any PCI passthrough devices are configured and false (0) otherwise. If you do not configure any passthrough devices at domain creation time but expect to hotplug devices later, then you should set this option. Conversely, if your particular guest kernel does not require this behaviour, then it is safe to allow this to be enabled but you may wish to disable it anyway.


๐Ÿฆ‹ Fully-virtualised (HVM) Guest Specific Options ๐Ÿฆ‹

The following options apply only to Fully-virtualised (HVM) guests.

๐Ÿ’ฟ Boot Device ๐Ÿ’ฟ

  • boot="STRING" โ€” Specifies the emulated virtual device to boot from.

Possible values are:

  • c โ€” Hard disk.
  • d โ€” CD-ROM.
  • n โ€” Network / PXE.

Note: multiple options can be given and will be attempted in the order they are given, e.g. to boot from CD-ROM but fall back to the hard disk you can specify it as dc.

The default is cd, meaning try booting from the hard disk first, but fall back to the CD-ROM.

๐Ÿ–ด Emulated disk controller type ๐Ÿ–ด

  • hdtype=STRING โ€” Specifies the hard disk type.

Possible values are:

  • ide โ€” If this mode is specified, xl adds an emulated IDE controller, which is suitable even for older operation systems.
  • ahci โ€” If this mode is specified, xl adds an ich9 disk controller in AHCI mode and uses it with upstream QEMU to emulate disks instead of IDE. It decreases boot time but may not be supported by default in older operating systems, e.g. Windows XP.

The default is ide.

๐Ÿง  Paging ๐Ÿง 

The following options control the mechanisms used to virtualise guest memory. The defaults are selected to give the best results for the common cases, so you should normally leave these options unspecified.

  • hap=BOOLEAN โ€” Turns "hardware assisted paging" (the use of the hardware nested page table feature) on or off. This feature is called EPT (Extended Page Tables) by Intel and NPT (Nested Page Tables) or RVI (Rapid Virtualisation Indexing) by AMD. If turned off, Xen will run the guest in "shadow page table" mode where the guest's page table updates and/or TLB flushes etc. will be emulated. Use of HAP is the default when available.
  • oos=BOOLEAN โ€” Turns "out of sync pagetables" on or off. When running in shadow page table mode, the guest's page table updates may be deferred as specified in the Intel/AMD architecture manuals. However, this may expose unexpected bugs in the guest, or find bugs in Xen, so it is possible to disable this feature. Use of out of sync page tables, when Xen thinks it appropriate, is the default.
  • shadow_memory=MBYTES โ€” Number of megabytes to set aside for shadowing guest pagetable pages (effectively acting as a cache of translated pages) or to use for HAP state. By default this is 1MB per guest vCPU plus 8KB per MB of guest RAM. You should not normally need to adjust this value. However, if you are not using hardware assisted paging (i.e. you are using shadow mode) and your guest workload consists of a very large number of similar processes, then increasing this value may improve performance. โœจ

๐Ÿงš Processor and Platform Features ๐Ÿงš

The following options allow various processor and platform level features to be hidden or exposed from the guest's point of view. This can be useful when running older guest Operating Systems which may misbehave when faced with more modern features. In general, you should accept the defaults for these options wherever possible.

  • bios="STRING" โ€” Select the virtual firmware that is exposed to the guest. By default, a guess is made based on the device model, but sometimes it may be useful to request a different one, like UEFI.
    • rombios โ€” Loads ROMBIOS, a 16-bit x86 compatible BIOS. This is used by default when device_model_version=qemu-xen-traditional. This is the only BIOS option supported when device_model_version=qemu-xen-traditional. This is the BIOS used by all previous Xen versions.
    • seabios โ€” Loads SeaBIOS, a 16-bit x86 compatible BIOS. This is used by default with device_model_version=qemu-xen.
    • ovmf โ€” Loads OVMF, a standard UEFI firmware by Tianocore project. Requires device_model_version=qemu-xen.
  • bios_path_override="PATH" โ€” Override the path to the blob to be used as BIOS. The blob provided here MUST be consistent with the bios= which you have specified. You should not normally need to specify this option.

This option does not have any effect if using bios="rombios" or device_model_version="qemu-xen-traditional".

  • pae=BOOLEAN โ€” Hide or expose the IA32 Physical Address Extensions. These extensions make it possible for a 32 bit guest Operating System to access more than 4GB of RAM. Enabling PAE also enabled other features such as NX. PAE is required if you wish to run a 64-bit guest Operating System. In general, you should leave this enabled and allow the guest Operating System to choose whether or not to use PAE. (X86 only)
  • acpi=BOOLEAN โ€” Expose ACPI (Advanced Configuration and Power Interface) tables from the virtual firmware to the guest Operating System. ACPI is required by most modern guest Operating Systems. This option is enabled by default and usually you should omit it. However, it may be necessary to disable ACPI for compatibility with some guest Operating Systems. This option is true for x86 while it's false for ARM by default.
  • acpi_s3=BOOLEAN โ€” Include the S3 (suspend-to-ram) power state in the virtual firmware ACPI table. True (1) by default.
  • acpi_s4=BOOLEAN โ€” Include S4 (suspend-to-disk) power state in the virtual firmware ACPI table. True (1) by default.
  • acpi_laptop_slate=BOOLEAN โ€” Include the Windows laptop/slate mode switch device in the virtual firmware ACPI table. False (0) by default.
  • apic=BOOLEAN โ€” (x86 only) Include information regarding APIC (Advanced Programmable Interrupt Controller) in the firmware/BIOS tables on a single processor guest. This causes the MP (multiprocessor) and PIR (PCI Interrupt Routing) tables to be exported by the virtual firmware. This option has no effect on a guest with multiple virtual CPUs as they must always include these tables. This option is enabled by default and you should usually omit it, but it may be necessary to disable these firmware tables when using certain older guest Operating Systems. These tables have been superseded by newer constructs within the ACPI tables.
  • nx=BOOLEAN โ€” (x86 only) Hides or exposes the No-eXecute capability. This allows a guest Operating System to map pages in such a way that they cannot be executed, which can enhance security. This options requires that PAE also be enabled.
  • hpet=BOOLEAN โ€” (x86 only) Enables or disables HPET (High Precision Event Timer). This option is enabled by default and you should usually omit it. It may be necessary to disable the HPET in order to improve compatibility with guest Operating Systems. ๐Ÿซถ
  • altp2m="MODE" โ€” (x86 only, bestie ๐Ÿ’…) sets the access mode for the alternate-p2m capability. Okay so what even is alternate-p2m? It lets a guest juggle multiple p2m guest physical "memory views" instead of just the one single p2m. You'd want this if you're trying to access-control / isolate access to specific guest physical memory pages that the guest touches โ€” like for domain memory introspection, or for isolation & access-control of memory between components inside one single guest domain. This option is disabled by default.

The valid values are, and I quote, iconic:

  • disabled โ€” altp2m is off for the domain (this is the default).
  • mixed โ€” mixed mode gives access to the altp2m interface to both in-guest and external tools too. Versatile queen โœจ
  • external โ€” enables access to the alternate-p2m capability for external privileged tools.
  • limited โ€” enables limited access to the alternate-p2m capability, i.e. the guest only gets to enable/disable the VMFUNC and #VE features.
  • altp2mhvm=BOOLEAN โ€” turns HVM guest access to the alternate-p2m capability on or off. Same deal as above: alternate-p2m lets a guest manage multiple p2m guest physical "memory views" rather than a single p2m. Disabled by default, and it's available only to HVM domains. You may want it if you want to access-control/isolate access to specific guest physical memory pages the guest accesses, e.g. for HVM domain memory introspection, or for isolation/access-control of memory between components within a single guest HVM domain.
๐Ÿšจ This option is deprecated โ€” use the option altp2m instead, no cap.

Note: even though altp2mhvm is deprecated, legacy applications for x86 systems will continue to work using it. (Backwards compat said "not today, retirement" ๐Ÿ’€)

  • nestedhvm=BOOLEAN โ€” enables or disables guest access to hardware virtualisation features, so like it lets a guest Operating System also function as a hypervisor. You'd want this if you want to run another hypervisor (including another copy of Xen) inside a Xen guest, or to support a guest Operating System that uses hardware virtualisation extensions (e.g. Windows XP compatibility mode on more modern Windows OS). Disabled by default.
  • cpuid="LIBXL_STRING" or cpuid=[ "XEND_STRING", "XEND_STRING" ] โ€” configures the value returned when a guest executes the CPUID instruction. Two versions of config syntax are recognized: libxl and xend. ๐Ÿงš

Both formats use a common notation for specifying a single feature bit. Possible values are:

  '1' -> force the corresponding bit to 1
  '0' -> force to 0
  'x' -> Get a safe value (pass through and mask with the default
policy)
  'k' -> pass through the host bit value (at boot only - value
preserved on migrate)
  's' -> legacy alias for 'k'

Libxl format:

The libxl format is a single string, starting with the word "host", and followed by a comma separated list of key=value pairs. A few keys take a numerical value, all others take a single character which describes what to do with the feature bit. e.g.:

cpuid="host,tm=0,sse3=0"

List of keys taking a value:

apicidsize brandid clflush family localapicid maxleaf
maxhvleaf model nc proccount procpkg stepping

List of keys taking a character can be found in the public header file arch-x86/cpufeatureset.h โ€” <https://xenbits.xen.org/docs/unstable/hypercall/x86_64/include,public,arch-x86,cpufeatureset.h.html>

The feature names described in "cpufeatureset.h" should be specified in all lowercase letters, and with underscores converted to hyphens. For example, in order to reference feature "LAHF_LM" the string "lahf-lm" should be used. (yes the naming is giving chaotic but we cope ๐Ÿซถ)

Note that "clflush" is described as an option that takes a value, and that takes precedence over the "clflush" flag in "cpufeatureset.h". The feature flag must be referenced as "clfsh". Sneaky.

Xend format:

Xend format consists of an array of one or more strings of the form "leaf:reg=bitstring,...". e.g. (matching the libxl example above):

cpuid=["1:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0,edx=xx0xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
...]

"leaf" is an integer, either decimal or hex with a "0x" prefix. e.g. to specify something in the AMD feature leaves, use "0x80000001:ecx=...".

Some leaves have subleaves which can be specified as "leaf,subleaf". e.g. for the Intel structured feature leaf, use "7,0:ebx=...".

The bitstring represents all bits in the register, its length must be 32 chars. Each successive character represent a lesser-significant bit. (count them, bestie, literally count them ๐Ÿ”ฅ)

Note: when specifying cpuid for hypervisor leaves (0x4000xxxx major group) only the lowest 8 bits of leaf's 0x4000xx00 EAX register are processed, the rest are ignored (these 8 bits signify maximum number of hypervisor leaves). Don't ask me why, that's just the vibe.

More info about the CPUID instruction can be found in the processor manuals, and on Wikipedia: <https://en.wikipedia.org/wiki/CPUID>

  • acpi_firmware="STRING" โ€” specifies a path to a file that contains extra ACPI firmware tables to pass into a guest. The file can contain several tables in their binary AML form concatenated together. Each table self-describes its length, so no additional information is needed โœจ. These tables will be added to the ACPI table set in the guest.
Note that existing tables cannot be overridden by this feature. For example, this cannot be used to override tables like DSDT, FADT, etc. Sorry babe, that's a no ๐Ÿ’€
  • smbios_firmware="STRING" โ€” specifies a path to a file that contains extra SMBIOS firmware structures to pass into a guest. The file can contain a set of DMTF predefined structures which will override the internal defaults. Not all predefined structures can be overridden โ€” only the following types: 0, 1, 2, 3, 11, 22, 39. The file can also contain any number of vendor defined SMBIOS structures (type 128 - 255). Since SMBIOS structures do not present their overall size, each entry in the file must be preceded by a 32b integer indicating the size of the following structure. Important detail, don't skip it ๐ŸŽ€
  • smbios=[ "SMBIOS_SPEC_STRING", "SMBIOS_SPEC_STRING", ...] โ€” specifies the SMBIOS values to be provided to the guest. These set or override specific entries in the tables provided to the guest.

Each SMBIOS_SPEC_STRING is a "KEY=VALUE" string from the following list:

  • bios_vendor=STRING
  • bios_version=STRING
  • system_manufacturer=STRING
  • system_product_name=STRING
  • system_version=STRING
  • system_serial_number=STRING
  • baseboard_manufacturer=STRING
  • baseboard_product_name=STRING
  • baseboard_version=STRING
  • baseboard_serial_number=STRING
  • baseboard_asset_tag=STRING
  • baseboard_location_in_chassis=STRING
  • enclosure_manufacturer=STRING
  • enclosure_serial_number=STRING
  • enclosure_asset_tag=STRING
  • battery_manufacturer=STRING
  • battery_device_name=STRING
  • oem=STRING โ€” and oem= can be specified up to 99 times. ninety-nine!! go off ๐Ÿ“
  • ms_vm_genid="OPTION" โ€” provides a VM generation ID to the guest.

So the VM generation ID is a 128-bit random number that a guest may use to determine if the guest has been restored from an earlier snapshot or cloned. Very main character energy.

This is required for Microsoft Windows Server 2012 (and later) domain controllers. Like, required required.

Valid options are:

  • generate โ€” generate a random VM generation ID every time the domain is created or restored.
  • none โ€” do not provide a VM generation ID.

See also "Virtual Machine Generation ID" by Microsoft: <https://docs.microsoft.com/en-us/windows/win32/hyperv_v2/virtual-machine-generation-identifier>

โœจ Guest Virtual Time Controls โœจ

  • tsc_mode="MODE" โ€” (x86 only) specifies how the TSC (Time Stamp Counter) should be provided to the guest. Specifying this option as a number is deprecated โ€” don't do it, we're better than that ๐Ÿ˜ญ

Options are:

  • default โ€” guest rdtsc/p is executed natively when monotonicity can be guaranteed and emulated otherwise (with frequency scaled if necessary).

If a HVM container in default TSC mode is created on a host that provides constant host TSC, its guest TSC frequency will be the same as the host. If it is later migrated to another host that provide constant host TSC and supports Intel VMX TSC scaling / AMD SVM TSC ratio, its guest TSC frequency will be the same before and after migration, and guest rdtsc/p will be executed natively after migration as well. Glow-up + consistency, we love to see it ๐Ÿ’…

  • always_emulate โ€” guest rdtsc/p is always emulated and the virtual TSC will appear to increment (kernel and user) at a fixed 1GHz rate, regardless of the pCPU HZ rate or power state. Although there is an overhead associated with emulation, this will NOT affect underlying CPU performance. Iconic tradeoff tbh.
  • native โ€” guest rdtsc/p is always executed natively (no monotonicity/frequency guarantees). Guest rdtsc/p is emulated at native frequency if unsupported by h/w, else executed natively.
  • native_paravirt โ€” this mode has been removed. RIP bozo ๐Ÿ’€

Please see xen-tscmode(7) for more information on this option.

  • localtime=BOOLEAN โ€” set the real time clock to local time or to UTC. False (0) by default, i.e. set to UTC.
  • rtc_timeoffset=SECONDS โ€” set the real time clock offset in seconds. No offset (0) by default.
  • vpt_align=BOOLEAN โ€” specifies that periodic Virtual Platform Timers should be aligned to reduce guest interrupts. Enabling this option can reduce power consumption, especially when a guest uses a high timer interrupt frequency (HZ) values. The default is true (1). Eco queen ๐ŸŒธ
  • timer_mode="MODE" โ€” specifies the mode for Virtual Timers. The valid values are as follows:
    • delay_for_missed_ticks โ€” delay for missed ticks. Do not advance a vCPU's time beyond the correct delivery time for interrupts that have been missed due to preemption. Deliver missed interrupts when the vCPU is rescheduled and advance the vCPU's virtual time stepwise for each one. Patient, methodical, lowkey a vibe.
  • no_delay_for_missed_ticks โ€” no delay for missed ticks ๐Ÿ’ซ same deal as the one above (missed interrupts still get delivered), but while that's happening the guest's time always tracks wallclock (i.e., real) time. and this one? it's the default, so if you didn't pick anything, this is what you got ๐Ÿซถ
  • no_missed_ticks_pending โ€” no missed interrupts are held pending. instead, to keep ticks flowing at some non-zero rate: if we detect missed ticks, then the internal tick alarm is not disabled if the vCPU gets preempted during the next tick period. lowkey clever ngl
  • one_missed_tick_pending โ€” one missed tick pending โœจ missed interrupts get collapsed together and delivered as one single 'late tick'. guest time always tracks wallclock (i.e., real) time, no cap.

๐ŸŒธ Memory layout ๐ŸŒธ

  • mmio_hole=MBYTES โ€” sets the size of the MMIO hole below 4GiB, bestie. simple as that.
ok important: it's only valid for device_model_version="qemu-xen" ๐Ÿ‘ˆ

it cannot be smaller than 256 and it cannot be larger than 3840. the known good large value is 3072 ๐Ÿ”ฅ go with that if you're eyeballing it.


๐Ÿ’œ Support for Paravirtualisation of HVM Guests ๐Ÿ’œ

ok so this whole little crew of options is about exposing paravirtualised features (devices and stuff) to the guest OS inside an HVM guest ๐Ÿงš using them needs specific guest support, but when the guest does support them you get improved performance. free glow-up, basically โœจ

  • xen_platform_pci=BOOLEAN โ€” turn the Xen platform PCI device on or off. the presence of this virtual device is what lets a guest OS (assuming suitable drivers exist) use paravirtualisation features like disk and network devices etc. enabling those drivers improves performance and is strongly recommended when available ๐Ÿ‘‘ PV drivers exist for a bunch of operating systems, including HVM Linux (out-of-the-box) and Microsoft Windows at https://xenproject.org/windows-pv-drivers/.

heads up: setting xen_platform_pci=0 with the default device_model "qemu-xen" requires at least QEMU 1.6 ๐Ÿ’…

  • viridian=[ "GROUP", "GROUP", ...] or viridian=BOOLEAN โ€” this is the groups of Microsoft Hyper-V (AKA viridian) compatible enlightenments you're exposing to the guest. you can specify any of these groups:

๐ŸŽ€ base ๐ŸŽ€

incorporates the Hypercall MSRs, Virtual processor index MSR, and APIC access MSRs. these enlightenments can improve performance of Windows Vista and Windows Server 2008 onwards, and setting this for such guests is strongly recommended. this group is also a pre-requisite for all the others โ€” if it's disabled then trying to enable any other group is an error ๐Ÿ’€

๐ŸŽ€ freq ๐ŸŽ€

incorporates the TSC and APIC frequency MSRs. can improve performance of Windows 7 and Windows Server 2008 R2 onwards.

๐ŸŽ€ time_ref_count ๐ŸŽ€

incorporates the Partition Time Reference Counter MSR. can improve performance of Windows 8 and Windows Server 2012 onwards.

๐ŸŽ€ reference_tsc ๐ŸŽ€

incorporates the Partition Reference TSC MSR. can improve performance of Windows 7 and Windows Server 2008 R2 onwards.

๐ŸŽ€ hcall_remote_tlb_flush ๐ŸŽ€

incorporates use of hypercalls for remote TLB flushing. may improve performance of Windows guests running on hosts with higher levels of (physical) CPU contention.

๐ŸŽ€ apic_assist ๐ŸŽ€

incorporates use of the APIC assist page to avoid EOI of the local APIC. may improve performance of guests that make use of per-vCPU event channel upcall vectors. note that this enlightenment will have no effect if the guest is using APICv posted interrupts ๐Ÿ™ˆ

๐ŸŽ€ crash_ctl ๐ŸŽ€

incorporates the crash control MSRs. these enlightenments let Windows write crash information in a way Xen can log it.

๐ŸŽ€ stimer ๐ŸŽ€

incorporates the SynIC and synthetic timer MSRs. Windows will use synthetic timers in preference to emulated HPET as a source of ticks, so enabling this group ensures ticks stay consistent with an enlightened time source (time_ref_count or reference_tsc) โญ

๐ŸŽ€ hcall_ipi ๐ŸŽ€

incorporates use of a hypercall for interprocessor interrupts. may improve performance of Windows guests with multiple virtual CPUs.

๐ŸŽ€ ex_processor_masks ๐ŸŽ€

enables new hypercall variants that take a variably-sized sparse Virtual Processor Set as an argument instead of a simple 64-bit mask. so yeah โ€” this one must be specified for guests with more than 64 vCPUs if hcall_remote_tlb_flush and/or hcall_ipi are also specified ๐Ÿ‘ˆ

๐ŸŽ€ no_vp_limit ๐ŸŽ€

when set, this group indicates to the guest that the hypervisor doesn't explicitly have any limits on how many Virtual processors it's allowed to bring up. strongly recommended to keep this enabled for guests with more than 64 vCPUs.

๐ŸŽ€ cpu_hotplug ๐ŸŽ€

enables dynamic changes to Virtual processor states in Windows guests, effectively allowing vCPU hotplug ๐Ÿ”ฅ

๐ŸŽ€ defaults ๐ŸŽ€

special value that enables the default set of groups. right now that's the base, freq, time_ref_count, apic_assist, crash_ctl, no_vp_limit and cpu_hotplug groups.

๐ŸŽ€ all ๐ŸŽ€

special value that enables all available groups ๐ŸŒˆ

groups can be disabled by prefixing the name with !. so for example, to enable every group except freq, you'd write:

viridian=[ "all", "!freq" ]

for the deets on the enlightenments themselves, peep the latest version of Microsoft's Hypervisor Top-Level Functional Specification ๐Ÿ“š

these enlightenments should be harmless for other versions of Windows (though they won't give you any benefit) and for the majority of other non-Windows OSes. however โ€” it's known that they're incompatible with some other Operating Systems, and in some circumstances they can prevent Xen's own paravirtualisation interfaces for HVM guests from being used. so like. don't just yeet them everywhere ๐Ÿ’€

oh and also, the viridian option can be given as a boolean: a value of true (1) is equivalent to the list [ "defaults" ], and a value of false (0) is equivalent to an empty list ๐Ÿซถ

  • hvm_pirq=BOOLEAN โ€” picks whether the guest is allowed to route interrupts from devices (emulated or passed through) over event channels. this option is disabled by default.

๐Ÿฆ‹ Emulated VGA Graphics Device ๐Ÿฆ‹

these options control the features of the emulated graphics device โœจ a lot of them behave similarly to the equivalent key in the VFB_SPEC_STRING for configuring virtual frame buffer devices (see above, bestie).

  • videoram=MBYTES โ€” sets how much RAM the emulated video card gets, which in turn limits the resolutions and bit depths you'll have available ๐ŸŽ€

with the qemu-xen-traditional device-model, the default and minimum amount of video RAM for stdvga is 8 MB, which is enough for e.g. 1600x1200 at 32bpp. for the upstream qemu-xen device-model, the default and minimum is 16 MB.

with the emulated Cirrus graphics card (vga="cirrus") and the qemu-xen-traditional device-model, the video RAM is fixed at 4 MB, which is enough for 1024x768 at 32 bpp. for the upstream qemu-xen device-model, the default and minimum is 8 MB.

for QXL vga, both the default and minimal are 128MB. if you set videoram less than 128MB, an error will be triggered ๐Ÿ’€

  • stdvga=BOOLEAN โ€” specifies a standard VGA card with VBE (VESA BIOS Extensions) as the emulated graphics device. if your guest supports VBE 2.0 or later (e.g. Windows XP onwards) then bestie, enable this ๐Ÿ‘‘ stdvga supports more video ram and bigger resolutions than Cirrus. the default is false (0), which means emulate a Cirrus Logic GD5446 VGA card. > โš ๏ธ this option is deprecated โ€” use vga="stdvga" instead.
  • vga="STRING" โ€” selects the emulated video card. options are: none, stdvga, cirrus and qxl. the default is cirrus.

in general, QXL should work with the Spice remote display protocol for acceleration, and you'll need a QXL driver in the guest for that case. QXL can also work with the VNC protocol, but it'll be like a standard VGA card without acceleration ๐Ÿ˜ญ

  • vnc=BOOLEAN โ€” allows access to the display via the VNC protocol. this switches on all the other VNC-related settings. the default is (1) enabled.
  • vnclisten="ADDRESS[:DISPLAYNUM]" โ€” specifies the IP address and, optionally, the VNC display number to use.
  • vncdisplay=DISPLAYNUM โ€” specifies the VNC display number to use. the actual TCP port number will be DISPLAYNUM+5900 ๐Ÿงฎ
  • vncunused=BOOLEAN โ€” asks the VNC display setup to search for a free TCP port to use. the actual display it used can be accessed with xl vncviewer ๐Ÿ‘€
  • vncpasswd="PASSWORD" โ€” specifies the password for the VNC server. if you set the password to an empty string, authentication on the VNC server will be disabled, letting any user connect ๐Ÿ™ˆ
  • keymap="LANG" โ€” configures the keymap for the keyboard associated with this display. if your input method doesn't easily support raw keycodes (e.g. this is often the case when using VNC) then this lets us correctly map the input keys into keycodes the guest sees. the specific values accepted are defined by the version of the device-model you're using โ€” see Keymaps below or consult the qemu(1) manpage. the default is en-us.
  • sdl=BOOLEAN โ€” says the display should be presented via an X window (using Simple DirectMedia Layer). default is (0) not enabled.
  • opengl=BOOLEAN โ€” enable OpenGL acceleration of the SDL display. this only affects machines using device_model_version="qemu-xen-traditional" and only if the device-model was compiled with OpenGL support. default is (0) false.
  • nographic=BOOLEAN โ€” enable or disable the virtual graphics device. default is to provide a VGA graphics device, but this option can disable it ๐Ÿ’…

๐ŸŒˆ Spice Graphics Support ๐ŸŒˆ

the following options control the features of SPICE ๐Ÿ“

  • spice=BOOLEAN โ€” allows access to the display via the SPICE protocol. this switches on the other SPICE-related settings.
  • spicehost="ADDRESS" โ€” specifies the interface address to listen on if given, otherwise any interface.
  • spiceport=NUMBER โ€” sets the port the SPICE server listens on when SPICE is enabled โœจ
  • spicetls_port=NUMBER โ€” the secure port the SPICE server listens on when SPICE is on ๐Ÿ”’ heads up though: if SPICE is enabled, at least one of spiceport or spicetls_port has to be given, no exceptions bestie.
โš ๏ธ Note: the options that depend on spicetls_port have not been supported. Like, at all. Don't come for me, that's just what the page says ๐Ÿ˜ญ
  • spicedisable_ticketing=BOOLEAN โ€” lets clients waltz in and connect without typing a password ๐ŸŽŸ๏ธ but when this is disabled, spicepasswd must be set. Default is (0) false.
  • spicepasswd="PASSWORD" โ€” the password clients use to establish their connection ๐Ÿ”‘
  • spiceagent_mouse=BOOLEAN โ€” whether the SPICE agent gets used for client mouse mode ๐Ÿ–ฑ๏ธ Default is (1) true.
  • spicevdagent=BOOLEAN โ€” turns on the SPICE vdagent ๐Ÿ‘‘ which is this optional little component for levelling up the user experience and doing guest-oriented management tasks. Its features include: client mouse mode (no need to grab the mouse by the client, no mouse lag), automatic adjustment of screen resolution, copy and paste (text and image) between the client and the guest. It also needs the vdagent service installed on the guest OS to actually work. Default is (0) disabled.
  • spice_clipboard_sharing=BOOLEAN โ€” enables SPICE clipboard sharing (copy/paste) ๐Ÿ“‹ but it requires that spicevdagent is enabled. Default is (0) false.
  • spiceusbredirection=NUMBER โ€” enables SPICE USB redirection ๐Ÿ’… creates NUMBER of USB redirection channels so up to 4 USB devices can be redirected from the SPICE client to the guest's QEMU. It requires a USB controller and, if one isn't defined, it will automatically add a USB2.0 controller. Default is (0) disabled.
  • spice_image_compression="COMPRESSION" โ€” picks what image compression SPICE uses (if you give it one), otherwise the QEMU default gets used ๐ŸŽ€ Please see the documentation of your QEMU version for more details.

Available options are: auto_glz, auto_lz, quic, glz, lz, off.

  • spice_streaming_video="VIDEO" โ€” picks what streaming video setting SPICE uses (if given), otherwise the QEMU default is used ๐Ÿฆ‹

Available options are: filter, all, off.

๐ŸŽ›๏ธ Miscellaneous Emulated Hardware

  • serial=[ "DEVICE", "DEVICE", ...] โ€” redirects virtual serial ports to DEVICEs ๐Ÿ”Œ Please see the -serial option in the qemu(1) manpage for the deets on valid DEVICE options. Default is vc when in graphical mode and stdio if nographic=1 is used.

The form serial=DEVICE is also accepted for backwards compatibility.

  • soundhw="DEVICE" โ€” selects the virtual sound card to expose to the guest ๐Ÿ”Š The valid devices are hda, ac97, es1370, adlib, cs4231a, gus, sb16 โ€” if those are available with the device model QEMU. The default is not to export any sound device.
  • vkb_device=BOOLEAN โ€” says the HVM guest gets a vkdb โŒจ๏ธ Default is true (1).

This option is only used when vkb=[] is unset.

  • usb=BOOLEAN โ€” enables or disables an emulated USB bus in the guest ๐Ÿงš
  • usbversion=NUMBER โ€” specifies the type of an emulated USB bus in the guest, values 1 for USB1.1, 2 for USB2.0 and 3 for USB3.0 ๐ŸŒˆ It's available only with an upstream QEMU. Due to implementation limitations this is not compatible with the usb and usbdevice parameters. Default is (0) no USB controller defined.
  • usbdevice=[ "DEVICE", "DEVICE", ...] โ€” adds DEVICEs to the emulated USB bus ๐Ÿ’œ The USB bus must also be enabled using usb=1. The most common use for this option is usbdevice=['tablet'] which adds a pointer device using absolute coordinates. Such devices function better than relative coordinate devices (such as a standard mouse) since many methods of exporting guest graphics (such as VNC) work better in this mode. Note that this is independent of the actual pointer device you're using on the host/client side.

Host devices can also be passed through this way, by specifying host:USBID, where USBID is of the form xxxx:yyyy. The USBID can typically be found by using lsusb(1) or usb-devices(1) ๐Ÿ”

If you want to use the "host:bus.addr" format, remove any leading '0' from the bus and addr. For example, for the USB device on bus 008 dev 002, you should write "host:8.2".

The form usbdevice=DEVICE is also accepted for backwards compatibility.

More valid options can be found in the "usbdevice" section of the QEMU documentation.

  • vendor_device="VENDOR_DEVICE" โ€” selects which variant of the QEMU xen-pvdevice gets used for this guest ๐Ÿซถ Valid values are:
    • none โ€” the xen-pvdevice should be omitted. This is the default.
    • xenserver โ€” the xenserver variant of the xen-pvdevice (device-id=C000) will be specified, enabling the use of XenServer PV drivers in the guest.

This parameter only takes effect when device_model_version=qemu-xen. See xen-pci-device-reservations(7) for more information.

๐Ÿงš PVH Guest Specific Options

  • nestedhvm=BOOLEAN โ€” enables or disables guest access to hardware virtualisation features, e.g. it lets a guest Operating System also function as a hypervisor ๐Ÿ‘‘ You might want this option if you want to run another hypervisor (including another copy of Xen) within a Xen guest, or to support a guest Operating System which uses hardware virtualisation extensions (e.g. Windows XP compatibility mode on more modern Windows OS).

This option is disabled by default.

  • bootloader="PROGRAM" โ€” runs "PROGRAM" to find the kernel image and ramdisk to use ๐Ÿฅพ Normally "PROGRAM" would be "pygrub", which is an emulation of grub/grub2/syslinux. Either kernel or bootloader must be specified for PV guests.
  • bootloader_args=[ "ARG", "ARG", ...] โ€” appends ARGs to the arguments given to the bootloader program. Alternatively, if the argument is a simple string then it will be split into words at whitespace (this second option is deprecated, jsyk ๐Ÿซ ).
  • bootloader_restrict=BOOLEAN โ€” tries to restrict the bootloader after startup, to limit the consequences of security vulnerabilities from parsing guest-owned image files ๐Ÿ”’

See docs/features/qemu-deprivilege.pandoc for more information on how to set up the unprivileged users.

Note that running the bootloader in restricted mode also implies using non-interactive mode, and the disk image must be readable by the restricted user.

  • bootloader_user=USERNAME โ€” when using bootloader_restrict, run the bootloader as this user ๐Ÿ™ˆ
NOTE: Each domain MUST have a SEPARATE username. Like, seriously, do not share. ๐Ÿ’€

See docs/features/qemu-deprivilege.pandoc for more information.

  • timer_mode="MODE" โ€” specifies the mode for Virtual Timers โฐ The valid values are as follows:
    • delay_for_missed_ticks โ€” delay for missed ticks. Do not advance a vCPU's time beyond the correct delivery time for interrupts that have been missed due to preemption. Deliver missed interrupts when the vCPU is rescheduled and advance the vCPU's virtual time stepwise for each one.
    • no_delay_for_missed_ticks โ€” no delay for missed ticks. As above, missed interrupts are delivered, but guest time always tracks wallclock (i.e., real) time while doing so. This is the default.
    • no_missed_ticks_pending โ€” no missed interrupts are held pending. Instead, to ensure ticks are delivered at some non-zero rate, if we detect missed ticks then the internal tick alarm is not disabled if the vCPU is preempted during the next tick period.
    • one_missed_tick_pending โ€” one missed tick pending. Missed interrupts are collapsed together and delivered as one 'late tick'. Guest time always tracks wallclock (i.e., real) time.

๐ŸŒธ Paging

The following options control the mechanisms used to virtualise guest memory ๐Ÿง  The defaults are selected to give the best results for the common cases, so you should normally leave these options unspecified. Like, don't touch unless you know.

  • hap=BOOLEAN โ€” turns "hardware assisted paging" (the use of the hardware nested page table feature) on or off โœจ This feature is called EPT (Extended Page Tables) by Intel and NPT (Nested Page Tables) or RVI (Rapid Virtualisation Indexing) by AMD. If turned off, Xen will run the guest in "shadow page table" mode where the guest's page table updates and/or TLB flushes etc. will be emulated. Use of HAP is the default when available.
  • oos=BOOLEAN โ€” turns "out of sync pagetables" on or off ๐Ÿฆ‹ When running in shadow page table mode, the guest's page table updates may be deferred as specified in the Intel/AMD architecture manuals. However, this may expose unexpected bugs in the guest, or find bugs in Xen, so it's possible to disable this feature. Use of out of sync page tables, when Xen thinks it's appropriate, is the default.
  • shadow_memory=MBYTES โ€” number of megabytes to set aside for shadowing guest pagetable pages (effectively acting as a cache of translated pages) or to use for HAP state ๐Ÿ’พ By default this is 1MB per guest vCPU plus 8KB per MB of guest RAM. You should not normally need to adjust this value. However, if you're not using hardware assisted paging (i.e. you're using shadow mode) and your guest workload consists of a very large number of similar processes, then increasing this value may improve performance.

On Arm, this field is used to determine the size of the guest P2M pages pool, and the default value is the same as x86 HAP mode, plus 512KB to cover the extended regions. Users should adjust this value if a bigger P2M pool size is needed.

๐ŸŽ€ Device-Model Options

The following options control the selection of the device-model ๐ŸŽฎ This is the component which provides emulation of the virtual devices to an HVM guest. For a PV guest a device-model is sometimes used to provide backends for certain PV devices (most usually a virtual framebuffer device).

  • device_model_version="DEVICE-MODEL" โ€” selects which variant of the device-model should be used for this guest ๐Ÿ‘‘

Valid values are:

  • qemu-xen โ€” use the device-model merged into the upstream QEMU project. This device-model is the default for Linux dom0.
  • qemu-xen-traditional โ€” use the device-model based upon the historical Xen fork of QEMU. This device-model is still the default for NetBSD dom0.

like, real talk first: for brand-new guests you should just accept the default value, it's literally the correct vibe ๐Ÿ’… and if you've got existing guests already living their lives, then โ€” depending on the nature of the guest Operating System โ€” you might wanna force them onto the device model they were originally installed with. no cap, that's the whole note.

  • device_model_override="PATH" โ€” overrides the path to the binary used as the device-model running in the toolstack domain. the binary you drop here MUST be consistent with the device_model_version you specified. you should not normally need to touch this, bestie, it's giving "leave it alone" โœจ
  • stubdomain_kernel="PATH" โ€” overrides the path to the kernel image used as the device-model stubdomain. again, the binary provided here MUST be consistent with the device_model_version you specified. in the case of qemu-xen-traditional it's expected to be a MiniOS-based stubdomain image, and in the case of qemu-xen it's expected to be a Linux-based stubdomain kernel ๐Ÿง
  • stubdomain_cmdline="STRING" โ€” sets the device-model stubdomain kernel command line to STRING. that's it, that's the whole job ๐ŸŽ€
  • stubdomain_ramdisk="PATH" โ€” overrides the path to the ramdisk image used as the device-model stubdomain. the binary here is meant to be used by a kernel pointed to by stubdomain_kernel. it's known to be used only by Linux-based stubdomain kernel. lowkey niche but iconic ๐Ÿฆ‹
  • stubdomain_memory=MBYTES โ€” starts the stubdomain with MBYTES megabytes of RAM. default is 128. yes, 128. tiny but mighty ๐Ÿซถ
  • device_model_stubdomain_override=BOOLEAN โ€” overrides the use of a stubdomain-based device-model. normally this gets automatically selected based on the other features and options you've picked, so likeโ€ฆ it already knows what it's doing ๐Ÿ’…
  • device_model_stubdomain_seclabel="LABEL" โ€” assigns an XSM security label to the device-model stubdomain. glow-up with permissions ๐Ÿ”
  • device_model_args=[ "ARG", "ARG", ...] โ€” passes extra arbitrary options on the device-model command line. each element in the list gets passed as an option to the device-model. chaos mode: enabled, but like, consensually ๐ŸŒˆ
  • device_model_args_pv=[ "ARG", "ARG", ...] โ€” same deal, but for a PV device model only. each element in the list is passed as an option to the device-model ๐Ÿ’œ
  • device_model_args_hvm=[ "ARG", "ARG", ...] โ€” and again, but for an HVM device model only. each element in the list is passed as an option to the device-model ๐Ÿ”ฅ

๐ŸŒธ Keymaps ๐ŸŒธ

the keymaps you can actually use are defined by the device-model you're running โ€” so it depends, bestie. commonly this includes:

        ar  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  sv
        da  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     th
        de  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr

the default is en-us ๐Ÿ‡บ๐Ÿ‡ธ and if you want more info, see qemu(1). iykyk ๐ŸŽ€

๐Ÿ’… Architecture Specific options ๐Ÿ’…

๐ŸŽ ARM

  • gic_version="vN" โ€” the version of the GIC emulated for the guest. currently, the following versions are supported:
    • v2 โ€” emulate a GICv2
    • v3 โ€” emulate a GICv3. note that the emulated GIC does not support the GICv2 compatibility mode ๐Ÿ™ˆ
    • default โ€” emulate the same version as the native GIC hardware used by the host where the domain was created this requires hardware compatibility with the requested version, either natively or via hardware backwards compatibility support. so like, hardware has to actually agree to this โœจ
  • vuart="uart" โ€” to enable the vuart console, you must specify the following option in the VM config file:
vuart = "sbsa_uart"

currently, only the "sbsa_uart" model is supported for ARM. that's the only flavor on the menu ๐Ÿ“

  • sve="vl" โ€” the sve parameter enables Arm Scalable Vector Extension (SVE) usage for the guest and sets the maximum SVE vector length. this option is applicable only to AArch64 guests. a value equal to "disabled" disables the feature, and that is the default. allowed values are "disabled", "128", "256", "384", "512", "640", "768", "896", "1024", "1152", "1280", "1408", "1536", "1664", "1792", "1920", "2048", "hw". specifying "hw" means the maximum vector length supported by the platform will be used. please be aware that if you pass a specific vector length and its value is above the maximum vector length supported by the platform, an error will be raised ๐Ÿ’€ so, vibe check your hardware first.
  • llc_colors=[ "RANGE", "RANGE", ...] โ€” specifies the Last Level Cache (LLC) color configuration for the guest. RANGE can be either a single color value or a hyphen-separated closed interval of colors (such as "0-4"). cute little cache palette ๐ŸŽจ
  • nr_spis="NR_SPIS" โ€” an optional integer parameter specifying the number of SPIs (Shared Peripheral Interrupts) to allocate for the domain. max is 991 SPIs. if the value specified by the nr_spis parameter is smaller than the number of SPIs calculated by the toolstack based on the devices allocated for the domain, or the nr_spis parameter isn't specified at all, then the value calculated by the toolstack will be used for the domain. otherwise, the value specified by the nr_spis parameter will be used. the number of SPIs should match the highest interrupt ID that will be assigned to the domain ๐Ÿ””

๐Ÿ–ฅ๏ธ x86

  • mca_caps=[ "CAP", "CAP", ... ] โ€” (HVM only) enables MCA capabilities besides the default ones enabled by the Xen hypervisor for the HVM domain. "CAP" can be one in the following list:
    • "lmce" โ€” Intel local MCE
    • default โ€” no MCA capabilities in the list above are enabled so yeah, opt-in or nothing ๐Ÿงš
  • msr_relaxed=BOOLEAN โ€” the "msr_relaxed" boolean is an interim option, and defaults to false. in Xen 4.15, the default behaviour for unhandled MSRs changed, to avoid leaking host data into guests and to avoid breaking guest logic which uses #GP probing to identify the availability of MSRs. however โ€” and this is the important part ๐Ÿ˜ญ โ€” this new stricter behaviour has the possibility to break guests, and a more 4.14-like behaviour can be selected by setting this option. if using this option is necessary to fix an issue, please report a bug.
ok so that last one is a "we know, it's temporary, tell us if it hurts you" situation. don't suffer in silence, bestie ๐Ÿซถ

๐Ÿ‘€ SEE ALSO

literally the whole friend group, go read them too ๐Ÿ’–

๐Ÿ“ FILES

  • /etc/xen/NAME.cfg
  • /var/lib/xen/dump/NAME

๐Ÿ› BUGS

this document may contain items which require further documentation ๐Ÿ“ patches to improve incomplete items (or any other item, honestly) are gratefully received on the xen-devel@lists.xenproject.org mailing list. please see https://wiki.xenproject.org/wiki/Submitting_Xen_Project_Patches for information on how to submit a patch to Xen. like, if something's missing, be the main character who fixes it ๐Ÿ‘‘


and that's the whole page, bestie!! this was xl.cfg(5), version 4.20.5-pre, dated 2026-10-16 โ€” go configure something iconic ๐Ÿ’œโœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from