Practical Technology

for practical people.

VirtualBox: The best virtualization program you’ve never heard of

Quick, name some virtualization programs that run on Linux.

Time’s up.

If you’re like most people, you probably named VMware or Xen first. Many of you probably know of one or more of the following: Parallels, QEMU, KVM, Virtuozzo and OpenVZ. However, few of you probably know about VirtualBox. And chances are if you know about VirtualBox 1.502, you’re already running it because it manages the trifecta of being good, free and, sort of, open source.

Sort of? Here’s how it works. InnoTek, a software company in Stuttgart, Germany, has released both a proprietary and a GPLv2 open-source version of the program. The VirtualBox OSE (open-source edition) has a subset of the features of the proprietary version.

VirtualBox OSE is not crippleware. It’s as full-powered a virtualization program as you’ll find today. What it’s missing are additional features, not basic functionality. You can also use the proprietary version, without charge for personal and educational use and to evaluate it for possible business purchase.

The free, but proprietary, edition gives you a built-in RDP (Remote Desktop Protocol) server and USB port support. It also offers, to the best of my knowledge, the unique ability to use RDP to access remote USB devices from a local VM (virtual machine) and use local USB devices on a remote VM. It also supports the use of iSCSI network drives for use as virtual hard drives.

VirtualBox works on any PC with an x86 architecture. It also supports Intel’s VT-x and AMD’s AMD-V recently introduced hardware virtualization components. It does not, though, support either one by default. You must manually turn it on via the program’s control center.

While VirtualBox itself is lean—it will only take up 30MB of room on your hard drive—like any virtualization program, to use it successfully you’ll need multiple gigabytes of disk for the virtualized operating system and its files. In addition, you’ll need enough RAM for your base operating system and every VM instance. For example, to run Linux as a host with XP as a guest VM, you’d need at least a gigabyte of RAM. For Vista as a guest, you’ll need at least 2GB and so on.

The company claims that VirtualBox can run as a host on 32-bit Windows, Linux and Mac OS X Tiger. The developers are currently working, with some success, on supporting 64-bit operating system hosts.

VirtualBox supports all versions of Windows from Windows 98 on up as guest VMs. It also supports OpenBSD, OS/2 and some versions of Solaris. Generally speaking, all 2.4 and 2.6 Linux kernels work, although the company recommends 2.6.13 or above for better performance. There is one exception, though. Linuxes that use Linux kernels 2.6.18 to 2.6.18.2 contain a race condition that can cause VM boot. Not sure what kernel you’re using? Open up a terminal window and run the following command:

uname –r

And that will show you which Linux kernel you’re running.

A race condition is when the operating system attempts to perform two or more operations at the same time that actually must be done one after another to work. Some of the most common Linuxes with this problem are an unmodified version of the Ubuntu 6.06 Server, any version of Ubuntu and openSUSE 10.2. For a complete list of supported guest operating systems, and notes, go to VirtualBox’s Guest OS page.

To put VirtualBox through its paces, I decided to try it on my newest lab PC: a Gateway GT5622. This computer uses a 1.80GHz Intel Pentium Dual-Core E2160 processor. It also, ideally for a machine that will be used for virtualization, comes with 3GB of DDR2 SDRAM (double-data-rate two synchronous dynamic random access memory), a 400GB SATA II (Serial Advanced Technology Attachment) hard drive and a DVD R/W drive. For graphics, it uses the inexpensive Intel Graphics Media Accelerator 950, which can pull up to 224MB of RAM from main memory to use as shared video memory. Another point in this system’s favor, although I did not use it for these tests, is that it’s very easy to overclock for higher performance.

On this system, I quickly trashed the preinstalled copy of Vista Home Premium, replacing it with openSUSE 10.3. Unlike 10.2, openSUSE 10.3, which uses the 2.6.22.5 Linux kernel, doesn’t have the race problem that plagued openSUSE 10.2 users trying to run VirtualBox.

I then installed VirtualBox using openSUSE’s built-in installation tools: YaST and program repositories. These install the OSE edition. As is usually the case with YaST installation, this is a simple matter of clicking the program name on the directory and tinkering with something else while YaST automatically downloads and installs the software.

You can also download the free proprietary version directly from the VirtualBox download site. InnoTek offers compiled versions of VirtualBox for modern versions of Debian, Fedora, openSUSE, Mandriva, PCLinuxOS, Red Hat and Xandros. The OSE version can be downloaded as a tarball—a compressed archive of the source code files—or checked out of the Subversion revision control system. If you elect to install the OSE version, you’ll need to know the basics of installing Linux software manually.

Once in place, which took about 10 minutes from start to finish including the download time over my 1.5M-bps DSL, I used YaST again to make my personal account a member of the new vboxusers group. Once installed and my account was ready to go, I decided to give VirtualBox a challenge: Vista Ultimate.

You need to understand a bit about how VirtualBox does its virtualization magic. VirtualBox is a paravirtualization virtual program. Paravirtualization is a $10 word that means it gives the VM access to some system devices with virtual devices.

In the case of VirtualBox, the program uses a virtual AMD PCNET family Ethernet card for the guest operating system’s networking needs regardless of what you actually have installed in your PC. VirtualBox, and the other paravirtualization virtualization programs, takes this approach so that it uses up fewer system resources.

Vista, as it happens, however, doesn’t support this device. Yes, I know Vista was supposed to be better by now with its device support, but it’s not.

So, for Vista, but not the other versions of Windows, you’ll need to manually install the AMD NIC (network interface card) driver. To do this, open up a terminal window, log in as the root user and then run the following commands:

wget http://www.amd.com/us-en/assets/content_type/utilities/V4.51.zip
unzip V4.51.zip -d driver
mkisofs -o driver.iso -R -J driver

Log out, close up the terminal, and you’re now ready to install Vista.

You do this by running the VirtualBox program. This uses a graphical, wizard-based system, and it’s about as easy as falling off a rock. You hit the New button to start installing a new operating system, and you’ll quickly arrive at a screen asking you to name your new virtual machine. I went for the “exciting” name “Vista” for my Vista VM. The same screen asks you to pick your operating system guest.

After that, you’re asked how much memory to give it. Microsoft tells me I can run Vista with only 512MB of RAM. Yeah. Right. I gave it 1.5GB of RAM. That’s enough for Vista to work, but that’s about all I’ll say for it.

Next, you’ll need to decide if you’re going to create a new virtual drive for your VM or, if your system is already set for dual-boot, whether you’ll be using your existing Windows partition.

This is a tricky operation. There’s a good introductory guide to the topic on how to use pre-existing Windows with VirtualBox on Linux, but I’m still not happy with the results I obtained on another system, so I’ll leave that for another story on another day. I will say, though, even at this point, it’s much easier to do this with VirtualBox than to use VMware to pull off the same trick.

Now, you’ll need to pick how large your virtual disk should be. The default is to make it a dynamically expanding disk. Unless you’re very tight on disk space, this is the option you should take. Go ahead and create your virtual drive.

You’re now ready to install Vista. To do this, just pop in your installation disc. VirtualBox should find it and start up the installation. If it doesn’t, go to the settings for your new VM and use the CD/DVD-ROM option to mount the drive. Then, hit the Start button, and soon you’ll be seeing the usual installation routine starting up in a window on your Linux system.

Follow the usual instructions, and twiddle your fingers as Vista takes forever—aka about an hour—to install in its new VM home. This, by the way, is about the usual amount of time Vista Ultimate takes to install on a system.

Eventually, Ultimate was up and running, except, of course, it couldn’t talk to the network. So once more I went to the VirtualBox setting pane. This time I mounted driver.iso, which I had created earlier, as a CD. I then used the usual Windows installation routine to install my “new” network driver.

A few seconds later, I was running openSUSE 10.3 and Vista Ultimate at the same time on the same machine. It was kind of neat, I have to say.

Next, I installed VirtualBox’s Guest Additions. This is a collection of programs that make using two operating systems together easier. To do this, the easiest way is to use the Devices menu on the VirtualBox window, which frames the running VM. This will mount, and download if needed, the Guest Additions program iso file.

Once mounted, it should run automatically the next time you boot your VM. If it doesn’t, double check that your VM has the ISO loaded as a disk. If after that it still isn’t running, double-click the “drive’s” in Windows My Computer and it will run. After that, reboot and you’re done.

Once installed in Vista, you’ll find it was worth using for one feature alone: Shared Folders. With this, both Linux and Windows can use the same directories for sharing files. This makes life much easier. It also provides mouse pointer integration, improved video support and time synchronization, and can automate Windows log-ons.

The one bad thing about this is that it’s not open source. It’s part of the free, but proprietary package. For me, the convenience was worth it.

Once this was all done, I ran them both for several weeks, and they worked well together. I was able to trade files back and forth between Vista and openSUSE without any fuss or muss.

Vista’s performance was on the poor side, but then, it hadn’t been any great shakes on the machine when it was the only operating system on it. Because of this, I can certainly say with authority that VirtualBox will enable you to run Vista on openSUSE without a hitch. VirtualBox also, as a quick Google search will show, runs quite well on Ubuntu.

For practical purposes, I still believe that Vista is pretty worthless and that if you’re going to run Windows at all you’re better off with XP. Make that much better off.

That being the case, I zapped Vista Ultimate and replaced it with XP SP2. Today, I running openSUSE for 95 percent of my work, and for those remaining 5 percent that I need a Windows application I use XP SP2 under VirtualBox.

How well is it working for me? In the past, I’ve always kept at least one XP system around as a production desktop, in addition to the test systems where everything in the Windows family from NT to Vista Ultimate are available. I’ve now decided that between the latest version of CrossOver Linux and VirtualBox 1.52, I don’t need native XP anymore.

From here on out, my work PCs with less than a gigabyte of RAM will be running CrossOver Linux on top of Linux and the one with two or more gigabytes will be running VirtualBox. It’s that good. It’s that easy.

Comments are closed.