Virtualization with KVM
All for One
Qemu supports many more parameters and commands both at the command line and in the monitoring tool, most of which are interesting if you're involved in hosting servers. For example, you can suppress screen output from the virtual machines (»
parameter), thus restricting the guest systems to text-only output; you can even reroute the output using VNC.
Multiple virtual machines can be grouped on a separate virtual network, which is really useful to test a new infrastructure. All of the functions referred to in this article are also explained in the extremely long manual on the Qemu website . If the command line is too complicated for your liking, you can easily load a graphical front end like AQemu (see the "Push the Mouse" box).
Push the Mouse
The Qt AQemu program is an alternative to Virtmanager. Because the repositories of the major distributions all offer obsolete versions, you should download the latest version off the project website or from SourceForge . You will find both deb packages and .tar.gz archives with a prebuilt AQemu. If in doubt, you can use one of the variants with static in its name and unpack the archive in the root directory:
sudo tar xvfj aqemu-<version>-bin- static-qt-linux-<bit>.tar.bz2 -C /
When AQemu is first launched (by typing aqemu), the First Start Wizard pops up to ask for a couple of basic settings. Press Next to confirm English as your choice of language. Then, in the second window, check Use Device Manager and click Search in the third. The list should now container the current Qemu and KVM versions. Otherwise, you will need to Set Versions Manually.
The main window that then appears looks very much like VirtualBox (Figure 7). In the left-hand column, AQemu lists all your virtual machines, while the tabs on the right show their virtual hardware. To create a new machine, click the green plus sign and assign a name. Then, ensure that the machine is selected in the list and check the tabs from left to right. In the General tab, the Emulator Type must be set to KVM; otherwise, the virtual machine will run at a snail's pace.
The boot order is set in Boot Priority; you can easily set the RAM size using the slider. The value next to Free memory shows you the physical limit. To avoid forcing the host systems to its knees, you should never assign the full amount of physical memory. If the guest system is having trouble with graphics, you can also replace the Video Card.
Then move on to the Device Manager tab, where you can click the hard disk icon and then Create New to create a new image. In the window that then appears, type the file name, set the Size, and click Create. After returning to the main window, you can click the CD icon to add a virtual CD-ROM drive. To do so, either type the device name of the physical CD drive, or the filename of an ISO image, in the box.
After completing the changes, press Apply at the bottom of the screen and then select VM | Start in the menu to launch the virtual machine. If the operating system doesn't want to start, you can try a couple of other KVM functions in the Other tab below KVM Options. You can also disable ACPI power management in Advanced.@KE:
- KVM project: http://www.linux-kvm.org
- Qemu: http://www.qemu.org/
- List of processors with Intel VT technology: http://ark.intel.com/VTList.aspx
- Qemu documentation: http://wiki.qemu.org/download/qemu-doc.html
- KVM FAQ: http://www.linux-kvm.org/page/FAQ
- KVM mailing list, forum and IRC: http://www.linux-kvm.org/page/Lists%2C_IRC
- AQemu: http://sourceforge.net/projects/aqemu/