Showing posts with label virtualisation. Show all posts
Showing posts with label virtualisation. Show all posts

Tuesday, 24 July 2012

Using virt-manager to manage KVM and QEMU instances

I've been using QEMU and KVM for quite a while now for general kernel testing, for example, sanity checking eCryptfs and Ceph.   It can be argued that the best kind of testing is performed on real hardware, however, there are times when it is much more convenient (and faster) to exercise kernel fixes on a virtual machine.

I used to use the command line incantations to run QEMU and KVM, but recently I've moved over to using virt-manager because it so much simpler to use and caters for most of my configuration needs.

Virt-manager provides a very usable GUI and allows one to create, manage, clone and destroy virtual machine instances with ease.

virt-manager view of virtual machines
Each virtual machine can be easy reconfigured in terms of CPU configuration (number and type of CPUs),  memory size, boot options, disk and CD-ROM selection, NIC selection, display server (VNC or Spice), sound device, serial port config, video hardware and USB and IDE controller config.  

One can add and remove additional hardware, such serial port, parallel ports, USB and PCI host devices, watchdog controllers and much more besides.

Configuring a virtual machine

..so reconfiguring a test to run on a single core CPU to multi-core is a simple case of shutting down the virtual machine, bumping up the number of CPUs and booting up again.

By default one can view the virtual machine's console via a VNC viewer in virt-manager and there is provision to scale the screen to the window size, set to full size or resize the virt-manager window to the screen size.  For ease of use, I generally just ssh into the virtual machines and ignore the console unless I can't get the kernel to boot.

virt-manager viewing a 64 bit Natty server (for eCryptfs testing)
Virt-manager is a great tool and well worth giving a spin. For more information on virt-manager visit virt-manager.org

Wednesday, 24 June 2009

Installing Jaunty UNR in VirtualBox

Sometimes it's useful to be able to run Ubuntu as a virtual machine inside VirtualBox for testing and debugging purposes. The problem with the basic version of VirtualBox is that it does not support installing from USB, which is a problem when faced with installing from USB images, such as Ubuntu Netbook Remix (UNR). To get around this, install UNR as follows:

If you've not already installed VirtualBox, you can install it using:

sudo apt-get install virtualbox-ose

Convert the USB bootable image into a bootable VirtualBox VDI image:

VBoxManage convertfromraw ubuntu-9.04-netbook-remix-i386.img ubuntu-9.04-netbook-remix-bootable-i386.vdi

Create an 8GB empty disc image to install this into:

VBoxManage createhd -filename ubuntu-9.04-netbook-remix-i386.vdi -size 8192 -register

Create a new VM using the ubuntu-9.04-netbook-remix-bootable-i386.vdi (at the Virtual Hard Disk dialogue box, select "Existing" and browse the filesystem to select the .vdi file). Once you have created the VM, add the ubuntu-9.04-netbook-remix-i386.vdi as a IDE primary slave drive. Then boot and install UNR to the IDE primary slave.

After the installation is complete remove the ubuntu-9.04-netbook-remix-bootable-i386.vdi
primary drive from your virtual machine and set ubuntu-9.04-netbook-remix-i386.vdi to be the primary IDE drive.

OK, so it's a little bit of messing around, but it does the trick.


Jaunty UNR installed in VirtualBox