Want a free year on Tuts+ (worth $180)? Start an InMotion Hosting plan for $3.49/mo.
Virtual Machines are a great way to experiment with a new operating system, work safely on a new development project, test new software, or allow a child to play and explore without fear of harming your computer. In this tutorial I will explain what a virtual machine is, reasons you may want to use a virtual machine, how to select the best virtualization software for your needs, and what types of things can be run in a virtual machine.
What Is a Virtual Machine?
A virtual machine is, in it’s simplest understanding, a computer that runs within a piece of software. A virtual machine has virtual hard drives, virtual RAM, a virtual operating system, virtual drivers and everything a normal computer may have. This means that within a virtual machine, you can work 100% independently of the machine on which you are running the virtual machine, the host machine.
This virtual machine, and all of the preferences and files associated with it, is stored within a file, or a few files, on the host machine. By storing the virtual machine in these files, you can easily move the virtual machine to other host machines or create periodic backups of the machine.
Virtual machines are more common than many may think, as often they aren’t called virtual machines. If you have used the iOS simulator provided by Xcode, you have used a virtual machine. If you have certain game console emulators, you were using a virtual machine.
Why Use a Virtual Machine?
Virtual machines provide a number of benefits and opportunities that you can’t easily achieve with a traditional computer. Some scenarios where these benefits become apparent would be:
If you need to run Windows. While you could use Bootcamp, it may not be convenient if you only need to use the Windows specific applications only once or twice a day. This is one place a virtual machine can shine. If you wanted to use that application, you would be able to open your Windows virtual machine from within Mac OS X, access the files and applications that you need, and then close the virtual machine without having to disrupt your workflow by restarting your Mac.
If you want to try new software or settings combinations. If you are like me, you’ve spent a lot of time getting your Mac to work exactly how you like it and you don’t want to jeopardize how your machine works by installing that OS X tweak you found while searching the internet. By using a virtual machine, you would be able to install the tweak and see what it does to OS X without risking your main OS X installation.
If you want to allow your child to explore the computer without fear of damage to your files or settings. I know when I was growing up, I would explore the machine, replace files, move things around, and by the time I was done, the machine would never work exactly as it had before. This curiosity though doesn’t have to leave you with headaches and fears over what your child is doing on the machine. A virtual machine allows you to provide your child with their own place to explore, and if things stop working, you can delete the virtual machine, restore from a backup, and the child is back with a working machine in just a few minutes.
These three examples only begin to show what virtual machines can do for the Mac user. In brief, a virtual machine allows the Mac gamer to play games designed for Windows with their friends, the developer to create have a safe and portable production environment, the internet explorer to surf the web knowing that their machine is safe from spyware, malware, or other malicious things websites can provide your machine. And each of these can be done with the convenience of just opening another program.
Even simpler, a virtual machine allows us all to learn more about computing in a safe environment. While we learn, mistakes happen, and at times these mistakes can be difficult to revert. A virtual machine allows us to make these mistakes in a controlled environment without the fear of permanently ruining our machine.
What Can You Virtualize?
With this understanding of what a virtual machine is, we are able to talk about what can be virtualized. Virtual machines can run any operating system that would work on a standard computer. Examples of popular software that can be virtualized includes Windows, Mac OS X, Chrome OS, Linux, Unix, Android, and much more.
In some cases though, a full operating system may be overkill. Website developers for example often need to test their websites in a number of different web browsers to ensure they are compatible with them all. If they wanted to test their site in every version of Internet Explorer, they may need a large number of virtual machines, which can use a lot of space on their hard drive. In situations like this, virtual machines can also allow you to virtualize small portions of an operating system, allowing you to minimize the amount of space you need to use for those applications. In this case, one solution may be to use the Internet Explorer virtual machines project which lets you install small and separate virtual machines that include Internet Explorer 6–10 on a variety of different versions of Windows would allow you to install 12 different virtual machines in a fraction of the space of what full installations would require.
Choosing the Best Virtualization Software for Your Needs
The most common virtualization software for the Mac that you will hear discussed or compared are Parallels ($79.99 new, $49.99 upgrade), VMware Fusion ($49.99–$99.99 new, $49.99 upgrade) , and VirtualBox (free). Each of these are great products, but best used for different things.
When choosing the best virtualization software for your needs, the first and most important thing to do is decide what you will be doing in your virtual machine as each performs differently in different areas, such as 3D gaming, playing video, and software development.
The second thing that you will need to decide is what operating system will you be primarily using in the operating system. This can be many, but it’s important to think about the type of operating system, meaning will you be installing Windows, a Linux distribution, or another copy of OS X? This is important to consider as convenience is an important part of working with a virtual machine.
If you plan on working with Windows primarily in your machines, you may want to consider a paid option that allows you to integrate your Windows experience with OS X. Parallels and VMware Fusion both allow you to use Mac features such as Launchpad, Mission Control, and other ways you are used to launching applications on your Mac. This helps to make your experience better and provides you with more convenience. In this instance, you may decide that VMware Fusion is the best choice as you can get it for a slightly cheaper price than Parallels and still get the convenience.
On the other hand, if you will be working with different linux distributions, or use processing intensive applications you may be more interested in raw performance. In this case, we should take a look at the benchmark tests that have been done to see the best overall performer. If we look at The Mac Observer’s benchmarks, we see that they have given the nod to Parallels 8 in terms of raw performance in most tests that were run. Please remember that as with all benchmarks, always take them with a grain of salt, as performance will vary from machine to machine.
If you are aren’t sure though what may be best, you may be hesitant to spend the money to start using a virtual machine. In these cases, VirtualBox is a great solution as it will let you start using a virtual machine for no charge. With that said, it will require a bit more technical knowledge to get one setup, while the paid applications will provide tools to help you get setup. Parallels, for example, provides buttons when creating a new virtual machine to install Chrome OS, Ubuntu, Android, and OS X Mountain Lion using the Recovery Partition with a click of a button.
Virtual machines are very powerful tools to help you accomplish more on your Mac. The next step for you is to integrate a virtual machine into your workflow. The paid solutions we’ve discussed will be easiest to integrate into your workflow as they allow you to more deeply integrate the applications and machine as a whole into your Mac. Let me know how you’ve integrated your virtual machine and what it has helped you accomplish!