Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using CentOS 5 with KVM.

I have downloaded this KVM applicance, and when unzipped it is just a .img file. No xml file supplied.

I can start the guest with

 /usr/libexec/qemu-kvm -hda /data/kvm/slash.img -m 512

and it works.

Now I would like to make a config file for the guest.

The problem is when I do

# virsh -c qemu:///system list
 Id Name                 State


I don't see the guest as expected.

Does anyone know what is wrong?

share|improve this question
up vote 2 down vote accepted

You can get an example of .xml file here:

You modify it according to your needs.
Here you can all formats about xml format:

About seeing all the virtual machines, try with

virsh list --all

So you can see all the installed virtual machines and not only those running.

share|improve this answer
Also make sure you're running virsh list as the same user that you're running the KVM guest process under. – nedm Jun 20 '10 at 2:29

you might need to run this with qemu+ssh://

share|improve this answer

You need to tell virsh about your KDE image.This is accomplished by either importing an existing XML file that's customized according to your needs or generating one

Method 1. Create and customize the XML: get a copy from somewhere else or download the one specified in the previous answer, and place it in in a temporary place. My case /home/user/centos.xml (my case centos.img, yours IMAGENAME.img); qcow or qcow2 will work as well

Import (create) it into virsh

virsh create /home/user/centos.xml

Once imported in libvirt with virsh in can be found in /etc/libvirsh/qemu/

Method 2. Generate a new XML by "installing" the existing image

virt-install --connect qemu:///system --name centos --ram 256 --disk path=/var/lib/libvirt/images/base-centos.img --bridge=virbr0 --vnc --vncport=5901 --accelerate --os-type=linux --cdrom /dev/cdrom 

where path= location of your image

stop force the previous command

virsh destroy centos

Look for cenots in virsh

virsh list --all

     Id Name                 State
  - centos               shut off

Start the new VM

[root@ libvirt]# virsh start centos
Domain centos started

[root@ libvirt]# virsh list 
 Id Name                 State
  1 centos               running
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.