Friday, August 27, 2010

How to Run Windows, Mac, and Linux Side by Side and Pain-Free with VirtualBox

By Jason Fitzpatrick

How to Run Windows, Mac, and Linux Side by Side and Pain-Free with VirtualBox

How to Run Windows, Mac, and Linux Side by Side and Pain-Free with VirtualBox Running multiple operating systems side-by-side gives you the chance to test applications, run platform-specific software, and tons more without ever rebooting. It's also extremely cool. Here's how to run Windows, Mac, and Linux simultaneously and pain-free as possible.

To get a quick idea of where we're headed, check out the video above, which demonstrates my Windows 7 system running OS X and Ubuntu through VirtualBox. Below, we'll build on on the basics you learned in our beginner's guide to creating virtual machines with VirtualBox. We'll show you how to easily install new operating systems (including Mac OS X and Linux) and optimize your installation with shared folders and software to help your virtual machines communicate with your main OS. We'll also do a little extra work to get the newest release of Snow Leopard to play nice, even though it's not fully supported yet. Although we're using Windows 7 64-bit as our base OS, VirtualBox runs on nearly any OS, and these tips and tricks are applicable to any serious VirtualBox setup.

Why Virtualize?

Using virtualized operating systems presents all sorts of opportunities. You don't have to leave your primary and favored operating system to use tools found only in another operating system; you can run a copy of your current operating system to try out new tweaks, tricks, and software to ensure everything works well; you can test new software or browse in an entirely sandboxed OS. One of the great perks of running multiple operating systems in virtualization come with multiple monitors, you can spread out almost as though you had separate computers hooked up to the same keyboard and mouse.

What You'll Need?

You're most likely using a machine right now that would easily support at least one other operating system in virtualization, but likely more. Our test machine for this virtualization project is a modest rig we put together for around $400 nearly two years ago. It has an AMD quadcore processor, 8GB of RAM, and a basic graphics card with 256MB of RAM. The parts weren't cutting edge when we bought them—all of them were selected because they were on sale—and they're certainly not cutting edge now. With those specs, the machine easily runs Ubuntu, OS X Snow Leopard, and Windows 7 32-bit simultaneously—powered by a core OS of Windows 7-64 bit—without any problems. If you've got a reasonably new system with a good amount of RAM, you should be just fine.

Installing New Virtual Machines in VirtualBox

How to Run Windows, Mac, and Linux Side by Side and Pain-Free with VirtualBox
Again, if you're unfamiliar with virtual machines or VirtualBox, check out our beginner's guide. We won't be running through the basics of installation, but we will be highlighting some tricks to make your virtual machines run smoother. First, let's run through where you can get started installing various virtual machines (like Linux or OS X).

How to Run Windows, Mac, and Linux Side by Side and Pain-Free with VirtualBox
Grab a pre-configured VirtualBox image and don't sweat through installation of open-source operating systems. VirtualBoxImages.com catalogs pre-configured VirtualBox hard drive images (VDIs). While in most instances it isn't too much of a hassle to create your own fresh install, why bother with it if you don't need to? VirtualBoxImages is a great place to grab operating systems you want to try just for fun like ultra compact versions of Linux or even Android OS. When it comes to installing Windows and other commercial operating systems, you'll have to do it the manual way.

How to Run Windows, Mac, and Linux Side by Side and Pain-Free with VirtualBox

Step-by-step Mac OS X installation. If you're installing Snow Leopard make sure to check out a previous guide to installing Mac OS X in Windows to get OS X up and running. When you're done, come back; below we'll detail how to set up file sharing between your host OS and OS X.

How to Run Windows, Mac, and Linux Side by Side and Pain-Free with VirtualBox
Don't bother burning a disc if you already have the .ISO file on your computer. VirtualBox excels at installing operating systems off an .ISO. Just for fun we installed Windows XP off a CD and Windows 7 off an .ISO file simultaneously and it handled the dual install without a hiccup. Remember to add your .ISO files to the Virtual Media Manager or else they won't be available to your virtual operating systems.

Take a Snapshot of What You've Done so Far

Copying, snapshotting, and cloning your virtual disks preserve your hard work. VirtualBox has several mechanisms in place for helping you to preserve all the setup and customization you've done. One of the first things you should do after successfully installing and customizing a virtual OS is to back it up.

Although installing operating systems with VirtualBox is a breeze most of the time, the few times it isn't you'll likely spend a lot of time searching for a solution and tinkering. Save yourself the headache of doing it again by backing up your new virtual disk. You'll also likely want to do the same after you get the machine set up with the tweaks detailed in the optimize section below, and any time you've taken some time to set something up that you don't want to hassle with again.

Shut down your virtual machine and exit VirtualBox before attempting to backup any of your disks. Once VirtualBox is shut down you can browse to the directory your VDI files are in. Copy the VDI file of each virtual operating system you wish to backup and put it on another disk or network drive. If any part of your customization involved tweaking the XML file associated with the virtual OS it would be wise of you to copy that along with the VDI file.

Significantly faster and easier than a total backup is a Snapshot. You can create one by pressing CTRL+S at anytime when your virtual OS is running.

How to Run Windows, Mac, and Linux Side by Side and Pain-Free with VirtualBox

Think of snapshots like the System Restore function in Windows. You can create a snapshot at anytime within your virtual machine to mark a restore point you may want to return to. It takes so little time to create them it's criminal to not do so before making a major change to your virtual OS or installing a big software suite.

Cloning is the most advanced technique for dealing with your virtual disks. Let's say you installed an OS that was a bit more hassle than you anticipated and you'd really like to make a perfect copy of it so you'll have a pure installation to study and a disposable one that you can really thrash around in. You can't just copy the VDI file because the unique identifier will conflict with the original VDI. You'll need to use the clone command from the command prompt. Refer to this portion of the official manual for explicit details. Your clone command should look something like "C:\Program Files\Sun\xVM VirtualBox\VBoxManage.exe" clonevdi "Ubuntu 10.vdi" "Ubuntu 10 clone.vdi". This will assure your new virtual OS won't conflict with its twin.

Optimize Your VirtualBox Installation

How to Run Windows, Mac, and Linux Side by Side and Pain-Free with VirtualBox

Always install Guest Additions. Guest Additions are special software for Windows, Linux, and Solaris operating systems that make your life as a virtual OS user much easier. Rather than muck around in configuration files and settings trying to resize your virtual OS resolution, for example, the Guest Addition enables dynamic resizing. It's always been easy to install in Windows but now it's just as easy to install in Linux, just mount the VboxGuestAdditions.iso from the Devices -> CD/DVD Devices menu and then run the installation package inside.

Set up a universal share. Hopping between virtual operating systems might be faster than hopping between two physical computers but it still suffers from one of the same hazards. It's easy to lose track of your files. If you're running Windows or Linux the Guest Additions installation takes care of the networking for you. If you're running Mac OS X you miss out on that, for lack of a Mac Guest Additions package. Don't worry though, setting up sharing from Windows (or any other Samba share) is simple.

Thanks to these handy instructions from VirtualBox forum member PaulsCode, you'll have no trouble setting up your cross-platform share.

How to Run Windows, Mac, and Linux Side by Side and Pain-Free with VirtualBox


  1. Share a folder from the actual host machine (from the OS, not through the vbox shared folders).
  2. Use NAT for your guest's network settings.
  3. From Mac OS X, Open "Finder" (looks like a square face, usually on the bottom-left).
  4. From the top menu, navigate to Go->Connect to Server.
  5. For "Server Address" enter smb://10.0.2.2
  6. Click "Connect".
  7. Enter your username and password (for the host machine).

Now you'll be able to access the same pool of files from all of your virtual machines which makes it even easier to switch OS-dependent tools while working on the same project.


At this point you've got your virtual operating systems installed, customized, linked to a shared folder, duplicated for your stress testing and mad scientist experiments, and backed up in case it all goes terribly wrong. With a good battery backup attached to your computer and virtual operating systems to do the heavy lifting and get abused by all your software installations you're in a perfect position to forget about rebooting your base OS and get busy playing with your virtual machines.

Jason Fitzpatrick is the Senior Writer at Lifehacker, an absurd fan of obscenely long uptimes, hates rearranging his workspace after a reboot, and knows that if you just give virtualization a try you'll be addicted too.

Number of comments
  • Share this:

No comments:

Post a Comment

CrunchyTech

Blog Archive