Understanding Hardware-Assisted Virtualization

Setting up a new Virtual Machine

To setup a new VM, you must first create a virtual disk. Use a simple command, such as:

qemu-img create -f qcow2 ubuntu10.10.img 8G

This command creates a dynamically expanding 8GB disk named ubuntu10.10.img. The disk image is very small but will expand on installation of the guest operating system to a maximum size of 8GB. Boot your system using the following command:

kvm -hda ubuntu10.10.img -cdrom /dev/cdrom -m 512 -boot d &

If everything works correctly, you'll see a QEMU instance booted up onto the Ubuntu installation CD.

If your system does not fully support virtualization, you'll receive a message similar to the following:

 open /dev/kvm: No such file or directoryCould not initialize KVM, will disable KVM supportUbuntu does not support running KVM without hardware acceleration. Sorry.[1]+  Exit 1                  kvm -hda ubuntu10.10.img -cdrom /dev/cdrom -m 512 -boot d

If you're sure your hardware does fully support virtualization but it fails at this point, you'll have to restart the system, enter the BIOS setup, and change the virtualization-related settings. You should also update your system's BIOS to the latest version to enable any missing options. Remember that your hardware must meet all four hardware requirements detailed above.

The KVM hypervisor is written to use hardware-assisted virtualization and cannot run without it.

Under the Hood

KVM uses a device node, /dev/kvm, created and managed by a loadable kernel module based on your system's CPU architecture (kvm-intel.ko or kvm-amd.ko). QEMU supports 32-bit and 64-bit systems based on various architectures including x86, SPARC, PowerPC, ARM, Motorola, and MIPS. This emulation allows you to install unmodified operating systems into virtual machines using underlying x86 architecture.

Related content

  • Virtualization with KVM
    KVM continues to gain popularity in the world of Linux – so much so, that it has become Red Hat and Ubuntu's preferred virtualization solution. In contrast to Xen, setting up KVM involves just a couple of steps, and the guest operating systems can run without special patches.
  • Container and hardware e-virtualization under one roof
    The Proxmox distribution specializes in virtualization, letting you deploy and manage virtual servers with OpenVZ and KVM at the same time.
  • Virsh Libvert Tool

    With the command-line tool virsh, a part of the libvirt library, you can query virtual machines to discover their state of health, launch or shut down virtual machines, and perform other tasks – all of which can be conveniently scripted.

  • Live snapshots with Virtual Machine Manager
    In the scope of developing Fedora 20, the live snapshot function, which has long been supported by libvirt, was integrated with the graphical front end. If you prefer to avoid command-line acrobatics à la Virsh, you can now freeze your virtual KVM and Xen machines in VMM at the press of a button.
  • Setting up an OpenNebula Cloud
    The OpenNebula cloud middleware system is one of the easiest private clouds in the sky. We'll show you how to get started.
comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=