Linux and the virtual Windows XP machine

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 cannot 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 is a solution: virtualization.

Running Windows XP in a virtual machine (VM) on your Linux laptop is a better solution than either reimaging your Linux system with XP or attempting the often 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 on your existing Linux system. In the previous issue, I described how 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, you 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. Then, you 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. Click Next to continue.

The "File location and size" screen prompts you to enter a name and location for your virtual disk file. You can browse to the location or accept the default, as I have 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 3) that displays the physical CD/DVD drive and an option to choose a CD/DVD disk file.

Figure 3: 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 virtual machine.

Figure 4 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.

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

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. 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 5: The VirtualBox Manager main screen.
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, you 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.

Post-Installation Tasks

After your Windows XP installation finishes, you might receive a prompt that your system requires updates or that it's vulnerable. You can set up system updates, if prompted, with Express Install, and click the Install button to continue.

Your system will likely reboot after this process completes. If the system prompts you to reboot, do so. If you're not prompted to set up updates, follow the procedure below to install updates for your system.

Upon entering the system again, click Start | Windows Updates and navigate through the process of updating your system. More than 100 updates for Windows XP will be shown, and you'll have to reboot after each set of updates. Repeat this process until there are no more updates for your system.

As you probably know, Microsoft has stopped supporting Windows XP as of April 8, 2014. That means that once you've updated your system with the available updates, you will no longer have regular patches, service packs, or security updates for your system.

When you start your XP VM, you'll likely see a message asking you to acknowledge Windows XP end of support. Click Don't show this message again and then click OK to dismiss the message.

There is a registry hack to receive future security updates, but Microsoft won't test them against Windows XP, so use this hack at your own risk. I advise against it. Instead, install a good antivirus program on your XP system. I recommend AVG's free antivirus [2]. It will help keep your system secure.

Your Windows XP system is now fully functional and ready to use. Virtual machines are exactly like physical machines in that you can install software, reboot, back up, and crash them. Additionally, your Windows XP VM should provide you with sufficient life until you can safely and reasonably migrate your legacy apps to a newer operating system.