</code></pre></div></div><h3id="domain-specific-options"><ahref="#domain-specific-options"class="anchor-heading"aria-labelledby="domain-specific-options"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Domain Specific Options </h3><ul><li><codeclass="language-plaintext highlighter-rouge">title</code> - A short description of the domain.</li><li><codeclass="language-plaintext highlighter-rouge">description</code> - A human readable description of the virtual machine.</li><li><codeclass="language-plaintext highlighter-rouge">random_hostname</code> - To create a domain name with extra information on the end to prevent hostname conflicts.</li><li><codeclass="language-plaintext highlighter-rouge">default_prefix</code> - The default Libvirt guest name becomes a concatenation of the <codeclass="language-plaintext highlighter-rouge"><current_directory>_<guest_name></code>. The current working directory is the default prefix to the guest name. The <codeclass="language-plaintext highlighter-rouge">default_prefix</code> options allow you to set the guest name prefix.</li><li><codeclass="language-plaintext highlighter-rouge">disk_bus</code> - The type of disk device to emulate. Defaults to virtio if not set. Possible values are documented in Libvirt’s <ahref="http://libvirt.org/formatdomain.html#elementsDisks">description for <em>target</em></a>. NOTE: this option applies only to disks associated with a box image. To set the bus type on additional disks, see the <ahref="#additional-disks">Additional Disks</a> section.</li><li><codeclass="language-plaintext highlighter-rouge">disk_controller_model</code> - the controller model to use. Ignored unless either <codeclass="language-plaintext highlighter-rouge">disk_bus</code> is set to <codeclass="language-plaintext highlighter-rouge">scsi</code> or <codeclass="language-plaintext highlighter-rouge">disk_device</code> starts with <codeclass="language-plaintext highlighter-rouge">sd</code>, which is a hint to use scsi. Defaults to <codeclass="language-plaintext highlighter-rouge">virtio-scsi</code> when it encounters either of the config values for <codeclass="language-plaintext highlighter-rouge">disk_bus</code> or <codeclass="language-plaintext highlighter-rouge">disk_device</code>. See <ahref="https://libvirt.org/formatdomain.html#controllers">libvirt controller models</a> for other possible values. NOTE: this option applies only to the disks associated with a box image.</li><li><codeclass="language-plaintext highlighter-rouge">disk_device</code> - The disk device to emulate. Defaults to vda if not set, which should be fine for paravirtualized guests, but some fully virtualized guests may require hda. NOTE: this option also applies only to disks associated with a box image.</li><li><codeclass="language-plaintext highlighter-rouge">disk_address_type</code> - The address type of disk device to emulate. Libvirt uses a sensible default if not set, but some fully virtualized guests may need to override this (e.g. Debian on <em>virt</em> machine may need <em>virtio-mmio</em>). Possible values are documented in libvirt’s <ahref="https://libvirt.org/formatdomain.html#elementsAddress">description for <em>address</em></a>.</li><li><codeclass="language-plaintext highlighter-rouge">disk_driver</code> - Extra options for the main disk driver (<ahref="http://libvirt.org/formatdomain.html#elementsDisks">see Libvirt documentation</a>). NOTE: this option also applies only to disks associated with a box image. In all cases, the value <codeclass="language-plaintext highlighter-rouge">nil</code> can be used to force the hypervisor default behaviour (e.g. to override settings defined in top-level Vagrantfiles). Supported options include: <ul><li><codeclass="language-plaintext highlighter-rouge">:cache</code> - Controls the cache mechanism. Possible values are “default”, “none”, “writethrough”, “writeback”, “directsync” and “unsafe”.</li><li><codeclass="language-plaintexthighlighter-r
</code></pre></div></div></li><li><codeclass="language-plaintext highlighter-rouge">nodeset</code> - Physical NUMA nodes where virtual memory can be pinned. For more details see <ahref="https://libvirt.org/formatdomain.html#elementsNUMATuning">documentation</a>.</li><li><codeclass="language-plaintext highlighter-rouge">nested</code> - <ahref="https://docs.fedoraproject.org/en-US/quick-docs/using-nested-virtualization-in-kvm/">Enable nested virtualization</a>. Default is false.</li><li><codeclass="language-plaintext highlighter-rouge">cpu_mode</code> - <ahref="https://libvirt.org/formatdomain.html#elementsCPU">CPU emulation mode</a>. Defaults to ‘host-model’ if not set. Allowed values: host-model, host-passthrough, custom.</li><li><codeclass="language-plaintext highlighter-rouge">cpu_model</code> - CPU Model. Defaults to ‘qemu64’ if not set and <codeclass="language-plaintext highlighter-rouge">cpu_mode</code> is <codeclass="language-plaintext highlighter-rouge">custom</code> and to ‘’ otherwise. This can really only be used when setting <codeclass="language-plaintext highlighter-rouge">cpu_mode</code> to <codeclass="language-plaintext highlighter-rouge">custom</code>.</li><li><codeclass="language-plaintext highlighter-rouge">cpu_fallback</code> - Whether to allow Libvirt to fall back to a CPU model close to the specified model if features in the guest CPU are not supported on the host. Defaults to ‘allow’ if not set. Allowed values: <codeclass="language-plaintext highlighter-rouge">allow</code>, <codeclass="language-plaintext highlighter-rouge">forbid</code>.</li><li><p><codeclass="language-plaintext highlighter-rouge">numa_nodes</code> - Specify an array of NUMA nodes for the guest. The syntax is similar to what would be set in the domain XML. <codeclass="language-plaintext highlighter-rouge">memory</code> must be in MB. Symmetrical and asymmetrical topologies are supported but make sure your total count of defined CPUs adds up to <codeclass="language-plaintext highlighter-rouge">v.cpus</code>.</p><p>The sum of all the memory defined here will act as your total memory for your guest VM. <strong>This sum will override what is set in <codeclass="language-plaintext highlighter-rouge">v.memory</code></strong></p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>v.cpus = 4
</code></pre></div></div></li><li><codeclass="language-plaintext highlighter-rouge">launchsecurity</code> - Configure Secure Encryption Virtualization for the guest, requires additional components to be configured to work, see <ahref="./examples.html#secure-encryption-virtualization">examples</a>. For more information look at <ahref="https://libvirt.org/kbase/launch_security_sev.html">libvirt documentation</a>. <divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>libvirt.launchsecurity :type => 'sev', :cbitpos => 47, :reducedPhysBits => 1, :policy => "0x0003"
</code></pre></div></div></li><li><codeclass="language-plaintext highlighter-rouge">memtune</code> - Configure the memtune settings for the guest, primarily exposed to facilitate enabling Secure Encryption Virtualization. Note that when configuring <codeclass="language-plaintext highlighter-rouge">hard_limit</code> that the value is in kB as opposed to <codeclass="language-plaintext highlighter-rouge">libvirt.memory</code> which is in Mb. Additionally it must be set to be higher than <codeclass="language-plaintext highlighter-rouge">libvirt.memory</code>, see <ahref="https://libvirt.org/kbase/launch_security_sev.html">libvirt documentation</a> for details on why. <divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>libvirt.memtune :type => "hard_limit", :value => 2500000 # Note here the value in kB (not in Mb)
</code></pre></div></div></li><li><codeclass="language-plaintext highlighter-rouge">loader</code> - Sets path to custom UEFI loader.</li><li><codeclass="language-plaintext highlighter-rouge">kernel</code> - To launch the guest with a kernel residing on host filesystems. Equivalent to qemu <codeclass="language-plaintext highlighter-rouge">-kernel</code>.</li><li><codeclass="language-plaintext highlighter-rouge">initrd</code> - To specify the initramfs/initrd to use for the guest. Equivalent to qemu <codeclass="language-plaintext highlighter-rouge">-initrd</code>.</li><li><codeclass="language-plaintext highlighter-rouge">cmd_line</code> - Arguments passed on to the guest kernel initramfs or initrd to use. Equivalent to qemu <codeclass="language-plaintext highlighter-rouge">-append</code>, only possible to use in combination with <codeclass="language-plaintext highlighter-rouge">initrd</code> and <codeclass="language-plaintext highlighter-rouge">kernel</code>.</li><li><codeclass="language-plaintext highlighter-rouge">graphics_type</code> - Sets the protocol used to expose the guest display. Defaults to <codeclass="language-plaintext highlighter-rouge">vnc</code>. Possible values are “sdl”, “curses”, “none”, “gtk”, “vnc” or “spice”.</li><li><codeclass="language-plaintext highlighter-rouge">graphics_port</code> - Sets the port for the display protocol to bind to. Defaults to <codeclass="language-plaintext highlighter-rouge">-1</code>, which will be set automatically by libvirt.</li><li><codeclass="language-plaintext highlighter-rouge">graphics_websocket</code> - Sets the websocket port for the display protocol to bind to. Defaults to <codeclass="language-plaintext highlighter-rouge">-1</code>, which will be set automatically by libvirt. The autoport configuration has no effect on the websocket port due to security reasons.</li><li><codeclass="language-plaintext highlighter-rouge">graphics_ip</code> - Sets the IP for the display protocol to bind to. Defaults to “127.0.0.1”.</li><li><codeclass="language-plaintext highlighter-rouge">graphics_passwd</code> - Sets the password for the display protocol. Working for vnc and Spice. by default working without passsword.</li><li><codeclass="language-plaintext highlighter-rouge">graphics_autoport</code> - Sets autoport for graphics, Libvirt in this case ignores graphics_port value, Defaults to ‘yes’. Possible value are “yes” and “no”</li><li><codeclass="language-plaintext highlighter-rouge">graphics_gl</code> - Set to <codeclass="language-plaintext highlighter-rouge">true</code> to enable OpenGL. Defaults to <codeclass="language-plaintext highlighter-rouge">true</code> if <codeclass="language-plaintext highlighter-rouge">video_accel3d</code> is <codeclass="language-plaintext highlighter-rouge">true</code>.</li><li><codeclass="language-plaintext highlighter-rouge">keymap</code> - Set keymap for vm. default: en-us</li><li><codeclass="language-plaintext highlighter-rouge">kvm_hidden</code> - <ahref="https://libvirt.org/formatdomain.html#elementsFeatures">Hide the hypervisor from the guest</a>. Useful for <ahref="#pci-device-passthrough">GPU passthrough</a> on stubborn drivers. Default is false.</li><li><codeclass="language-plaintext highlighter-rouge">video_type</code> - Sets the graphics card type exposed to the guest. Defaults to “cirrus”. <ahref="http://libvirt.org/formatdomain.html#elementsVideo">Possible values</a> are “vga”, “cirrus”, “vmvga”, “xen”, “vbox”, or “qxl”.</li><li><codeclass="language-plaintext highlighter-rouge">video_vram</code> - Used by some graphics card types to vary the amount of RAM dedicated to video. Defaults to 16384.</li><li><codeclass="language-plaintext highlighter-rouge">video_accel3d</code> - Set to <codeclass="language-plaintext highlighter-rouge">true</code> to enable 3D acceleration. Defaults to <codeclass="language-plaintext highlighter-rouge">false</code>.</li><li><codeclass="language-plaintext highlighter-rouge">sound_type</code>
</code></pre></div></div><p>The following example shows part of a Vagrantfile that enables the VM to boot from a network interface first and a hard disk second. This could be used to run VMs that are meant to be a PXE booted machines. Be aware that if <codeclass="language-plaintext highlighter-rouge">hd</code> is not specified as a boot option, it will never be tried.</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h3id="reload-behavior"><ahref="#reload-behavior"class="anchor-heading"aria-labelledby="reload-behavior"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Reload behavior </h3><p>On <codeclass="language-plaintext highlighter-rouge">vagrant reload</code> the following domain specific attributes are updated in defined domain:</p><ul><li><codeclass="language-plaintext highlighter-rouge">disk_bus</code> - Is updated only on disks. It skips CDROMs</li><li><codeclass="language-plaintext highlighter-rouge">nic_model_type</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">memory</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">cpus</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">nested</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">cpu_mode</code> - Updated. Pay attention that custom mode is not supported</li><li><codeclass="language-plaintext highlighter-rouge">graphics_type</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">graphics_port</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">graphics_websocket</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">graphics_ip</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">graphics_passwd</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">graphics_autoport</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">keymap</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">video_type</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">video_vram</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">tpm_model</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">tpm_type</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">tpm_path</code> - Updated</li><li><codeclass="language-plaintext highlighter-rouge">tpm_version</code> - Updated</li></ul><h2id="networks"><ahref="#networks"class="anchor-heading"aria-labelledby="networks"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Networks </h2><p>Networking features in the form of <codeclass="language-plaintext highlighter-rouge">config.vm.network</code> support private networks concept. It supports both the virtual network switch routing types and the point to point Guest OS to Guest OS setting using UDP/Mcast/TCP tunnel interfaces.</p><p>http://wiki.libvirt.org/page/VirtualNetworking</p><p>https://libvirt.org/formatdomain.html#elementsNICSTCP</p><p>http://libvirt.org/formatdomain.html#elementsNICSMulticast</p><p>http://libvirt.org/formatdomain.html#elementsNICSUDP <em>(in Libvirt v1.2.20 and higher)</em></p><p>Public Network interfaces are currently implemented using the macvtap driver. The macvtap driver is only available with the Linux Kernel version >= 2.6.24. See the following Libvirt documentation for the details of the macvtap usage.</p><p>http://www.libvirt.org/formatdomain.html#elementsNICSDirect</p><p>An examples of network interface definitions:</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="c1"># Private network using virtual network switching</span>
</code></pre></div></div><p>In example below, one network interface is configured for VM <codeclass="language-plaintext highlighter-rouge">test_vm1</code>. After you run <codeclass="language-plaintext highlighter-rouge">vagrant up</code>, VM will be accessible on IP address <codeclass="language-plaintext highlighter-rouge">10.20.30.40</code>. So if you install a web server via provisioner, you will be able to access your testing server on <codeclass="language-plaintext highlighter-rouge">http://10.20.30.40</code> URL. But beware that this address is private to Libvirt host only. It’s not visible outside of the hypervisor box.</p><p>If network <codeclass="language-plaintext highlighter-rouge">10.20.30.0/24</code> doesn’t exist, provider will create it. By default created networks are NATed to outside world, so your VM will be able to connect to the internet (if hypervisor can). And by default, DHCP is offering addresses on newly created networks.</p><p>The second interface is created and bridged into the physical device <codeclass="language-plaintext highlighter-rouge">eth0</code>. This mechanism uses the macvtap Kernel driver and therefore does not require an existing bridge device. This configuration assumes that DHCP and DNS services are being provided by the public network. This public interface should be reachable by anyone with access to the public network.</p><h3id="private-network-options"><ahref="#private-network-options"class="anchor-heading"aria-labelledby="private-network-options"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Private Network Options </h3><p><em>Note: These options are not applicable to public network interfaces.</em></p><p>There is a way to pass specific options for Libvirt provider when using <codeclass="language-plaintext highlighter-rouge">config.vm.network</code> to configure new network interface. Each parameter name starts with <codeclass="language-plaintext highlighter-rouge">libvirt__</code> string. Here is a list of those options:</p><ul><li><codeclass="language-plaintext highlighter-rouge">:libvirt__network_name</code> - Name of Libvirt network to connect to. By default, network ‘default’ is used.</li><li><codeclass="language-plaintext highlighter-rouge">:libvirt__netmask</code> - Used only together with <codeclass="language-plaintext highlighter-rouge">:ip</code> option. Default is ‘255.255.255.0’.</li><li><codeclass="language-plaintext highlighter-rouge">:libvirt__network_address</code> - Used only when <codeclass="language-plaintext highlighter-rouge">:type</code> is set to <codeclass="language-plaintext highlighter-rouge">dhcp</code>. Only <codeclass="language-plaintext highlighter-rouge">/24</code> subnet is supported. Default is <codeclass="language-plaintext highlighter-rouge">172.28.128.0</code>.</li><li><codeclass="language-plaintext highlighter-rouge">:libvirt__host_ip</code> - Address to use for the host (not guest). Default is first possible address (after network address).</li><li><codeclass="language-plaintext highlighter-rouge">:libvirt__domain_name</code> - DNS domain of the DHCP server. Used only when creating new network.</li><li><codeclass="language-plaintext highlighter-rouge">:libvirt__dhcp_enabled</code> - If DHCP will offer addresses, or not. Used only when creating new network. Default is true.</li><li><codeclass="language-plaintext highlighter-rouge">:libvirt__dhcp_start</code> - First address given out via DHCP. Default is third address in range (after network name and gateway).</li><li><codeclass="language-plaintext highlighter-rouge">:libvirt__dhcp_stop</code> - Last address given out via DHCP. Default is last possible address in range (before broadcast address).</li><li><codeclass="language-plaintext highlighter-rouge">:libvirt__dhcp_bootp_file</code> - The file to be used for the boot image. Used only when dhcp is enabled.</li><li><codeclass="language-plaintext highlighter-rouge">:libvirt__dhcp_bootp_server</code> - The server that runs the DHCP server. U
</code></pre></div></div><p>To use the management network interface with an external dhcp service you need to setup a bridged host network manually and define it via <codeclass="language-plaintext highlighter-rouge">management_network_name</code> in your Vagrantfile.</p><h2id="additional-disks"><ahref="#additional-disks"class="anchor-heading"aria-labelledby="additional-disks"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Additional Disks </h2><p>You can create and attach additional disks to a VM via <codeclass="language-plaintext highlighter-rouge">libvirt.storage :file</code>. It has a number of options:</p><ul><li><codeclass="language-plaintext highlighter-rouge">path</code> - Location of the disk image. If unspecified, a path is automatically chosen in the same storage pool as the VMs primary disk.</li><li><codeclass="language-plaintext highlighter-rouge">device</code> - Name of the device node the disk image will have in the VM, e.g. <em>vdb</em>. If unspecified, the next available device is chosen.</li><li><codeclass="language-plaintext highlighter-rouge">size</code> - Size of the disk image. If unspecified, defaults to 10G.</li><li><codeclass="language-plaintext highlighter-rouge">type</code> - Type of disk image to create. Defaults to <em>qcow2</em>.</li><li><codeclass="language-plaintext highlighter-rouge">bus</code> - Type of bus to connect device to. Defaults to <em>virtio</em>.</li><li><codeclass="language-plaintext highlighter-rouge">allow_existing</code> - Set to true if you want to allow the VM to use a pre-existing disk. If the disk doesn’t exist it will be created. Disks with this option set to true need to be removed manually.</li><li><codeclass="language-plaintext highlighter-rouge">shareable</code> - Set to true if you want to simulate shared SAN storage.</li><li><codeclass="language-plaintext highlighter-rouge">serial</code> - Serial number of the disk device.</li><li><codeclass="language-plaintext highlighter-rouge">wwn</code> - WWN number of the disk device.</li></ul><p>The following disk performance options can also be configured (see the <ahref="http://libvirt.org/formatdomain.html#elementsDisks">libvirt documentation for possible values</a> or <ahref="https://www.suse.com/documentation/sles11/book_kvm/data/sect1_chapter_book_kvm.html">here</a> for a fuller explanation). In all cases, the options use the hypervisor default if not specified, or if set to <codeclass="language-plaintext highlighter-rouge">nil</code>.</p><ul><li><codeclass="language-plaintext highlighter-rouge">cache</code> - Cache mode to use. Value may be <codeclass="language-plaintext highlighter-rouge">default</code>, <codeclass="language-plaintext highlighter-rouge">none</code>, <codeclass="language-plaintext highlighter-rouge">writeback</code>, <codeclass="language-plaintext highlighter-rouge">writethrough</code>, <codeclass="language-plaintext highlighter-rouge">directsync</code> or <codeclass="language-plaintext highlighter-rouge">unsafe</code>.</li><li><codeclass="language-plaintext highlighter-rouge">io</code> - Controls specific policies on I/O. Value may be <codeclass="language-plaintext highlighter-rouge">threads</code> or <codeclass="language-plaintext highlighter-rouge">native</code>.</li><li><codeclass="language-plaintext highlighter-rouge">copy_on_read</code> - Controls whether to copy read backing file into the image file. Value may be <codeclass="language-plaintext highlighter-rouge">on</code> or <codeclass="language-plaintext highlighter-rouge">off</code>.</li><li><codeclass="language-plaintext highlighter-rouge">discard</code> - Controls whether discard requests (also known as “trim” or “unmap”) are ignored or passed to the filesystem. Value may be <codeclass="language-plaintext highlighter-rouge">unmap</code> or <codeclass="language-plaintext highlighter-rouge">ignore</code>. Note: for discard to work, you will likely also need to set <codeclass="language-plaintext highlighter-rouge">:bus => 'scsi'</co
</code></pre></div></div><p>For shared SAN storage to work the following example can be used:</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h3id="reload-behavior-1"><ahref="#reload-behavior-1"class="anchor-heading"aria-labelledby="reload-behavior-1"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Reload behavior </h3><p>On <codeclass="language-plaintext highlighter-rouge">vagrant reload</code> the following additional disk attributes are updated in defined domain:</p><ul><li><codeclass="language-plaintext highlighter-rouge">bus</code> - Updated. Uses <codeclass="language-plaintext highlighter-rouge">device</code> as a search marker. It is not required to define <codeclass="language-plaintext highlighter-rouge">device</code>, but it’s recommended. If <codeclass="language-plaintext highlighter-rouge">device</code> is defined then the order of additional disk definition becomes irrelevant.</li></ul><h2id="cdroms"><ahref="#cdroms"class="anchor-heading"aria-labelledby="cdroms"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> CDROMs </h2><p>You can attach up to four CDROMs to a VM via <codeclass="language-plaintext highlighter-rouge">libvirt.storage :file, :device => :cdrom</code>. Available options are:</p><ul><li><codeclass="language-plaintext highlighter-rouge">path</code> - The path to the iso to be used for the CDROM drive.</li><li><codeclass="language-plaintext highlighter-rouge">dev</code> - The device to use (<codeclass="language-plaintext highlighter-rouge">hda</code>, <codeclass="language-plaintext highlighter-rouge">hdb</code>, <codeclass="language-plaintext highlighter-rouge">hdc</code>, or <codeclass="language-plaintext highlighter-rouge">hdd</code>). This will be automatically determined if unspecified.</li><li><codeclass="language-plaintext highlighter-rouge">bus</code> - The bus to use for the CDROM drive. Defaults to <codeclass="language-plaintext highlighter-rouge">ide</code></li></ul><p>The following example creates three CDROM drives in the VM:</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h2id="floppies"><ahref="#floppies"class="anchor-heading"aria-labelledby="floppies"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Floppies </h2><p>You can attach up to two floppies to a VM via <codeclass="language-plaintext highlighter-rouge">libvirt.storage :file, :device => :floppy</code>. Available options are:</p><ul><li><codeclass="language-plaintext highlighter-rouge">path</code> - The path to the vfd image to be used for the floppy drive.</li><li><codeclass="language-plaintext highlighter-rouge">dev</code> - The device to use (<codeclass="language-plaintext highlighter-rouge">fda</code> or <codeclass="language-plaintext highlighter-rouge">fdb</code>). This will be automatically determined if unspecified.</li></ul><p>The following example creates a floppy drive in the VM:</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h2id="input"><ahref="#input"class="anchor-heading"aria-labelledby="input"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Input </h2><p>You can specify multiple inputs to the VM via <codeclass="language-plaintext highlighter-rouge">libvirt.input</code>. Available options are listed below. Note that both options are required:</p><ul><li><codeclass="language-plaintext highlighter-rouge">type</code> - The type of the input</li><li><codeclass="language-plaintext highlighter-rouge">bus</code> - The bus of the input</li></ul><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h2id="pci-device-passthrough"><ahref="#pci-device-passthrough"class="anchor-heading"aria-labelledby="pci-device-passthrough"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> PCI device passthrough </h2><p>You can specify multiple PCI devices to passthrough to the VM via <codeclass="language-plaintext highlighter-rouge">libvirt.pci</code>. Available options are listed below. Note that all options are required, except domain, which defaults to <codeclass="language-plaintext highlighter-rouge">0x0000</code>:</p><ul><li><codeclass="language-plaintext highlighter-rouge">domain</code> - The domain of the PCI device</li><li><codeclass="language-plaintext highlighter-rouge">bus</code> - The bus of the PCI device</li><li><codeclass="language-plaintext highlighter-rouge">slot</code> - The slot of the PCI device</li><li><codeclass="language-plaintext highlighter-rouge">function</code> - The function of the PCI device</li></ul><p>You can extract that information from output of <codeclass="language-plaintext highlighter-rouge">lspci</code> command. First characters of each line are in format <codeclass="language-plaintext highlighter-rouge">[<domain>]:[<bus>]:[<slot>].[<func>]</code>. For example:</p><divclass="language-shell highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="nv">$ </span>lspci| <spanclass="nb">grep </span>NVIDIA
</code></pre></div></div><p>In that case <codeclass="language-plaintext highlighter-rouge">domain</code> is <codeclass="language-plaintext highlighter-rouge">0x0000</code>, <codeclass="language-plaintext highlighter-rouge">bus</code> is <codeclass="language-plaintext highlighter-rouge">0x03</code>, <codeclass="language-plaintext highlighter-rouge">slot</code> is <codeclass="language-plaintext highlighter-rouge">0x00</code> and <codeclass="language-plaintext highlighter-rouge">function</code> is <codeclass="language-plaintext highlighter-rouge">0x0</code>.</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><p>Note! Above options affect configuration only at domain creation. It won’t change VM behaviour on <codeclass="language-plaintext highlighter-rouge">vagrant reload</code> after domain was created.</p><p>Don’t forget to <ahref="#domain-specific-options">set</a><codeclass="language-plaintext highlighter-rouge">kvm_hidden</code> option to <codeclass="language-plaintext highlighter-rouge">true</code> especially if you are passthroughing NVIDIA GPUs. Otherwise GPU is visible from VM but cannot be operated.</p><h2id="using-usb-devices"><ahref="#using-usb-devices"class="anchor-heading"aria-labelledby="using-usb-devices"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Using USB Devices </h2><p>There are several ways to pass a USB device through to a running instance:</p><ul><li>Use <codeclass="language-plaintext highlighter-rouge">libvirt.usb</code> to <ahref="#usb-device-passthrough">attach a USB device at boot</a>, with the device ID specified in the Vagrantfile</li><li>Use a client (such as <codeclass="language-plaintext highlighter-rouge">virt-viewer</code> or <codeclass="language-plaintext highlighter-rouge">virt-manager</code>) to attach the device at runtime <ahref="#usb-redirector-devices">via USB redirectors</a></li><li>Use <codeclass="language-plaintext highlighter-rouge">virsh attach-device</code> once the VM is running (however, this is outside the scope of this readme)</li></ul><p>In all cases, if you wish to use a high-speed USB device, you will need to use <codeclass="language-plaintext highlighter-rouge">libvirt.usb_controller</code> to specify a USB2 or USB3 controller, as the default configuration only exposes a USB1.1 controller.</p><h3id="usb-controller-configuration"><ahref="#usb-controller-configuration"class="anchor-heading"aria-labelledby="usb-controller-configuration"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> USB Controller Configuration </h3><p>The USB controller can be configured using <codeclass="language-plaintext highlighter-rouge">libvirt.usb_controller</code>, with the following options:</p><ul><li><codeclass="language-plaintext highlighter-rouge">model</code> - The USB controller device model to emulate. (mandatory)</li><li><codeclass="language-plaintext highlighter-rouge">ports</code> - The number of devices that can be connected to the controller.</li></ul><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><p>See the <ahref="https://libvirt.org/formatdomain.html#elementsControllers">libvirt documentation</a> for a list of valid models.</p><p>If any USB devices are passed through by setting <codeclass="language-plaintext highlighter-rouge">libvirt.usb</code> or <codeclass="language-plaintext highlighter-rouge">libvirt.redirdev</code>, a default controller will be added using the model <codeclass="language-plaintext highlighter-rouge">qemu-xhci</code> in the absence of a user specified one. This should help ensure more devices work out of the box as the default configured by libvirt is pii3-uhci, which appears to only work for USB 1 devices and does not work as expected when connected via a USB 2 controller, while the xhci stack should work for all versions of USB.</p><h3id="usb-device-passthrough"><ahref="#usb-device-passthrough"class="anchor-heading"aria-labelledby="usb-device-passthrough"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> USB Device Passthrough </h3><p>You can specify multiple USB devices to passthrough to the VM via <codeclass="language-plaintext highlighter-rouge">libvirt.usb</code>. The device can be specified by the following options:</p><ul><li><codeclass="language-plaintext highlighter-rouge">bus</code> - The USB bus ID, e.g. “1”</li><li><codeclass="language-plaintext highlighter-rouge">device</code> - The USB device ID, e.g. “2”</li><li><codeclass="language-plaintext highlighter-rouge">vendor</code> - The USB devices vendor ID (VID), e.g. “0x1234”</li><li><codeclass="language-plaintext highlighter-rouge">product</code> - The USB devices product ID (PID), e.g. “0xabcd”</li></ul><p>At least one of these has to be specified, and <codeclass="language-plaintext highlighter-rouge">bus</code> and <codeclass="language-plaintext highlighter-rouge">device</code> may only be used together.</p><p>The example values above match the device from the following output of <codeclass="language-plaintext highlighter-rouge">lsusb</code>:</p><divclass="language-plaintext highlighter-rouge"><divclass="highlight"><preclass="highlight"><code>Bus 001 Device 002: ID 1234:abcd Example device
</code></pre></div></div><p>Additionally, the following options can be used:</p><ul><li><codeclass="language-plaintext highlighter-rouge">startupPolicy</code> - Is passed through to Libvirt and controls if the device has to exist. Libvirt currently allows the following values: “mandatory”, “requisite”, “optional”.</li></ul><h3id="usb-redirector-devices"><ahref="#usb-redirector-devices"class="anchor-heading"aria-labelledby="usb-redirector-devices"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> USB Redirector Devices </h3><p>You can specify multiple redirect devices via <codeclass="language-plaintext highlighter-rouge">libvirt.redirdev</code>. There are two types, <codeclass="language-plaintext highlighter-rouge">tcp</code> and <codeclass="language-plaintext highlighter-rouge">spicevmc</code> supported, for forwarding USB-devices to the guest. Available options are listed below.</p><ul><li><codeclass="language-plaintext highlighter-rouge">type</code> - The type of the USB redirector device. (<codeclass="language-plaintext highlighter-rouge">tcp</code> or <codeclass="language-plaintext highlighter-rouge">spicevmc</code>)</li><li><codeclass="language-plaintext highlighter-rouge">host</code> - The host where the device is attached to. (mandatory for type <codeclass="language-plaintext highlighter-rouge">tcp</code>)</li><li><codeclass="language-plaintext highlighter-rouge">port</code> - The port where the device is listening. (mandatory for type <codeclass="language-plaintext highlighter-rouge">tcp</code>)</li></ul><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><p>Note that in order to enable USB redirection with Spice clients, you may need to also set <codeclass="language-plaintext highlighter-rouge">libvirt.graphics_type = "spice"</code></p><h4id="filter-for-usb-redirector-devices"><ahref="#filter-for-usb-redirector-devices"class="anchor-heading"aria-labelledby="filter-for-usb-redirector-devices"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Filter for USB Redirector Devices </h4><p>You can define filter for redirected devices. These filters can be positive or negative, by setting the mandatory option <codeclass="language-plaintext highlighter-rouge">allow=yes</code> or <codeclass="language-plaintext highlighter-rouge">allow=no</code>. All available options are listed below. Note the option <codeclass="language-plaintext highlighter-rouge">allow</code> is mandatory.</p><ul><li><codeclass="language-plaintext highlighter-rouge">class</code> - The device class of the USB device. A list of device classes is available on <ahref="https://en.wikipedia.org/wiki/USB#Device_classes">Wikipedia</a>.</li><li><codeclass="language-plaintext highlighter-rouge">vendor</code> - The vendor of the USB device.</li><li><codeclass="language-plaintext highlighter-rouge">product</code> - The product id of the USB device.</li><li><codeclass="language-plaintext highlighter-rouge">version</code> - The version of the USB device. Note that this is the version of <codeclass="language-plaintext highlighter-rouge">bcdDevice</code></li><li><codeclass="language-plaintext highlighter-rouge">allow</code> - allow or disallow redirecting this device. (mandatory)</li></ul><p>You can extract that information from output of <codeclass="language-plaintext highlighter-rouge">lsusb</code> command. Every line contains the information in format <codeclass="language-plaintext highlighter-rouge">Bus [<bus>] Device [<device>]: ID [<vendor>:[<product>]</code>. The <codeclass="language-plaintext highlighter-rouge">version</code> can be extracted from the detailed output of the device using <codeclass="language-plaintext highlighter-rouge">lsusb -D /dev/usb/[<bus>]/[<device>]</code>. For example:</p><divclass="language-shell highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="c"># get bcdDevice from</span>
</code></pre></div></div><p>In this case, the USB device with <codeclass="language-plaintext highlighter-rouge">class 0x0b</code>, <codeclass="language-plaintext highlighter-rouge">vendor 0x08e6</code>, <codeclass="language-plaintext highlighter-rouge">product 0x3437</code> and <codeclass="language-plaintext highlighter-rouge">bcdDevice version 2.00</code> is allowed to be redirected to the guest. All other devices will be refused.</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h2id="serial-console-devices"><ahref="#serial-console-devices"class="anchor-heading"aria-labelledby="serial-console-devices"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Serial Console Devices </h2><p>You can define settings to redirect output from the serial console of any VM brought up with libvirt to a file or other devices that are listening. <ahref="https://libvirt.org/formatdomain.html#elementCharSerial">See libvirt documentation</a>.</p><p>Currently only redirecting to a file is supported.</p><ul><li><codeclass="language-plaintext highlighter-rouge">type</code> - only value that has an effect is file, in the future support may be added for virtual console, pty, dev, pipe, tcp, udp, unix socket, spiceport & nmdm.</li><li><codeclass="language-plaintext highlighter-rouge">source</code> - options pertaining to how the connection attaches to the host, contains sub-settings dependent on <codeclass="language-plaintext highlighter-rouge">type</code>. <codeclass="language-plaintext highlighter-rouge">source</code> options for type <codeclass="language-plaintext highlighter-rouge">file</code><ul><li><codeclass="language-plaintext highlighter-rouge">path</code> - file on host to connect to the serial port to record all output. May be created by qemu system user causing some permissions issues.</li></ul></li></ul><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h2id="random-number-generator-passthrough"><ahref="#random-number-generator-passthrough"class="anchor-heading"aria-labelledby="random-number-generator-passthrough"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Random number generator passthrough </h2><p>You can pass through <codeclass="language-plaintext highlighter-rouge">/dev/random</code> to your VM by configuring the domain like this:</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><p>At the moment only the <codeclass="language-plaintext highlighter-rouge">random</code> backend is supported.</p><h2id="watchdog-device"><ahref="#watchdog-device"class="anchor-heading"aria-labelledby="watchdog-device"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Watchdog device </h2><p>A virtual hardware watchdog device can be added to the guest via the <codeclass="language-plaintext highlighter-rouge">libvirt.watchdog</code> element. The option <codeclass="language-plaintext highlighter-rouge">model</code> is mandatory and could have on of the following values.</p><ul><li><codeclass="language-plaintext highlighter-rouge">i6300esb</code> - the recommended device, emulating a PCI Intel 6300ESB</li><li>‘ib700` - emulating an ISA iBase IB700</li><li><codeclass="language-plaintext highlighter-rouge">diag288</code> - emulating an S390 DIAG288 device</li></ul><p>The optional action attribute describes what <codeclass="language-plaintext highlighter-rouge">action</code> to take when the watchdog expires. Valid values are specific to the underlying hypervisor. The default behavior is <codeclass="language-plaintext highlighter-rouge">reset</code>.</p><ul><li><codeclass="language-plaintext highlighter-rouge">reset</code> - default, forcefully reset the guest</li><li><codeclass="language-plaintext highlighter-rouge">shutdown</code> - gracefully shutdown the guest (not recommended)</li><li><codeclass="language-plaintext highlighter-rouge">poweroff</code> - forcefully power off the guest</li><li><codeclass="language-plaintext highlighter-rouge">pause</code> - pause the guest</li><li><codeclass="language-plaintext highlighter-rouge">none</code> - do nothing</li><li><codeclass="language-plaintext highlighter-rouge">dump</code> - automatically dump the guest</li><li><codeclass="language-plaintext highlighter-rouge">inject-nmi</code> - inject a non-maskable interrupt into the guest</li></ul><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h2id="smartcard-device"><ahref="#smartcard-device"class="anchor-heading"aria-labelledby="smartcard-device"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Smartcard device </h2><p>A virtual smartcard device can be supplied to the guest via the <codeclass="language-plaintext highlighter-rouge">libvirt.smartcard</code> element. The option <codeclass="language-plaintext highlighter-rouge">mode</code> is mandatory and currently only value <codeclass="language-plaintext highlighter-rouge">passthrough</code> is supported. The value <codeclass="language-plaintext highlighter-rouge">spicevmc</code> for option <codeclass="language-plaintext highlighter-rouge">type</code> is default value and can be suppressed. On using <codeclass="language-plaintext highlighter-rouge">type = tcp</code>, the options <codeclass="language-plaintext highlighter-rouge">source_mode</code>, <codeclass="language-plaintext highlighter-rouge">source_host</code> and <codeclass="language-plaintext highlighter-rouge">source_service</code> are mandatory.</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h2id="hypervisor-features"><ahref="#hypervisor-features"class="anchor-heading"aria-labelledby="hypervisor-features"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Hypervisor Features </h2><p>Hypervisor features can be specified via <codeclass="language-plaintext highlighter-rouge">libvirt.features</code> as a list. The default options that are enabled are <codeclass="language-plaintext highlighter-rouge">acpi</code>, <codeclass="language-plaintext highlighter-rouge">apic</code> and <codeclass="language-plaintext highlighter-rouge">pae</code>. If you define <codeclass="language-plaintext highlighter-rouge">libvirt.features</code> you overwrite the defaults, so keep that in mind.</p><p>An example:</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><p>A different example for ARM boards:</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><p>You can also specify a special set of features that help improve the behavior of guests running Microsoft Windows.</p><p>You can specify HyperV features via <codeclass="language-plaintext highlighter-rouge">libvirt.hyperv_feature</code>. Available options are listed below. Note that both options are required:</p><ul><li><codeclass="language-plaintext highlighter-rouge">name</code> - The name of the feature Hypervisor feature (see Libvirt doc)</li><li><codeclass="language-plaintext highlighter-rouge">state</code> - The state for this feature which can be either <codeclass="language-plaintext highlighter-rouge">on</code> or <codeclass="language-plaintext highlighter-rouge">off</code>.</li></ul><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h2id="clock"><ahref="#clock"class="anchor-heading"aria-labelledby="clock"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Clock </h2><p>The clock can be configured using one of the following methods:</p><ul><li>Set nothing, and the clock will default to UTC.</li><li>Set <codeclass="language-plaintext highlighter-rouge">libvirt.clock_offset</code> to ‘utc’ or ‘localtime’ by assigning the respective values.</li><li>To set the clock to a different timezone, assign the timezone name to <codeclass="language-plaintext highlighter-rouge">libvirt.clock_timezone</code>.</li><li>To set the clock to the same absolute time whenever the VM starts, set <codeclass="language-plaintext highlighter-rouge">libvirt.clock_absolute</code>. The value format is that of an epoch timestamp.</li><li>To set the clock at an arbitrary offset to realtime, use <codeclass="language-plaintext highlighter-rouge">libvirt.clock_adjustment</code>. Specify the offset adjustment in seconds. By default, the clock offset is relative to UTC, but this can be changed by setting <codeclass="language-plaintext highlighter-rouge">libvirt.clock_basis</code> to ‘localtime’.</li></ul><p>In addition to the above, timers can be specified via <codeclass="language-plaintext highlighter-rouge">libvirt.clock_timer</code>. Available options for timers are: name, track, tickpolicy, frequency, mode, present</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h2id="cpu-features"><ahref="#cpu-features"class="anchor-heading"aria-labelledby="cpu-features"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> CPU features </h2><p>You can specify CPU feature policies via <codeclass="language-plaintext highlighter-rouge">libvirt.cpu_feature</code>. Available options are listed below. Note that both options are required:</p><ul><li><codeclass="language-plaintext highlighter-rouge">name</code> - The name of the feature for the chosen CPU (see Libvirt’s <codeclass="language-plaintext highlighter-rouge">cpu_map.xml</code>)</li><li><codeclass="language-plaintext highlighter-rouge">policy</code> - The policy for this feature (one of <codeclass="language-plaintext highlighter-rouge">force</code>, <codeclass="language-plaintext highlighter-rouge">require</code>, <codeclass="language-plaintext highlighter-rouge">optional</code>, <codeclass="language-plaintext highlighter-rouge">disable</code> and <codeclass="language-plaintext highlighter-rouge">forbid</code> - see Libvirt documentation)</li></ul><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><h2id="memory-backing"><ahref="#memory-backing"class="anchor-heading"aria-labelledby="memory-backing"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Memory Backing </h2><p>You can specify memoryBacking options via <codeclass="language-plaintext highlighter-rouge">libvirt.memorybacking</code>. Available options are shown below. Full documentation is available at the <ahref="https://libvirt.org/formatdomain.html#elementsMemoryBacking">libvirt <em>memoryBacking</em> section</a>.</p><p>NOTE: The hugepages <codeclass="language-plaintext highlighter-rouge"><page></code> element is not yet supported</p><divclass="language-ruby highlighter-rouge"><divclass="highlight"><preclass="highlight"><code><spanclass="no">Vagrant</span><spanclass="p">.</span><spanclass="nf">configure</span><spanclass="p">(</span><spanclass="s2">"2"</span><spanclass="p">)</span><spanclass="k">do</span><spanclass="o">|</span><spanclass="n">config</span><spanclass="o">|</span>
</code></pre></div></div><hr><footer><divclass="d-flex mt-2"><pclass="text-small text-grey-dk-000 mb-0"><ahref="https://github.com/vagrant-libvirt/vagrant-libvirt/tree/main/configuration.markdown"id="edit-this-page">Edit this page on GitHub</a></p></div></footer></div></div><divclass="search-overlay"></div></div></body></html>