Search

3.3. Domain XML Configuration

download PDF
The host-based configuration of each KVM guest virtual machine (also referred to as a domain) is stored in the guest's XML configuration (or domain XML). This includes the settings for virtual hardware, boot options, resource allocation, network interfaces, and more. Using an application or utility that persistently modifies a guest property, such as virsh setmem, writes this change into the guest's XML configuration, which the hypervisor then reads when booting the guest and modifies the virtual machine accordingly.
To display the XML configuration of a specific guest, use the virsh dumpxml guestname command.
To edit the XML configuration of a guest, use one of the following:
  • The virsh commands - Persistent changes made to a guest virtual machine using virsh commands are recorded in the domain XML.
  • The virt-xml command - This command configures the domain XML file of a specified guest according to the provided options.
  • The Virtual Machine Manager - Changes made to a guest virtual machine in the Virtual Machine Manager are recorded in the domain XML.

Note

For the rare cases in which the domain XML files must be edited directly, use the virsh edit guestname. This command opens the domain XML configuration of the specified guest in the text editor determined by root's bash configuration, by default vi.
To change the editor for virsh edit, set or modify the EDITOR variable in the .bashrc file of the intended user. For example, for the root user, this file is located in the /root/ directory.
For the modifications performed using virsh edit to take effect, save the edited XML configuration and restart the guest.

Warning

Do not edit the XML configuration of a guest by opening it as a file in a text editor, for example by using gedit /etc/libvirt/qemu/guestname.xml. Changes made this way do not take effect and are automatically overwritten.
For detailed information on domain XML configuration files, see the Virtualization Deployment and Administration Guide.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.