Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import KVM XML to Qemu

If I qemu-system-x86_64 ~/Whonix-Gateway-11.0.0.3.0.qcow2 I can start the machine without networking, I see that there is an .xml file included in the directory

  <domain type='kvm'>
  <name>Debian</name>
  <description></description>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>2</vcpu>
  ....

How can I import it?

like image 415
M. Franklin Avatar asked Sep 02 '25 01:09

M. Franklin


1 Answers

That's not a "qemu" XML file; that's a file for importing the image into libvirt.

If you have a libvirt XML file, you can import it using the virsh define command:

virsh define /path/to/xmlfile.xml

This will define but not start the corresponding guest. You can start it using virsh start <name>, or use a tool like virt-manager. There is a virsh create command that will define and start the guest in a single command:

virsh create /path/to/xmlfile.xml

For these to work, of course, you need to have libvirtd running and you need to have appropriate permissions to access it. If you want to have functional networking you may need to modify the domain XML description to match your local environment (or you may not, if the XML assumes the standard libvirt default network and you have that configured on your system).

like image 102
larsks Avatar answered Sep 06 '25 06:09

larsks