O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

The following steps outline the process of listing, starting, and stopping KVM instances using the virsh command:

  1. List all instances in all states:
root@kvm:~# virsh list --all Id Name State---------------------------------------------------- - kvm1 shut offroot@kvm:~#
  1. Start the newly defined instance and verify its status:
root@kvm:~# virsh start kvm1Domain kvm1 startedroot@kvm:~#root@kvm:~# virsh list --all Id Name State---------------------------------------------------- 1 kvm1 runningroot@kvm:~#
  1. Examine the running process for the virtual machine:
root@kvm:~# pgrep -lfa qemu1686 /usr/bin/qemu-system-x86_64 -name kvm1 -S -machine pc-i440fx-trusty,accel=kvm,usb=off -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required