SergeHallyn_libvirtnest

Sometimes to reproduce a bug or verify a fix to libvirt, you want to just be able to start a qemu VM under KVM, not really caring what it does. These instructions will get you there, assuming you are on a standard Ubuntu ec2 image, as user ubuntu with libvirt and qemu installed.

This will attach to a bridge called br0. Change that name if you need to.

qemu-img create cdboot.img 1G
  • Get a tiny bootable iso:

wget -O mini.iso http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/mini.iso

  • Define the vm:

virsh define cdboot.xml
  • Now the vm should be able to start

virsh start cdboot
virsh list
  # this should show cdboot running.  you can connect probably as 'gvncviewer :0'
virsh destroy cdboot
  • To make this vm autostart,

virsh autostart cdboot

SergeHallyn_libvirtnest (last edited 2012-07-16 14:34:50 by serge-hallyn)