Customizing a KVM Virtual Machine¶
If you have found a situation where a given setting needs to be edited, but it is not possible to do so from the CLI or Cockpit GUI, you can edit the XML configuration file in one of the two ways described below.
Perform the following steps to edit your XML KVM virtual machine configuration using the Virtual Machine Manager GUI.
-
Open the Virtual Machine Manager either from the Application Launcher or by running the
virt-managercommand in your CLI. A new window will open. -
In the top menu of the Virtual Machine Manager window, click Edit > Preferences, then select the checkbox Enable XML editing.
-
Click Close.
-
Open the virtual machine that you wish to edit by selecting the VM and clicking the Open button. A new window will open.
-
Click the light bulb icon (Show virtual hardware details). Then, in the Overview section, click the XML tab. You can now edit the XML file.
-
After you have made the necessary changes, click Apply.
-
Once the XML file is saved, the changed settings will be shown in the Virtual Machine Manager GUI. However, you must reboot the virtual machine for the changes to take effect.
Warning
Do not attempt to edit the XML configuration file of your virtual machine directly, run the commands specified below instead.
By default, the Vim editor will be used if you run the virsh edit command to edit the XML file.
To use a different editor, you must define it as EDITOR. For example, to use the nano editor, run:
sudo EDITOR=/usr/bin/nano virsh edit vm-name After you have edited the XML file, you must reboot the virtual machine for the changes to take effect.