Emulation, or Virtualization: Which is Right for You?

760

So you need to use Windows applications, but you’re not sure what the best method is. If you got through the first article in this series, Open Source Equivalent Applications for the Average User, and you are still convinced that an open source equivalent will not fit the bill, outside of running a full-blown Windows instance, you have two choices: Emulation or Virtualization. In this article I will outline each choice and help you to decide which path is best suited for your situation. This article will not dive into the how-tos of each choice (these topics will be given their own articles to finish off this series), but help you to understand these technologies and decide which one you should employ.

Of course, before I go into these choices, I want to say that I will assume you have a solid understanding of the fundamentals of the Linux operating system. Although both emulation and virtualization are not the most complicated of tasks, they are not as simple as installing a single application. Because of this it will help to understand some of the fundamentals of Linux before pressing on with attempting either of these. 

Virtualization

In a nutshell, Virtualization is running a guest operating system on top of another host operating system. Let’s define some terms before we dive any deeper.

Virtual Machine: This is an isolated environment that is capable of running an duplicate of a real environment. You can have multiple virtual machines running concurrently (if your hardware can handle the resources).

Host: The host is the operating system that is running native on the hardware. 

Guest: The guest is the operating system is the operating system that runs on top of the Host inside of the Virtual Machine. This operating system is the point and purpose of Virtualization.  It is this operating system that offers you the native environment that you need for running a particular application or service.

Virtualization Pros: The pros of using Virtualization become very apparent the minute you have the guest operating system up and running. When running an application in a virtualized guest operating system you are running that application in its native environment. What this means is that for all intents and purposes you are running that application exactly as if you were running it in a standard operating system installation. The application will know no difference, therefore it will run precisely as expected.

Another all-too-obvious pro for Virtualization is the ease and familiarity of installation. If you have installed an application you can install the Virtualization software. If you have installed an operating system you can install the guest operating system (and most likely, if you are looking into the possibilities of either virtualization or emulation you have installed an operating system). 

Virtualization Cons: The most obvious strike against virtualization is that you will have to have a fully licensed copy of the operating system you want to virtualize. This, of course, only applies to Windows (if you are virtualizing Linux you won’t have to shell out any cash). On top of that you will have to have a fully licensed copy of the software you want to use (such as Word, Quicken, Photoshop, etc). Should you choose to go the VMWare route for your virtualization software, you will also have to pay for the cost of that piece of software. So virtualization costs can add up. Another, smaller issue, is that you will have to have the necessary hardware. RAM is a key issue with virtualization. For example: In order to run Windows XP in a virtual machine you will need approximately half the amount of RAM you will need to run Windows Vista or Windows 7. If you want to run either Vista or Windows 7 you will need at least 1 extra gig of RAM to dedicate to the virtual machine with enough left over to run the host operating system.

How does virtualization work?

Windows 7 running in a virtual machineThe summation of how virtualization works is simple. The theory behind it is not. Fortunately we won’t dive into the theory behind the tools. Effectively, virtualization creates a simulated environment in which one operating system can run on top of another. This simulated operating system most often runs completely inside of a window (as you can see in Figure 1). In the example shown in Figure 1 you see a virtual instance of Windows 7 running as a guest operating system on the host operating system Ubuntu 9.04. The software used for virtualization is the open source Virtualbox. To learn how to install VirtualBox see the article “VirtualBox offers simple, easy-to-use Virtual Solution“.

Emulation

MS Office 2007Emulation is a different beast all together. What emulation strives to do is duplicate the environment of a different operating system. Take WINE for example (one of the more popular ways to run Windows applications on Linux). Although the acronym WINE stands for “WINE Is Not an Emulator”, the theory is the same. What WINE does is serve as a compatibility layer allowing Linux to make use of Windows DLL files. WINE achieves this by implementing the Windows API layer entirely in user-space instead of kernel-space with the help of the wineserver daemon.

As you can see, in Figure 2, once you successfully get a Windows application working with emulation, it seems to work fairly smoothly. In Figure 2 you are seeing Microsoft Word 2007 running in Ubuntu 9.04 with the help of Crossover.

Emulation Pros

Emulation is much more inexpensive than virtualization. With emulation the most you will have to purchase is a license for a piece of software like Crossover. Add to that the cost of any software you want to install and the price will still be significantly lower than having to purchase a registered copy of an operating system like Windows 7. Another pro to emulation is a much lower requirement for hardware. You are not running an operating system on top of an operating system, you are just running another application. So less RAM is needed and less hard disk space is needed.

Emulation Cons

The cons of emulation often are deal breakers. First and foremost you will not find your installed software works 100%. Features will be missing or the software will just seem much buggier than it should. But worse than that issue, emulation is not easy. Trying to install software with only WINE can be a nightmare. And although Crossover makes that process far easier, you will still find software doesn’t always install as you would think it should.

How Does Emulation Work?

Emulation attempts to trick the applications being installed into thinking they are being installed in their native environment. That is where many of the problems occur. WINE, being the most popular of Windows-to-Linux solutions, creates a bridge between the Linux operating system and the Windows application using a special implementation of the Windows Application Programming Interface (API). So when a Windows application tries to do something the Linux operating system doesn’t understand, WINE “translates” that instruction so that Linux can understand. WINE is a collection of mostly command-line tools that together serve to help the user install and use Windows applications. Fortunately companies like CodeWeavers have created full-blown GUI tools to replace the collection of command-line tools, making WINE far easier to use.¬†

Final Thoughts

With the help of either Virtualization and/or Emulation you can, as they say, “have your cake and eat it too”. Both offer solutions to a very complex problem and both solutions have their pros and cons. Which of these solutions is the right one for you? In following articles I will explain how to make use of both Virtualization and Emulation so you can have your Windows applications up and running.