How to virtualize XP on Mac OS X

How to virtualize XP on Mac OS X



Step 1 – Prepare Your System

In this tutorial we’re going to virtualize Windows XP Professional SP3 on OS X 10.5.6 using Sun xVM VirtualBox 2.1.0. To prepare for this tutorial you should have the necessary resources available:

  • Sun xVM VirtualBox 2.1.0 for Intel Mac (available here)
  • Windows XP installation media

This tutorial was tested on an Apple Macbook Pro with an Intel Core 2 Duo CPU with 2GB RAM running Mac OS X 10.5.6.

[#PAGE-BREAK#Step 2 – Install VirtualBox#]

Before we start a quick note about our choice of virtualization platforms. There are other options available for Mac OS X such as Parallels and VMWare Fusion.

While either of these options is more than acceptable we chose VirtualBox because we wanted to base the tutorial on a platform which was free whereas the others are excellent but proprietary.

During testing we were very impressed with VirtualBox and are using it as the platform for all our virtualization tutorials.

To install VirtualBox download the VirtualBox DMG package. Open the downloaded file to mount the disk image (or it may automatically open from some browsers) and then double-click the VirtualBox.mpkg to launch the installer.

Click Continue

On the License Agreement page click Continue and then Agree

Select the hard drive you want to install to and click Continue and then Install. Once installed launch VirtualBox from your Applications folder.

[#PAGE-BREAK#Step 3 – Create New XP VM#]

Click the New icon to start the New Virtual Machine Wizard

  • Click Next
  • Type in “Windows XP” as the name and select “Microsoft Windows” from the “OS Type” dropdown menu and “Windows XP” from the “Version” list. Click Next

  • Assign as much memory as you like beyond the base memory recommendation. In this case 192MB is the recommended amount. Click Next

  • On the “Virtual Hard Disk” screen click “New” to launch the Create New Virtual Disk Wizard and click Next.
  • Choose whichever disk type you prefer. The advantage of a fixed-size image is that as all the space is reserved up front there’s an ongoing disk performance benefit as the image doesn’t need to keep expanding as you use it. The downside is that all the space is used at once and it takes longer to create. Click Next
  • Name the image file accordingly and assign some space (at least 10GB for the XP boot disk). Click Next and then Finish. The newly-created Windows-Vista.vdi is now attached to the VM as the primary disk. Click Next and then Finish and the VM is created

To install XP from the media you’ll need to attach the physical optical drive to the VM so that the VM can read from the CD.

To do this highlight the XP VM within VirtualBox and in the right-hand window click on “CD/DVD-ROM”.

Another window opens up – tick the checkbox next to “Mount CD/DVD-ROM” and make sure that “Host CD/DVD Drive” is selected then click OK.

Make sure that the XP CD is in the drive and start the VM by clicking on the Start button. The VM will read from the optical drive and load the XP CD.

Highlight the Windows XP VM and click Start. With no operating system present the VM will automatically boot into the Windows XP setup procedure.

To interact with a VM you have to click into the window which contains the running instance. Doing this will “capture” the keyboard and mouse. You won’t be able to interact with the Mac desktop but you will be able to interact with the VM. To escape back to the Mac desktop click the Host key. For VirtualBox on OS X the Host key is mapped to the Left Command button.

This is the default behaviour on all VirtualBox VMs but you can enable seamless integration by installing guest addition tools which we’ll do once XP has been installed.

On the “Welcome to Setup” screen press Enter then press F8 on the Licensing Agreement page.

Select “Unpartitioned space” on the available disk and press Enter to install then on the next page choose the top option – “Format the partition using the NTFS file system (quick)” and press Enter.

Windows XP will now format the partition and copy the setup files across. You won’t be prompted for input until the system restarts and boots into the graphical mode setup.

When the graphical setup loads the first screen is the Regional aned Language Options window. Choose your preferences and click Next.

Type in your name and organisation (if necessary) and click Next.

Type in the product key and click Next.

Type in the computer name you want to assign to the VM system and a password for the built-in Administrator account then click Next.

Choose the appropriate time and date options for your locale and click Next.

Setup will continue and then install the networking components. make any changes if you need to and click Next. Type in workgroup or domain credentials if needs be and click Next.

That’s all the user input required – Windows XP will now complete the installation and the system will reboot.

[#PAGE-BREAK#Step 5 – Install Guest Additions#]

Most virtualization solutions offer a software package which can be installed on guest machines which provides better access to the host hardware and other resources like shared folders clipboard file copying and so on.

Once the Windows XP VM has been installed and has rebooted skip through the welcome animation the internet connectivity test type in username and log into the desktop. Then press the host key to release the cursor then select the Devices menu and then “Install Guest Additions”. This mounts the additions image into the VM.

The additions media will autorun and launch the setup procedure. Click Next the accept the License Agreement and click Next again. Accept the default install location and click Install.

Setup will continue and the package will install a number of drivers which offer better integration with the host’s resources and improved guest performance. These drivers are not signed by Microsoft so you’ll get a warning popup message during installation. Click “Continue Anyway” on all the popups then reboot to complete the install.

When the system restarts you’ll be able to move the cursor between guest and host without having to use the host key and there will be an icon in the system tray indicating that the additions are active. Installing the additions also gives you extra functionality between guest and host which we’ll look at in the next step.

By default and presumably to maximise compatibility during installation there are a number of guest options which are disabled but which you’ll probably find it useful to enable once the system is operational. To access these options highlight the VM in VirtualBox and then click on “General” in the right-hand window.

Under General there are two particular tabs of interest – Basic and Advanced. Under Basic you can adjust both the system and graphics memory. The graphics memory is expandable up to the available system graphics memorya nd you can also toggle on or off support for 3D acceleration for the guest VM.

Under Advanced you can add or remove options from the boot order and adjust the order itself. You can also enable support for CPU virtualization which will improve system performance.

You can also enable Audio support add more network adaptors connect to the host system’s serial and USB ports share folder between the host filesystem and the guest and enable remote desktop access to the guest via VirtualBox’s RDP server.

If you’re familiar with other virtualization packages then VirtualBox will be very intuitive. If not spent some time playing with the other options such as system snapshots to save a virtual guest at a point in time (very useful for writing tutorials!) moving into and out of fullscreen by using the host+F key combo.

Also check out our other tutorials for virtualizing on different platforms.