Skip to content

Instantly share code, notes, and snippets.

@kitschysynq
Created April 10, 2017 13:45
Show Gist options
  • Save kitschysynq/867caebec581cee4c44c764b4dd2bde7 to your computer and use it in GitHub Desktop.
Save kitschysynq/867caebec581cee4c44c764b4dd2bde7 to your computer and use it in GitHub Desktop.
List running qemu instances with nicely formatted output
ps -ef | awk -e '/qemu/ && !/awk/' | sed -e 's/[^/]*//' -e 's/ -/\n\t-/g'
@kitschysynq
Copy link
Author

Example output:

thor:~$ ps -ef | awk -e '/qemu/ && !/awk/' | sed -e 's/[^/]*//' -e 's/ -/\n\t-/g'
/var/lib/libvirt/qemu/domain-minimal/monitor.sock,server,nowait
        -mon chardev=charmonitor,id=monitor,mode=control
        -rtc base=utc
        -no-shutdown
        -boot strict=on
        -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
        -drive file=/var/lib/libvirt/images/minimal.img,format=raw,if=none,id=drive-virtio-disk0
        -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
        -drive if=none,id=drive-ide0-1-0,readonly=on
        -device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
        -netdev tap,fd=26,id=hostnet0,vhost=on,vhostfd=28
        -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:aa:2d:49,bus=pci.0,addr=0x3
        -chardev pty,id=charserial0
        -device isa-serial,chardev=charserial0,id=serial0
        -vnc 127.0.0.1:0
        -device cirrus-vga,id=video0,bus=pci.0,addr=0x2
        -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=0x6
        -msg timestamp=on
thor:~$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment