Running Windows on Your Mac With VirtualBox

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:

  1. Running Windows-only applications on your Mac (like CAD, scientific, or business software)
  2. Running the latest PC games on your Mac
  3. Testing a website in Internet Explorer
  4. Testing and tweaking different UNIX-based and Windows-based systems
  5. 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.

Installation

  1. To install VirtualBox, first we need to download the latest version. Log on to the download page and find the link for Intel Macs.
  2. Mount the DMG and open it. Now run (double click) “VirtualBox.mpkg”. Follow the instructions until you finish the installation.
  3. 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”.

Creating a new virtual machine

Creating a new virtual machine

  1. 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.
  2. 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.
  3. To setup Windows you need to create a virtual hard disk. Click on “New” to open the hard disk creation wizard.
  4. Select “Dynamically expanding image” as virtual disk image type. This helps saving disk space as it grows according to the requirements.
  5. Leave the virtual disk “Location” and “Size” as it is in the next page.
  6. 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.

  1. The “First Run Wizard” shows right after you started the virtual machine. Press “Next” to start.
  2. 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.
  3. Selecting boot and installation options

    Selecting boot and installation options

  4. After selecting the proper media, pass the summary by pressing “Finish”. The system will boot immediately.
  5. 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

Guest Additions

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.

  1. Run the XP machine.
  2. Click on “Devices > Install Guest Additions”.
  3. 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.

Adding Virtual Box extras

Adding Virtual Box extras

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.

  1. 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.
  2. Click on “Settings” on the toolbar
  3. In the “Audio” tab, check “Enable Audio” and select “Core Audio” as “Host Audio Driver”.
  4. In the “Ports” tab, check both “Enable USB Controller” and “Enable USB 2.0 (EHCI) Controller”.
  5. 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.

Sharing files

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:

  1. Make sure you have already installed the Guest Additions.
  2. 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.
  3. Start creating a new shared folder by clicking on the plus icon on the right side of the dialog box.
  4. In “Add Share” dialog box, choose “Folder Path” (on your Mac). The “Folder Name” (on the virtual machine) is automatically named.
  5. Check if you need the folder to be permanent (maintains after shutting down the virtual machine) or to be read only (safer).
  6. Press “OK” to create the folder.
  7. 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:

Getting networking set up

Getting networking set up

  1. In Mac OS (the host), open “System Preferences” and then go to “Sharing”.
  2. Enable “File Sharing” in the Services.
  3. Press “Options” and check “Share files and folders using SMB”.
  4. Select the account(s) you want them to have access to SMB and enter the password for that particular account when prompted.
  5. Close System Preferences.
  6. 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.

Summary

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!

Our Sponsors

Delicious Bookmark 0 Saves

Responses

Add Yours
  • Brilliant!

  • I personally prefer VMware.

    Thnx for post.

  • I’m using vmware, is there any Advantage or is it lighter, better in performance so I should switch to?

    • Parallels has a better performance and more features I think. If you use VirtualBox you can use your VM on every OS, because VirtualBox is platform independent. I prefer VirtualBox because its lighter and more flexible…

  • I’m using VMware Fusion to play with Windows 7 and ubuntu. If only I had seen this article before now, I’d be using virtualbox instead. A truly well done and in depth article, thanks.

  • i’ve tried all three of them, but, for the mean time, VMWare Fusion served me well. Still, I’d love to see more from VirtualBox. Free software rules! :)

  • Have been using Vista on VirtualBox from a few months but its slow….

    Who needs Windows when u have a Mac !!!

  • VirtualBox and Windows XP – I only use it because I have windows only DVB USB-stick which is kinda my only TV in house.. :)

  • Interesting timing.

    I installed VMware Fusion this weekend with XP. This needed to run CorelDRAW and Xara. Amazingly fast, at least compare to what it was on my PC. Windows is up and running in about 30 seconds. (no kidding)

    I removed any sharing and networking and just drag and drop files as needed. Brilliant!

  • Just for the record, you can run your BootCamp install as a VM as-well (well, at least in VMware).

    So personally, I’d say the best option is to install Windows in BootCamp, and use it in VMware. That way you can switch to run it directly from BootCamp if you require better performance.

  • i got bootcamp running for CAD software only. you reckon that VirtualBox can run serious surface modeller and renderer like rhino 4.0?

  • Why not just use boot camp?

    • Virtual Box (and others) save you the reboot time and provide you with seamless interoperability.

      Boot camp in the other hand gives you the best performance. It is good when you want to do resource-intensive tasks like playing 3D PC games on your Mac.

  • It’s really nice to see Open Source taking a big leap for Mac OS X.

  • I actually found this a few days ago, and I’m glad I did. I’m a fan of VMWare Fusion, but saving money is always a plus. Will probably install this in the next week or so.

  • I’ve tried all three. Fusion is the fastest for XP, Vista and Windows 7 beta on my MacPro. VirtualBox runs XP fine if you’re not doing anything too terribly complicated. It runs Vista OK for web surfing, email and light office document work, but not much more.

    If you expect to be running in Windows more than once or twice per week, you’ll probably want to get Parallels or Fusion. But if you just need the basics and don’t plan on working any great amount of time in Windows, VirtualBox is really, really nice!

  • This is great. I was thinking of buying a netbook to run a must needed windows programme, but I will try this instead. Has anyone tried it will trainingpeaks software? Speed ok? This is it…

    http://home.trainingpeaks.com/wko-desktop-software/analysis-software-for-training-files.aspx

  • This is great! I was thinking of buying a netbook, but really didn’t want to run two machines. Has anyone run trainingpeaks on it? Or SRM software? I don’t want to load it without making sure it’s ok!

  • Does anyone know if Virtual Box can use your Boot Camp partition? I’ve been doing some snooping around and haven’t gotten a clear answer yet.

  • No, VB cannot use your BootCamp partition. At least, there’s no mention of it in any tech files, read me files, help files, or any other “plain as day” way I see in the app itself.

  • I use it too, really like it :)

  • I´ve installed just to see how it worked, then i deleted the windows machine from virtualbox.
    Should i´ve uninstalled windows the windows way or did i did the right thing?

  • So its not recommended to use VirtualBox if your going to play heavy games that only works on windows? I might as well stick to the console for gaming then:)

    Seems like a really cool app and i hafto try i sometime. Just curios, and its probably mentioned or maybe obvious, but when you use VB and you innstall a program on windows, this program is not to be seen when ur running OS X right? all it shows is difference in Disk Space?

  • and how do you get a picture over you name when you comment? hehe

    • I use BootCamp combined with VMWare Fusion because I want to use the same partition. When this feature is supported in VirtualBox I will consider changing.

      @ Lasse: You need to use Gravatar ( http://en.gravatar.com/ ) for a picture beside your comment. Check out there website for more info.

  • I have problems with Sharing files part. Done everything correctly but when trying to open “\VBOXSVRYOUR_FOLDER” it did not work. Couldn’t find a way to navigate to “Entire Network” and then to “Virtual Box Shared Folders”. Don’t know where that is. Any help appreciated.
    Thanks.

  • Never mind guys, I found it. Right click ”My network places“ and “Explore“. There is a “Entire Network“ icon. Click on that and voala, “Vbox shared folder“. Weeee!

  • I could not install Vista using BootCamp. Probably a hardware issue with my computer. I am working with Apple on that. Meanwhile I installed VirtualBox and installed Vista. It worked, but the performance has been degrading over time. Probably the same hardware issue, but what I wanted to know is … how do I uninstall Vista from the VirtualBox? Do I simply delete the virtual machine where it is loaded. I am not a geek, so I was hoping to avoid the learning curve by asking here! Any help would be appreciated!

  • So, I get about half way through the tut before something goes wrong. Now I realize what. Next time you make a tut such as this, it would be NICE if you TOLD US in the BEGGINING of the tut that we’d need the WINDOWS INSTALLATION CD

    half an hour wasted…

  • I do use Virtual Box to run Suse, Solaris 10, Opensolaris and Windows XP and I can tell you guys, Fusion do not do this so fast and easy as VB, despite the price. No, Fusion is not bad, I just feel VB do it better. But there is a negative point; You can´t Install OS X server on Virtual Box :(

  • Thank you – I’ve looked everywhere for a solution, before I found your site.

  • Does anyone know how to get my guest windows account to run games as there seems to be a problem with AOEIII it doesn’t seem to recognise my macbook graphics cards and therefor doesn’t think I have one so I can’t run the game?

    Is there a work around or something???

  • I want to uninstall Windows with no COA and put on one with a COA. How can I uninstall? Is it just a matter of deleting Virtualbox and then re-installing oit and loading it with authenticated Windows?

  • Nice guide! I like the post-installation tips..Thanks a ton for that,

  • Ive installed it and all seems to work except the internet connectivity in the guest (win XP home). I’ve scoured the forums for answers and have found similar problems but its a bit technical and I don’t really understand what the heck they are talking about. Any ideas?

  • Great tutorial even though i didn’t managed to get it work,after some carefull reading i did it.
    Thanks

  • Great How-to! Thanks!

  • Fed up with Parallels 4 (very slow and clunky), I decided to try Virtualbox on my Mac Mini to run XP but gave up after I couldn’t install XP from the CD – it just wouldn’t recognise it.

  • Nice article simple and informative, great thanks, keep walking.

  • I really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he ejoyed it as well!

  • This is an excellent topic you are discussing about and i really appreciate it. It should be going on.

  • This is not my first time using VirtualBox. I already successfully installed Windows XP on Vista based, Seven on Vista based. And without any problems at all !

  • Hey, I’ve been trying to play PC games but it won’t let me. it either tells me that it detects a virtual machine and won’t continue, or it tells me that I need to put the original copy of the cd in my drive. only problem with that is that I have the cd in the drive.

    are there any solutions or is this just an unfixable problem?

  • This is an excellent topic you are discussing about and i really appreciate it.

Your Response


Trackbacks

Every computer needs an operating system to operate, just like we humans need our brains to function. Unlike us, computers can have more ...

Knask på ein fredag: Februar › the unborn chikken February 27th