There are plenty of reasons to run a virtual machine. The first, and most compelling, is that you want to play: Maybe there are some other operating system you want to dabble with (cough Linux cough), but you don’t want to deal with installing another hard drive, partitioning your existing drive, or setting up your system a different way.
Virtual machines are great because they allow you to install an operating system within your existing operating system. Everything you do within this new OS — cue Inception soundtrack — is sandboxed from your primary OS. Anything you install, or mess up, can be deleted with a few clicks of a mouse. (And if you’re smart, you saved a version of your secondary OS right after you installed it, so you can quickly go back to a clean, fresh version of Linux, Windows, or whatever.)
Even better, you can set up a virtual machine on your system for free. Here’s how to get started:
The apps you’ll need
You can pay for a virtual machine app like VMWare Workstation Pro, VMWare Fusion, or Parallels Desktop, but I recommend using the free VirtualBox app if you’re new to the wide world of virtual machines. (If you’re using Windows 10 Pro, you also get a free, built-in virtualization tool, too.)
For simplicity’s sake, all of my examples in this article will come from a Windows version of VirtualBox, but the app is cross-platform. (For Mac users, VirtualBox is a great alternative if you don’t want to Boot Camp into Windows, for example.)
A virtual machine isn’t very helpful without an operating system to install on it. And for that, you might have to get a little creative. For Windows, you can grab the Windows media installation tool and use it to download an image (.ISO) of the operating system, which you’ll then load into VirtualBox.
You can also download one of the free virtual machine images Microsoft offers, which expire after 90 days.
If you’re looking to run a virtual version of macOS on macOS, you’ll have a few hoops to jump through. It’s not as straightforward of a process as running a virtual version any other operating system, but it’s possible. If you want to run macOS on Windows—especially if you’re using VirtualBox—you’re in for a world of hurt. It’s complicated, a pain in the butt to configure, and I found that it ran incredibly slowly on my souped-up system when I did it.
You’ll probably want to try the free VMWare Player if you go this route, and consult guides over at /r/hackintosh or helpful YouTube tutorials (like this one) to get macOS to work on your Windows system. Creating a Hackintosh is a guide in itself, and something I’ll definitely revisit in a future article—if I can get it to not be terrible.
Setting up VirtualBox
To get started with your virtual machine—be it Windows, Linux, or macOS (if you’re really going for it)—load VirtualBox and click on the big “New” button in the corner. You can’t miss it.
(If you downloaded Microsoft’s free virtual machine images instead of a Windows .ISO file, you’ll instead click on File > Import Appliance and find the .OVA file you unzipped. Import that, and you’ll be able to fire it up immediately—no other configuration required, though you might want to tweak some settings, as we discuss later, to get the best performance.)
Give your new operating system a name, select what it is — Windows, Linux, macOS, et cetera — and select the correct version of whatever you’re installing. If you only see 32-bit options, you might have to do a little troubleshooting to unlock 64-bit versions. It might be worth investigating, however, as a 64-bit version of your virtualized OS can use more than 4GB of memory (if you plan to dedicate that much to your OS-in-an-OS). If you’re using a 32-bit processor, because your computer is ancient, then you should just stick with a 32-bit version of your virtual operating system.
When VirtualBox asks you how much of your system’s memory you’d like to devote to your virtual OS, I’d stick with its recommendations — specifically, stay in the “green zone.” You’ll probably want at least 2–4GB at minimum for Windows to run smoothly. If you can get to 8GB, even better. (And, yes, everything is measured in MB in VirtualBox, so 2GB translates to 2048MB, 4GB to 4096MB, et cetera.)
You can always the amount of memory you’re dedicating to your virtual machine after the fact. If you’re not happy with your initial choice, tweak it and see how that affects your virtual machine’s performance.
Next, VirtualBox will ask you to set up a “hard disk” — really, a file serving as a hard drive — for your virtual machine to use. Once you click “Create,” you’ll be presented with three different file types you can select for your hard disk file:
You should be fine to stick with the default option: the VirtualBox Disk Image, or VDI. On the next screen, however, you’ll want to think about the choice you make. You can select to create a dynamically allocated disk, which only eats up space on your actual hard drive when you use it (but doesn’t shrink when you delete files on your virtual operating system), or you can just set a fixed size for the hard drive your virtual OS will use.
A fixed disk is faster than a dynamically allocated disk, but you’ll have to dedicate all the space up front instead of letting your virtual OS use more and more as you fill it up with stuff. I’d go fixed disk myself, because it simplifies everything and gives you the best performance, but if you’re pressed for space, you might just have to stick with a dynamically allocated disk.
You’ll set the disk’s size on the next screen:
Once VirtualBox creates your disk, you’ll see your brand-new virtual machine, all ready to go! But not quite. There are still a few more settings you’ll need to take a look at, so select your virtual machine and click the big Settings gear icon.
There’s a lot you can tweak to squeeze as much performance out of your virtual machine as possible, including adjusting how much memory it gets, how much of your processor you’re dedicating to your virtual operating system, and how much video memory it should have. You can adjust these settings now via the System and Display menus. When you’re done, you’ll want to visit the Storage menu so you can actually install your operating system.
Within Storage, you’ll see a little icon of a CD (or DVD) with the word “Empty” next to it. Select it, then click on the image of a CD (or DVD) in the right-most “Attributes” section, to the right of “Optical Drive.” Select the “Choose Virtual Optical Disk File” option, find the image of the operating system you’re looking to install, and select it.
If you’re done editing your virtual machine’s settings — and you should really check out USB, to ensure your host system’s connected devices can also be used by your virtual machine, as well as General > Advanced for shared clipboard and drag’n’drop functionality between your host and virtual OS — click on OK. Then click on the big green “Start” arrow and launch your virtual operating system. With luck, it’ll boot into its setup process, and you’ll be ready to install it as if you were setting up a brand-new desktop or laptop.
Once you have your virtual machine up and running, you’ll want to make ample use of VirtualBox’s Snapshot feature (under its “Machine” menu). A snapshot allows you to save and restore the state of the virtual machine at any point. So, once you have your fresh version of the operating system installed, take a snapshot. If you muck up your virtual machine or want to revert it back to its pure, untouched state (without having to reinstall your operating system), you can just restore your snapshot. Or, if you’re about to do something that might mess up your virtual machine for any reason, take a snapshot first—same principle.