I Do most of my research for various post on KVM Guest machine on my Ubuntu machine. But whenever i need to transfer Guest machine from one Host machine to another machine, i usually like to run machine from their dumpxml files. So its always be good practice to save machine dumpxml on same place Guest machine located. But in case you also like to start Guest machines without mentioning dumpxml file, we need to define xml file in Host machine. So in this post we would see HowTo define dumpxml of KVM Guest at Host machine.

SetUP

For this setup we are using Ubuntu 16.04.3 LTS (Long term stable) updated as of now in Oct 2017 as Host and CentOS7 Guest machine.

root@jarvis:~# uname -r
4.4.0-21-generic

root@jarvis:~# lsb_release -d
Description:	Ubuntu 16.04.3 LTS

root@jarvis:~# kvm --version
QEMU emulator version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.16), Copyright (c) 2003-2008 Fabrice Bellard

So Let’s start and see defined host on present Hosts machine.

root@jarvis:~# virsh list --all
 Id    Name                           State
----------------------------------------------------

Now we have one Guest machine in /data/vm_images/CentOS7.1/, we can start our Guest machine whole day from xml file(virsh create srv7.1.xml) but that doesn’t define Guest in Host KVM Guest list. This will only show Guest machine only when machine are in running state.

 

 

 

 

 

 

 

 

To make available Guest machine in “virst list –all” , we have to define Guest machine like below mentioned.

root@jarvis:~# virsh define /data/vm_images/CentOS7.1/srv7.1.xml 
Domain srv7.1 defined from /data/vm_images/CentOS7.1/srv7.1.xml

root@jarvis:~# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     srv7.1                         shut off

So we can see, now we have one Guest machine in “virsh list –all” and we don’t need to start machine through dumpxml file anymore.