This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature: Desktop Software

Getting started with Linux virtualization

By Federico Kereki on May 01, 2008 (9:00:00 AM)

Share    Print    Comments   

With all the Linux distributions available, trying out more than one can be tempting. By installing a virtual environment, you can run several operating systems on your machine, keeping them completely isolated from each other in their own sandboxes. Here's a look at how get started with three popular virtualization environments: VMware, VirtualBox, and QEMU.

In a virtual ecosystem, a host operating system runs one or more guest virtual machines in a simulated environment. Each guest believes it has all of the host's physical hardware at its disposal.

You cannot do much virtualization with a small, slow machine, but current-day multi-CPU computers, with 32- or 64-bit architectures and RAM capacity measured in gigabytes, can easily do the job. I used to run virtual machines on a Pentium III with 512KB of RAM, and while the performance was acceptable, it wasn't exactly astounding. I changed to a dual-core box with 4GB RAM, and now I notice no difference in speed and responsiveness between the host and the guest machines.

VMware

VMware allows you to run multiple x86 (or x86 64-bit) operating systems on a single box. According to VMware, VMware Workstation supports 19 versions of Windows and 26 versions of Linux, and can run as host on both systems. (VMware Fusion runs Windows on a Mac.) VMware is not open source software, but you can try it free for a month; after that, you must either license it (you can buy a license online) or switch to VMware Player, which is a no-cost version that lets you use stored virtual machines but doesn't let you modify them or create new ones.

Installation is easy. Register for an evaluation copy, download the software, and as root, run rpm -Uvh VMware-workstation-theVersionYouGot.rpm to install both the Workstation and Player programs. To set up the program, run, also as root, vmware-config.pl, which walks you through a series of questions and eventually builds the needed modules. Note that you need the headers appropriate to your kernel; as a rule of thumb, if you've installed everything needed to recompile your kernel, you'll have no problems with this installation.

To create a new virtual machine, start up the Workstation program and click on Create a New Virtual Machine to invoke a wizard for the rest of the configuration. You need to specify what family of operating system you will be installing; your choices include Windows, Linux, Solaris, Novell, MS-DOS, and a few more. You also need to specify the name you want to give your machine, the location for its files, and the size of the virtual disk drive for your new machine. Note that the virtual disk will become a file on your box, but the guest system will think it's a device on its own. Finally, you need to choose what kind of network access you need. Your choices are "bridged," which means your virtual machine will connect to your network as an independent box; "NAT," which means you'll share your host machine's IP address; "host only," which means you'll connect to an internal network in your server; or "no network." After this, just pop in an installation CD, start the virtual machine, and you'll be in business, doing a normal installation process.

The first time you run your new system, you'll probably want to install the VMware Tools package, which enhances the performance and management of the virtual machine. Navigate to VM -> Install VMware Tools, and a virtual CD will be mounted with an RPM package. Click on it to install it, and you'll get better graphics response times, support for shared folders (directories on your host that your guest can use), time synchronization between host and guest, and other features.

VirtualBox

VirtualBox is a virtualization program by innotek (which was acquired by Sun earlier this year) with functions similar to VMware's products. VirtualBox runs under Linux, Mac OS X, Windows, and Solaris, and it supports those same operating systems (plus FreeBSD and OpenBSD) as guest systems. The current version is 1.5.6, with an "upcoming new major version" seemingly in the works.

Originally available under a proprietary license (and free only for private, home use), VirtualBox Open Source Edition (OSE) was released in January 2007 under the GPL. A second version, which is free but not open source, is available only in binary form under the terms of the VirtualBox Personal Use and Evaluation License, which means that it's free for personal, academic, or evaluation use; otherwise, a license is required. The OSE version lacks some of the enterprise features in the closed source version.

I installed the OSE version directly from openSUSE's repositories; even if you want to get the latest possible version, it's usually easier to first install an older version automatically (so all needed dependencies are installed), thus paving the way for a simpler later update. Even after an automatic installation, you will have to do some command-line work on your own, and add all the users that will be allowed to use VirtualBox to the vboxusers group. You will also have to run (as root) /etc/init.d/vboxdrv setup to set up all the required services.

As with VMware, you create a new virtual machine with the help of a wizard. You specify the name of your guest, the operating system type, the RAM size you want it to use, and what disk image to use (you can create it if needed). Then you load the CD with your distribution and start the machine; you will get the installation screens, and eventually you will have a fully working new operating system.

With VirtualBox, you will also benefit if you load the VirtualBox Linux Additions. Go to Devices -> Install Guest Additions, and the proper package will be downloaded and appear as a mounted CD; execute VboxLinuxAdditions.run to finish the installation.

QEMU

QEMU is both a virtualization program and an emulator: it can run programs and operating systems written for a specific CPU on a different machine. When doing virtualization on x86-compatible processors, if you also install an accelerator (KQEMU) you will get a better performance. It is released under the GPL, but some parts fall under the LGPL or BSD licenses. QEMU runs under Linux, Windows, Mac OS X, and Solaris. The easiest way to get it is with your standard package manager; don't forget to include KQEMU.

Running QEMU usually requires a series of shell commands, but you're better off installing Qemulator, a graphical interface that's written in Python and is similar to those of VirtualBox and VMware. Installation is simple: just download the package, unpack it, and launch setup.py. After the installation is done (you will have to answer a few questions, mainly related to paths), you will be able to create or launch virtual machines by running qemulator.

If you've tried VMware or VirtualBox, you will feel right at home with the steps needed for creating a new machine. (A small quirk: if you decide to delete a virtual machine, you'll have to remove the hard disk space on your own; Qemulator doesn't do that.) You run a machine by clicking the green play button on the upper right corner. No special package or tools exist for graphics and sound performance, so you might notice the machine runs more slowly with multimedia apps.

Conclusion

If you want to explore virtualization, VMware might be the strongest program, but its licensing mode might hamper your experiments. On the other hand, QEMU is fully free, but noticeably slower than the other two programs. VirtualBox strikes a compromise, with its pair of licensing models and performance that matches or surpasses that of VMware.

Federico Kereki is an Uruguayan systems engineer with more than 20 years' experience developing systems, doing consulting work, and teaching at universities.

Share    Print    Comments   

Comments

on Getting started with Linux virtualization

Note: Comments are owned by the poster. We are not responsible for their content.

Getting started with Linux virtualization

Posted by: Anonymous [ip: 78.94.204.12] on May 01, 2008 10:48 AM
> a Pentium III with 512KB of RAM

Probably should have been 512 MB. Nice Article, thanks!

#

Re: Getting started with Linux virtualization

Posted by: Anonymous [ip: 10.19.61.145] on May 01, 2008 08:59 PM
ditto

#

Getting started with Linux virtualization

Posted by: Anonymous [ip: 148.87.1.172] on May 01, 2008 11:59 AM
Xen in the latest distribution releases is also a virtualization alternative that is now easy to use. Check CentOS 5, SuSE, and derivatives.

#

Re: Getting started with Linux virtualization

Posted by: Anonymous [ip: 198.97.41.12] on May 05, 2008 08:43 PM
The problem with using Xen is that you need a CPU that supports virtualization technology.

#

Getting started with Linux virtualization

Posted by: Anonymous [ip: 81.100.216.178] on May 01, 2008 12:35 PM
the message of this article somehow eludes me... where's a comparison? or at least a description? this article is neither a review, nor an advert or comparison. What is it?

#

Getting started with Linux virtualization

Posted by: Anonymous [ip: 72.93.199.98] on May 01, 2008 12:53 PM
This is a particularly poor article. If you want to do provide a useful look at virtualization on Linux the leading contenders are KVM (the only hypervisor merged in upstream Linux kernel), and Xen (shipped in every major Enterprise distribution, and many community distributions). The virt-manager application (http://virt-manager.org/) provides a comprehensive desktop management UI working with both KVM and Xen equivalent to VMWare Desktop/Server.

#

Re: Getting started with Linux virtualization

Posted by: Anonymous [ip: 190.135.4.141] on May 01, 2008 05:04 PM
To be fair, those options and more were mentioned in the box, along with Wine.

#

Getting started with Linux virtualization

Posted by: Anonymous [ip: 71.38.7.158] on May 01, 2008 01:17 PM
I've used VirtualBox for almost 2 years now on Ubuntu & Gentoo. Works GREAT. Sun just purchased them, too. I had many issues with VMWare clock ticks working correctly, so my virtual would hyper warp all day long (sometimes many hours in just 30 minutes or so) and could never solve the issue, but supposedly you can.

#

Re: Getting started with Linux virtualization

Posted by: Anonymous [ip: 204.153.155.151] on May 01, 2008 05:23 PM
The solution is to install the VMWare tools and in the preferences select the checkbox to sync the guest time to the host time.

#

Getting started with Linux virtualization

Posted by: Anonymous [ip: 68.90.69.174] on May 01, 2008 03:38 PM
VirtualBox is far superior in performance than VMWare, but for correctness' sake, I'll point out that there is a free version of VMWare Server, just not the Workstation or ESX versions. You can get it here: http://www.vmware.com/download/server/

That said, VirtualBox is light-years better on almost every front. Seamless windowing, speed, ease of installation and use, etc. Sadly, they don't have a direct hardware access version (like ESX), but with Sun purchasing Innotek, anything can happen.

#

Re: Getting started with Linux virtualization

Posted by: Anonymous [ip: 204.153.155.151] on May 01, 2008 05:21 PM
My biggest beef with VirtualBox, like you said, is the lack of direct access to the hardware. Which means that there is no real 3D support. From reading on the forums, it seems like the crew that writes it feels that either it is not important enough to try to write a video card emulator, or are incapable of doing so. VMware gets around this by having a video card emulator and 3D support even on the free version.

On the other hand, my biggest beef with VMWare Server, the free version, is that it only supports two USB ports, no matter how many that you actually have installed on your workstation. This was a "show stopper" limitation for me at an organization I worked for. I had virtualized several license servers for mechanical and electronic engineering applications (OrCAD, PCAD, SolidWorks, etc.) and only supporting two USB ports available was a problem considering that three of the five applications required "keys" in the form of USB dongles in order for the license server to function.

#

Getting started with Linux virtualization

Posted by: Anonymous [ip: 201.51.235.174] on May 01, 2008 04:15 PM
The only thing that I find complicated about VirtualBox is setting up the network. On VMWare it worked out of the box, but on VirtualBox i must issu a few cryptic commands so that it can use the host's connection. But I love it anyway, and since i run Windows virtualized, I prefer not to give it any access to the internet anyway.

#

Re: Getting started with Linux virtualization

Posted by: Anonymous [ip: 190.135.5.229] on May 02, 2008 01:48 AM
But isn't Vmware Server more like Xen? AFAIK you couldnt use it as easily as Wmware Workstation, or could you?

#

Getting started with Linux virtualization

Posted by: Anonymous [ip: 67.88.249.34] on May 02, 2008 02:00 AM
We have been using the free vmware server at work for close to 2 years and I use the virtualbox at home. While Vmware works good enough, they due strip the free version. We are in that awkward size where the esx is way out of our budget but the free server is weak. I have had enough problems to have me scampering for other solutions. For my workstion I have been virtualbox for probably a year or a bit over and I have nothing but good things to say. It is not running servers like VMWARE and I only run one system at a time on it. Overall I like it much better and I would say I like it more than vmware server but I have also not stressed tested as much.

Since most of my virt server are linux I will probably switch to a virtualization at the OS level. I would love to see an article on openVz and linux vserver.

#

VirtualBox networking

Posted by: Anonymous [ip: 118.90.8.20] on May 02, 2008 02:43 AM
For those having difficulty, I have left some instructions on my blog at combatwombat.7doves.com
This covers Guest to Host communications, and even using the Guest as a Terminal Server.

#

Getting started with Linux virtualization

Posted by: murat on May 04, 2008 01:16 PM
But isn't Vmware Server more like Xen? AFAIK you couldnt use it as easily as Wmware Workstation, or could you?


[Modified by: Joe Barr on May 04, 2008 01:23 PM]

#

Re: Getting started with Linux virtualization

Posted by: Anonymous [ip: 204.153.155.151] on May 05, 2008 04:30 PM
I am not sure what you're getting at. VMWare server has a GUI management console just the same way that VMWare workstation does.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya