How to list all virtual machines created using qemu-system-x86_64?
I am using qemu-system-x86_64
to boot virtual machines on kvm running on Ubuntu 12.04 64-bit desktop. I have a few VM's that are currently running. I want to get the list of all VM's booted using qemu-system-x86_64
on this host machine, how do I get this list?
Specifications:
qemu-system-x86_64 version 1.0
linux 3.2.0-60-generic
P.S.: Just as a side note, I am aware of virsh -c qemu:///system list
which would list all VMs booted using virsh. However, this does not seem to give the list of VMs booted using qemu-system-x86_64
, it would be great if virsh command could list the VMs booted using qemu-system-x86_64
.
Each VM started with qemu-system-x86_64 corresponds to a process on the host machine. This means that a list of qemu-system-x86_64 processes corresponds to the list of VMs that are currently running on the host.
ps -ef | grep qemu-system-x86_64
This will list all the qemu-system-x86_64 processes, their pids and the parameters used to start the VM.
Here is a solution for some more advanced nice view (see source below):
This one shows all wemu-systems, not only the x86_64 ones.
Cutton Eye@QEMU:~$ ps -ef | awk -e '/qemu/ && !/awk/' | sed -e 's/[^/]*//' -e 's/ -/\n\t-/g'
/18 00:00:17 qemu-system-x86_64
-enable-kvm
-hda MyDrive.img
-m 1G
-…
Sean Swehla has created this awesome regex