Chapter 16. Using Wine

Although Ubuntu supports a wealth of different applications, spanning just about any subject you can think of, there are still occasions when it may not completely meet your needs. For example, OpenOffice.org is a fully featured office suite, providing all the functions you would expect and that exist in other similar applications such as Microsoft Office. And it can even read and write Office files. But it isn’t totally compatible with Office, because many documents display and print differently in the two packages.

And why should OpenOffice.org be fully compatible? It’s a completely different program that’s been independently developed and approaches things in different ways that are completely logical in its own frame of reference. Once you get used to it, you can produce documents, spreadsheets, and presentations that are easily the equal of any you can create in Office.

But what if you have to collaborate on documents with someone who uses Office, while you use OpenOffice.org? You will almost certainly find that you both introduce changes that don’t display correctly on each other’s computers. They may be little things like changed tab settings, different page lengths, and so on, but these little things are also time-consuming to fix.

The simple solution to this problem is to install Office on Ubuntu using the Wine program (see Figure 16-1), which stands for Wine Is Not an Emulator—a typically recursive acronym, much loved by software developers. And the same goes for any other Windows applications whose documents you may need to handle using Ubuntu. If you have Wine, you’ll usually be able to install the Windows program required to process such documents.

Yes, that’s Microsoft Word running in Ubuntu

Figure 16-1. Yes, that’s Microsoft Word running in Ubuntu

Or you may just miss some Windows programs that you feel you can’t do without, at least until you have become more used to the Ubuntu operating system. But whatever the reasons, the fact remains that in conjunction with Wine, Ubuntu is capable of running almost all your Windows applications.

As the developers will tell you, Wine is not an emulator! So, what is it? Well, let’s consider what an emulator does. In Chapter 2, I spent some time describing the Sun VirtualBox (and other virtual computer emulation systems). The first thing you notice about them is that they have to run in their own windows, which in turn contain the windows running the programs they emulate.

And even the best virtual machines run slower than the host computer because they must emulate each processor instruction. In other words, they mimic the actions of the central processing unit (CPU), the hardware at the heart of any computer.

But Wine doesn’t emulate a CPU. Instead, it provides a layer on top of Ubuntu (and other Linux distributions) that handles the application programming interface (API) calls made by a Windows program. When running on Windows, the operating system interprets these calls and performs actions in response. For example, calls might request a new window to be opened, to write some text to the screen, or to open a file, and Windows will interpret these and execute the necessary CPU machine code to make this happen.

And the same happens with Wine when running on Ubuntu. Windows programs issue calls to make things happen and Wine interprets them, executing the CPU code required, and no emulation takes place. Rather, Wine simply takes the place of Windows in providing resources to Windows programs running on Ubuntu. And because of this, Wine can run these programs natively, at the fastest possible speed.