Listing of VM’s created before libvirt installation or started by any other VM management tool

kvm-virtualizationlibvirtvirshvirtual-machines

if my VM's are not created using virt-manager or are created using any other tool, then virsh system list command does not give them in the list of running VM's however they are running perfectly on my KVM server. Is there a way to list these VM's in my system list anyhow?

I have VM's managed by GKVM, AQEMU, libvirt etc. also some of the user start their VM's using the qemu command as follows:

kvm "image name" -m "memory". this starts the VM and allow them to work perfectly. but I am not able to list all these VM's using the virsh system list command.

adding the output of ps command:

# ps -ef |grep kvm
avahi      980     1  0 Nov02 ?        00:00:00 avahi-daemon: running [ubuntukvm.local]
root      1117     2  0 Nov02 ?        00:00:00 [kvm-irqfd-clean]
1000      1849     1  0 Nov02 ?        00:00:00 /usr/lib/gvfs//gvfs-fuse-daemon -f /home/ubuntu-kvm/.gvfs
1000     14364     1  0 Nov05 ?        00:00:42 gnome-terminal --login --geometry=80x24+10+10 -t ubuntukvm:4 (ubuntu-kvm) Desktop
115      23786     1  0 15:14 ?        00:00:08 /usr/bin/kvm -S -M pc-1.0 -enable-kvm -m 1024 -smp 1,sockets=1,cores=1,threads=1 -name **Ubuntu-guest-vm01** -uuid ed5a33c1-76fd-b67e-ff1b-f53a60681ec7 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/Ubuntu-guest-vm01.monitor,server,nowait -monchardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/dev/lvm_disk/Ubuntu-guest-vm01,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -netdev tap,fd=18,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:fa:4a:bd,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 127.0.0.1:2 -vga cirrus -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
root     23787     2  0 15:14 ?        00:00:00 [kvm-pit-wq]
root     31140 29549  0 17:05 pts/0    00:00:00 sudo kvm winxp-guest-vm00.qcow2 -m 1024
root     31141 31140 54 17:05 pts/0    00:00:05 **kvm winxp-guest-vm00.qcow2 -m 1024**
root     31142     2  0 17:05 ?        00:00:00 [kvm-pit-wq]
1000     31157 23873  0 17:05 pts/9    00:00:00 grep --color=auto kvm

here my vm name ubuntu-guest-vm01 is started by virtmanager, and vm named winxp-guest-vm00 is started by kvm command however both were created using the virtmanager. so my issue is if my user start this vm using the kvm or qemu command i do not get the argument list in ps also so not able to collect all the required details

Best Answer

Just list the processes, that's all KVM is after all ps -ef |grep kvm should do the trick, and you can parse the command line for details if you need to