Every computer needs an operating system to operate, just like we humans need our brains to function. Unlike us, computers can have more than one brain, running multiple operating systems at the same time. Virtualization is the process of concurrently running another (fully functional) operating system over the main OS X installation.
The great advantage of a virtual machine is that your original system is untouched – you can operate or remove a Windows installation without causing any harm to OS X. This how-to will walk you through the process of setting up Windows on your Mac using the free VirtualBox application.
It’s a simple process, requiring an Intel Mac with at least 512MB RAM and a copy of Windows – we’ve used XP, but any version will do. Without further ado, let’s get started!
If you wonder what all this fuss is about, let see how a virtualization solution can save you a huge amount of time while keeping your beloved Mac running smoothly. Here is a list of several common scenarios requiring the use of a virtual OS:
- Running Windows-only applications on your Mac (like CAD, scientific, or business software)
- Running the latest PC games on your Mac
- Testing a website in Internet Explorer
- Testing and tweaking different UNIX-based and Windows-based systems
- Tinkering with the latest beta of an OS
Example: Suppose you have a MacBook that runs OS 10.5 (Leopard). Now you want to run the PeachTree accounting package to catch up with what your accountant is doing. All you need is to install a Windows virtual machine – you don’t need to have a secondary system for this purpose, excited?
What is VirtualBox?
There are three major virtual PC software packages for Mac users;
They are all great pieces of software and offer similar features, with a few differences here and there. Another option is to utilize Boot Camp built into OS X, although this requires to actually boot into your Windows installation and it isn’t possible to run it concurrently with Leopard.
Choosing between them is a personal choice based on specific features, but the major factor that differentiates VirtualBox here is its price – free! Being free doesn’t make VirtualBox weaker or useless in the competition. It is quite suitable and powerful enough for home and business users dabbling in another OS. Also knowing that Innotech (the original company behind VirtualBox) was acquired by Sun Microsystems recently, shows there is now significant development behind it.
What you need
All you need is an Intel-based Mac with 512MB of RAM (1GB or more memory is highly recommended). As of VirtualBox 2.1.2 (the latest version at the time of writing this article), you need around 30MB of hard disk space for installing VirtualBox itself and you should allocate at least 5GB-10GB for every virtual machine you install.
- To install VirtualBox, first we need to download the latest version. Log on to the download page and find the link for Intel Macs.
- Mount the DMG and open it. Now run (double click) “VirtualBox.mpkg”. Follow the instructions until you finish the installation.
- After a successful installation, run VirtualBox from “Applications”. It is good idea to drag the icon and drop it on the Dock if you are planning to use it regularly.
Running Virtual Box
Before you can actually do anything productive with VirtualBox, you need to setup an operating system on it. Since most of you will be interested in Windows, this article example is going to show you how to setup Windows XP.
For a regular user, running Windows XP is recommended over Vista because of the faster and lighter nature of XP. Remember that Virtual PCs use a lot of system resources and you don’t need to make it slower with the slightly more resource hungry Vista. However, all versions of Windows can work perfectly fine on VirtualBox.
Setting up Windows XP
Installing Windows XP on VirtualBox is easier (and faster!) than setting it up on a real computer! All you need is a Windows XP CD, either Home or Professional edition. You can install the service pack (version 3 is the current) and other software after finishing the Windows setup.
After running VirtualBox, click on “New” on the toolbar. “Create New Virtual Machine” wizard opens. Click on “Next”.
- In the “Memory” page set the RAM to 256 or more if you wish. Be careful not to go more than 25% to 30% of your system RAM because it makes OS X slower.
- In the next page, type “Windows XP” (or any other meaningful name) and choose “Windows XP” form OS type drop down. Press “Next” to continue.
- To setup Windows you need to create a virtual hard disk. Click on “New” to open the hard disk creation wizard.
- Select “Dynamically expanding image” as virtual disk image type. This helps saving disk space as it grows according to the requirements.
- Leave the virtual disk “Location” and “Size” as it is in the next page.
- In the “Summary” page press “Finish” to apply the changes.
You can see that a new OS is added to the list in VirtualBox main window and the status is “Powered Off”. Just press “Start” on the toolbar (or select it from the context menu) to run the virtual machine for the very first time.
- The “First Run Wizard” shows right after you started the virtual machine. Press “Next” to start.
- In the “Select Installation Media” page choose the proper media from which you want to install Windows. It is usually the DVD drive that you have already put the Windows CD in it. In case you have an ISO file you can skip burning it on the CD and directly select it as the installation media.
- After selecting the proper media, pass the summary by pressing “Finish”. The system will boot immediately.
- You will see that the Windows setup (that old text-based blue screen!) shows up and you can continue with standard setup routine. It could take several minutes, so be patient and get a cup of green tea!
Post Installation Tasks
After finishing the Windows installation, you need to first install the “Guest Additions”. If you remember, the Windows virtual machine that you just finished installing is a guest machine and needs some extra software to work perfectly within OS X.
Guest Additions consist of device drivers and system applications for the guest operating system that optimize the guest for better performance and usability. To make it short, it is an ISO image (/Applications/VirtualBox.app/MacOS/Contents/VBoxGuestAdditions.iso) that needs to be mounted and installed.
- Run the XP machine.
- Click on “Devices > Install Guest Additions”.
- Continue with the setup wizard (runs inside XP) and reboot the system when prompted.
If the setup did not start for any reason, it might be that the ISO image is not properly mounted. To solve this issue go to “Devices > Mount CD/DVD-ROM > CD/DVD-ROM Image…” and add the ISO image to the list. If it is already there, try removing and adding it again.
Enabling Sound and USB Support
What would be the life without sound and a USB connection? Miserable for sure! For technical reasons both sound and USB are disabled by default and you need to enable them after installing a guest OS.
- Shut down the XP machine if it is running. This is a standard Windows shutdown. Alternatively you can just close the window and select the proper option to stop the guest.
- Click on “Settings” on the toolbar
- In the “Audio” tab, check “Enable Audio” and select “Core Audio” as “Host Audio Driver”.
- In the “Ports” tab, check both “Enable USB Controller” and “Enable USB 2.0 (EHCI) Controller”.
- Press “OK” to apply the changes.
Next time you run Windows, you should be able to hear audio and access your USB devices. You may need to “Eject” a USB device from your Mac to enable it within the virtual machine.
One of the things that might come in handy is the ability to transfer files between the host and the guest. There are 2 ways to do that, “Shared Folders” and Windows networking. To enable file sharing:
- Make sure you have already installed the Guest Additions.
- In a running guest window, there is a folder icon down in the status bar. Click on the icon to open the “Folder Sharing” dialog box. You can also access to this from “Settings” if the guest is not running.
- Start creating a new shared folder by clicking on the plus icon on the right side of the dialog box.
- In “Add Share” dialog box, choose “Folder Path” (on your Mac). The “Folder Name” (on the virtual machine) is automatically named.
- Check if you need the folder to be permanent (maintains after shutting down the virtual machine) or to be read only (safer).
- Press “OK” to create the folder.
- Now open “My Computer” and try to open “\VBOXSVRYOUR_FOLDER”. If it did not work try to navigate to “Entire Network” and then to “Virtual Box Shared Folders”.
To enable networking:
- In Mac OS (the host), open “System Preferences” and then go to “Sharing”.
- Enable “File Sharing” in the Services.
- Press “Options” and check “Share files and folders using SMB”.
- Select the account(s) you want them to have access to SMB and enter the password for that particular account when prompted.
- Close System Preferences.
- In XP, in My Computer address bar, type in the IP address of your Mac (e.g. 192.168.1.101). If you don’t know your IP address you can see it in the System Preferences, File Sharing.
Note: SMB is using SAMBA services to make sharing files between UNIX based systems (like Mac OS) and Windows possible.
Hopefully you should now be be all set up with a fully functioning Windows virtual machine for relatively little cost. There are still many tips and tricks in using VirtualBox to unleash its real power. You can read about these in the official documentation both online and bundled with the download.
I’m always impressed with VirtualBox as a free application, but do accept that Parallels and VMWare offer a more advanced feature set for their price (particularly with regard to graphical performance etc). I’d be interested to hear your thoughts on whether you use a virtualization system, along with the tasks which require you to move away from the comfort of OS X!