The simplest way to describe a virtual machine is an isolated, copy of a machine running within a real machine. In terms of PCs and PC operating systems that would be an operating system running within an operating system. If you can not immediately grasp the implications of this technology, let me explain it yet another way. Imagine being able to run a full copy of a Windows operating system within the Linux operating system. Now you're seeing where this can go. In fact, taking advantage of virtual machines has a myriad of implications: Multiple virtual servers running on a single piece of hardware, running applications that require one operating system, but doing so from within a different environment, Sandbox testing, Development, the possibilities seem limitless.
Not five years ago, doing this required either the purchase of sometimes costly software. And even once you have purchased said software, sometimes it could be tricky to get running. Things have changed over the last few years. Now there are open source solutions that help to manage virtual machines, and these open source solutions are easy to use...very easy to use.¬†
One of those solutions is VirtualBox. VirtualBox is developed by Sun Microsystems and supports:
- OS X
- Windows XP and Vista
I mentioned earlier that VirtualBox is open source. That is true for one packaged edition of VirtualBox--VirtualBox OSE (Open Source Edition). That edition of the software is free and released under the GPL version 2. There is another version (simply VirtualBox) that is released under the Personal Use and Evaluation License (PUEL). You can download and use the non-open source edition for free. Or you can purchase licenses for two different levels:
- VirtualBox Enterprise Subscription: Roll out VirtualBox across your enterprise with global 24/7 support.
- VirtualBox OEM License: Allows you to redistribute VirtualBox components, build derivatives, and gives you access to source code.
But how do you manage this amazing technical feat? Easy. In this tutorial I am going to show you how to install VirtuaBox on Ubuntu 9.04 and then Install Windows XP inside of that VirtualBox installation.
Two Terms to Know
There are two terms you will need to understand before you move on. Those terms are Guest and Host. The Host is the operating system that VirtualBox is installed on. In the case of this tutorial that will be Ubuntu 9.04. The Guest is the operating system you will install within VirtualBox. In the case of this tutorial the guest will be Windows XP.¬†
Installing VirtualBox is simple. What you want to do is open up your Add/Remove utility (found at the bottom of the GNOME Applications menu). When that tool is open do a search for "virtualbox" (No quotes) and select the OSE entry for VirtualBox. NOTE: There are some features that are not present in the OSE edition that are in the closed source edition. These features are:
- Remote Display Protocol (RDP)
- USB support
- USB over RDP
- Serial ATA controller
With that in mind, let's continue on.
Click the Apply button to start the installation procedure. You will have to enter your user password for the installation to continue.¬†
Once VirtualBox is installed, you are almost ready for your first run. Before you do this, however, you will need to add your user to a couple of groups before you can continue. If you go the System menu and then to the Administration menu you will see the "Users and Groups" entry. Click on that to open up the Users Settings window. You will have to click the Unlock button and then enter your user password in order to actually take any action within this window. Here are the steps to take, in order to add your user to the correct group:
- Click on the Manage Groups button.
- Scroll down to the "vboxusers" group (no quotes).
- Select the vboxusers group.
- Click the Properties button.
- Click the checkbox associated with the user you want to add to the group.
- Click OK in the Group "vboxusers" Properties window.
- Click Close in the Groups Settings window.
- Click Close in the User Settings window.
That's it. Now you are ready to move on to your first run of VirtualBox
To start up VirtualBox look in the Applications menu and then the Accessories sub-menu. You will see the "VirtualBox OSE" entry there. Click on that and the First Run Wizard will start. The first screen of the First Run Wizard is nothing more than a welcome screen. You can click Next to start the real work. The first real setup you have to do is to select your installation media (see Figure 2). In this screen you will need to configure the following options:
The first is to select the media type which you will use to install your operating system. Most likely you will use the default (CD/DVD Rom Device). This just tells VirtualBox where to look for the installation media. For the purpose of this tutorial, we will choose CD/DVD-ROM Device.
The next step allows you to be specific with the location of the installation file. This will allow you to to specify either an installation file from you CD/DVD drive or from an image file you have already downloaded. Most likely, if you are installing Windows, you will be using your CD/DVD drive. For the purposes of this tutorial we will select Host Drive and, from the drop-down, select the specific drive to use for the installation.
The next screen to interact with is the summary screen. This screen will remind you of the choices made for VirtualBox. If you are happy with your choices, click Finish to continue on.
Creating a New Virtual Machine Guest
You are ready to create your first guest on your host operating system. After you have completed the first run wizard you will be in the main VirtualBox window. In this window you will see the "New" button. Click that to begin Virtual Machine wizard.
Like the First Run wizard, the first screen is the welcome screen. All you need to do is click Next to get on with the real work. The first screen (see Figure 3) will require you to give your new guest operating system a name and select the type of operating system you plan on installing. As you can see, in Figure 3, we are installing Windows XP. Once you have finished this click the Next button to move on.
The next screen only requires one configuration, the Base Memory size. The default is 192 Mb, which is the recommended minimum. What you configure here will depend greatly on what you plan on using the guest OS for. This will also be determined by the amount of RAM you have on your machine. You do not want to take up so much RAM that you deprive your host OS from what it needs to function.
Once you have configured this click Next. Your next step is to create the new Virtual Machine. What this means is you are creating a dedicated space on your hard drive for this guest operating system. In the next window you will need to click the New button to create a new Virtual Machine (VM) which will open up yet another wizard. The steps for this portion are as follows:
- Click Next at the Welcome screen.
- Select if you want to use dyamically expanding storage or a fixed-size storage. I suggest Dynamic as it will not immediately take up the full space you dedicate for the guest OS.¬†
- Give the VM a name in the Location area.
- Give the VM a size (this will depend upon how large your hard drive is and how much space you will need for your guest OS.)
- Click Next.
- Review the settings and click Finish.
You will now be back in the same screen you were prior to starting the VM Wizard, only now the information has been filled in for you. Now click Next to move on. You are now at the review screen for your VM. Check all of your settings and click Finish to complete the setup of your Virtual Machine. Once you have finished you will see your Virtual Machine listed in the main window (see Figure 4).
You are ready to install your Windows XP guest operating system. To do this follow these steps:
- Insert the Windows XP CD into the CD/DVD Drive.
- Select the Windows XP listing in the VirtualBox main window.
- Click the Start button.
What will happen now is you will go through a standard Windows XP installation. This should be no different than any other Windows XP installation you have ever done. The primary difference is it will be within its own window.
Once you have your guest OS installed there is one last step to take in order to really get the best experience from your guest OS.¬†
The Guest Additions packages gives you a lot of features you will want. Among these features:
- You no longer have to capture the mouse pointer. Normally you have to hit the right Ctrl key in order to get the mouse pointer out of the VM. With Guest Additions you no longer have to dot his.
- You can set your resolution to a much higher level.
- You can now copy and paste between guest and host.
- You can run Windows in seamless mode. This is an amazing feature. By running in seamless mode it will appear as if your windows applications are running in your Linux operating system (see Figure 5 for an example).
If you click on the Devices menu in the window of your guest OS you will see a Guest Additions entry. Click on that to install this very helpful package. When you click that you will get a warning message indicating that the Guest Additions CD image could not be found. Do not panic. Simply click Yes to download the image and then click Download to confirm the download. When the download is complete you will be prompted if you want to mount the newly downloaded image.¬† When you click Yes to mount the image the Sun xVM setup wizard will begin. This installation is very straight-forward, typical Windows application installation. You will have zero problems here.¬†
Once the installation is complete you will have to reboot your virtual machine (just a standard Windows reboot). Once the guest has rebooted you will now have the Guest additions installed.
As you can see in Figure 5, the seamless mode allows you to use your Windows applications as if they are running, seamlessly, in Linux. The only difference is you will see your Windows taskbar over your Linux desktop panel.¬†
To run in seamless mode¬† hit the right Ctrl key and the "l" key together. To switch back to window mode hit the same combination.
The benefits of using Virtual Machines are amazing. You and your IT department will enjoy a much higher flexibility as well as easier roll outs. And as an individual, you can enjoy many of those Windows applications you have to have, but use them in a much more reliable environment - Linux!