Meeting #8 (Virtual Machines)

As you learned from the PowerPoint, Virtual Machines are little self-contained, mini computers than you can run. They emulate all parts of a computer, for example the BIOS, and let you tinker with different aspects of a computer without much risk.

QEMU/KVM is a fast and featureful hypervisor. We will use it to run Windows 2000. Log on to the Linux Server. If you have your own laptop running Linux, feel free to install QEMU and KVM and run the VM yourself. You’ll need you source your own OS ISO. Non-Linux users can use VirtualBox, but that is out of the scope of this post.

First we need to create a new virtual hard disk. Run this command:

qemu-img create -f qcow2 my_hdd.qcow2 4G

What just happened? We created a new virtual hard drive called my_hdd.qcow2, with a size of 4 gigabytes. The “-f” operator specified the format, in this case qcow2, a virtual hdd format for QEMU.

Now, let’s start our VM! Run this command:

qemu-system-i386 -enable-kvm -m 512M -vga cirrus -hda my_hdd.qcow2 -net nic,model=rtl8139 -net user -usb -soundhw sb16 -localtime -cdrom /public/EN_WIN2000_PRO_SP4.ISO

Take a deep breath, let’s talk about what this command does.

  • qemu-system-i386: This is the command to run QEMU
  • “-enable-kvm”: this argument enables KVM (for a faster VM)
  • “-m 512M”: Allocates 512 Megabytes of RAM for the virtual machines (please don’t changes this, we have to share!)
  • “-vga cirrus”: attach an emulated Cirrus graphics card.
  • “-hda my_hda.qcow2”: attach your virtual hard drive
  • “-net nic,model=rtl8139 -net user”: attach an emulated rtl8139 network card
  • “-usb”: emulate a USB bus

Published by

Computer Club Executives

The account of the Computer Club Executives