Linux and the virtual Windows XP machine

Slashdot it! Delicious Share on Facebook Tweet! Digg!
SergeyNivens, @123rf.com

SergeyNivens, @123rf.com

Virtual Setup

We show you how to use VirtualBox to set up a Windows XP virtual machine on your existing Linux system.

Your Linux laptop can do a lot of things, but it can't fully emulate Windows nor can it run many essential Windows programs. If you find yourself needing to run Windows applications, especially Windows legacy applications on Windows XP, there's a solution: virtualization.

Running Windows XP in a virtual machine on your Linux laptop is a better solution than either reimaging your Linux system with XP or attempting the precarious task of setting up a Linux/Windows XP dual-boot system next to an existing Linux installation. However, if your system has Windows XP installed on it, you can more easily set up a dual-boot Linux/Windows XP.

This article describes how to set up a Windows XP virtual machine (VM) on your existing Linux system. Elsewhere in this issue, I show to set up a dual-boot Linux/Windows XP system that has Windows XP already installed.

For this article, I use Ubuntu 14.04 for the existing Linux system, and I use Windows XP SP3 for the Windows existing system and the Windows VM. For the virtualization application, I use VirtualBox because it is easy to install, and it's available for Windows, Mac OS X, as well as the various Linux distributions.

Adding a Windows XP VM to a Linux System

You can download and install VirtualBox [1] or, if your distribution has a prebuilt package, you can install directly from the command line. Open a terminal window and refer to Figure 1 to install VirtualBox.

Figure 1: Installing VirtualBox via the command line on Ubuntu Linux.

After installation completes, launch VirtualBox by searching for it in your Unity menu or at the command line with:

$ virtualbox &

Click New to start the Create Virtual Machine interactive dialog. In the first dialog, you need to enter the name of your new virtual machine, select Windows XP from the Type drop-down menu, select Windows XP (32-bit) or Windows XP (64-bit) for the version, and then click Next to continue.

You will also need to allocate some of your host system's RAM (memory) to the VM. You can use the suggested number; in my case, for a 32-bit Windows XP VM, the recommended RAM is 192MB, but I increased that to a more realistic 512MB. Click Next to continue.

Next, you'll be prompted to create a new virtual hard drive into which your virtual machine will reside. From your host system's perspective, the virtual hard drive is a single file or set of files that to the virtual machine appears to be a physical disk with cylinders and tracks. Select Create a virtual hard drive now and click Create to continue.

The "Hard drive file type" screen provides you with several choices (see Figure 2). If this VM is for personal use only, accept the default VDI (VirtualBox Disk Image ) and click Next to continue. If, however, you work in a virtualized environment and might want to share this VM with co-workers, you should select the hard drive file type that is compatible with their software. Make your selection and click Next to continue.

Figure 2: Selecting the VM's hard drive file type.

Dynamically allocating space will save disk space on your host system because a standard installation of Windows XP only requires a few gigabytes of space. As you add software to the VM, VirtualBox will allocate more space to accommodate the new space requirements – up to what you set as the size limit on the next screen.

You can also choose to allocate all of the space now, which consumes more disk space on your host system, but also has the effect of slightly boosting the VM's speed.

Splitting your virtual disk into 2GB slices is only for ease of transport to another system or for use on certain file size limited devices such as USB disks. Personally, I always select to dynamically allocate disk space and to split the virtual disk files into 2GB slices (Figure 3). Click Next to continue.

Figure 3: Selecting the VM's disk storage method.

The "File location and size" screen prompts you to enter a name and location for your virtual disk file. Browse to the location or accept the default, as I've done, and give your virtual disk a name (e.g., Windows XP).

You can use the slider or enter a size for your virtual machine's disk. When you allocate space for your VM, be reasonable, but don't provide too much or the space will be wasted. This is where dynamic allocation of space is preferable. You might set 50GB, as I've done, for the virtual disk size, but if your VM only uses 20GB, you've save 30GB of disk space. Click Create to continue.

Your virtual machine's creation is now complete.

Installing Windows XP into Your Virtual Machine

Now that you've built your virtual machine, it's time to install Windows XP into it, just as you would for a physical system. You have two ways to install Windows XP: via an ISO (CD Image File) or from physical media (CD or DVD) placed into your host system's CD/DVD drive.

To begin the Windows XP installation process, click the Settings icon. In the left navigation pane, click Storage . Click the CD (empty) icon in the middle pane under Storage Pane . In the far right pane (Attributes), click on the CD icon that has a drop-down menu (circled in red in Figure 4) that displays the physical CD/DVD drive and an option to choose a CD/DVD disk file.

Figure 4: Selecting a CD/DVD source for Windows XP.

If you have physical media, place it in the CD/DVD tray and close it. Otherwise, click the CD/DVD file option and browse to the Windows XP ISO file, select it, and click the Open button. The ISO image or physical CD/DVD will now appear in the hardware list on the main settings page of the VM.

Figure 3 displays the method of allocating space on your host system's physical disk. Your choices are to dynamically allocate space as needed or to allocate all of the VM's virtual disk space now. You can also choose to split the virtual disk into 2GB files.

I used a physical CD as my source for the installation. Click OK to return to the VirtualBox Manager main screen.

At the main screen, as shown in Figure 5, click the Start icon to power on your virtual machine and begin the installation process.

Figure 5: The VirtualBox Manager main screen.

Your VM will power up and boot to the CD/DVD source that you supplied in the previous section and stop at the screen shown in Figure 6. Press the Enter key on this screen to continue.

Figure 6: Setting up Windows XP.

Figure 7 shows the next screen where you're required to respond to a prompt during your Windows XP setup. Here, select the virtual disk that you created by pressing the Enter key. You will use the entire 50GB disk, so you can ignore the other options.

Figure 7: Selecting the virtual disk for installation.

The installation to your virtual disk proceeds through various steps that you can watch on the screen, such as disk preparation and formatting, file copying, rebooting, and starting of the installation shell.

During this process, you're prompted for account information, logon preference, time zone, and system name. For the system name, keep it simple by only using numbers and letters, and use 15 or fewer characters with no spaces.

Buy this article as PDF

Express-Checkout as PDF

Pages: 3

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content