Monday 27 October 2008

Getting started with Wine

Ubuntu offers a huge range of software from the repositories that cover all kinds of needs. For any one piece of software you can name that you use in Windows, there's a pretty good chance that something else exists in Linux that can do the same job, often for free. OK, some of them may not be as well known as their Windows counterparts, and they may require a little adjustment, but this is fairly trivial. For most people, Ubuntu can do everything they use Windows for.

But what if you absolutely need to use a specific application? Or you have other software that you bought for Windows and would like to be able to run? Or even those games you may still have?

Well, the answer is Wine. It stands for Wine Is Not an Emulator. It's a compatibility layer for running Windows programs. Essentially, it allows you to run many Windows programs on Linux. Wine recently released a stable 1.0 version after 15 years in development, and although it's by no means perfect, you may be surprised at just how good it is. I have successfully run two of my favourite games on it (Homeworld and Homeworld 2, the second of which doesn't seem to work in Vista!), and many other games are well supported and will work straight away. For some others, you can get them running with a little work - the website features a search engine so you can check the compatibility of something before you try it. If you have some Windows games you haven't been able to run, why not dig them out and give them a try?

Wine is in the Ubuntu repository, but unless you're already running the next version, Intrepid Ibex, this version may not be very up to date. It's probably better to go with the official version.

To install the current version of Wine, you need to add another repository. Open a terminal and enter the following:
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -

This will download the APT key for the Wine repository. Now, to add the repository to you /etc/apt/sources.list:
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/hardy.list -O /etc/apt/sources.list.d/winehq.list

This is the version for Hardy Heron. For Intrepid Ibex, you need to enter this instead:
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/intrepid.list -O /etc/apt/sources.list.d/winehq.list

Now to update it:
sudo apt-get update

And to install Wine:
sudo apt-get install wine

Now, Wine creates its own entry in your applications menu, as shown here on my Kubuntu Hardy system:


This is how it looks in Kubuntu with Tasty Menu, but any Ubuntu variant should show the same four items for a newly installed copy of Wine: Notepad, Uninstall, Browse C Drive and Configure Wine.

Wine works by creating a folder in your home directory called .wine. This is then set up to trick the applications into thinking they are running on Windows. Choosing the Browse C Drive option lets you open a folder inside .wine called drive_c, which emulates the C drive (the main hard drive) on a Windows install. This is where anything you install using Wine will reside.

Notepad is a clone of the Windows version, and Uninstall is essentially a copy of the Windows Add/Remove software dialogue. That leaves Configure Wine, which comes up with this:


This dialogue lets you configure Wine to help make things work. For instance, you can specify for it to emulate different versions of Windows - even to the point of being able to run one as XP, another as Vista, and a third as Windows 98, for example! This gives you huge scope to tinker and get software working.

For the most part, getting something working is easy. For a Windows EXE file, I find that whether you're using Gnome or KDE, you can just click on it as usual and it will run. You can also run it from the command line with something like this:
wine setup.exe
Other types of files are generally just as easy to run. If you have an application on a CD or DVD that you wish to install, it won't usually autorun the way it does in Windows, but instead you have to browse through the disc yourself and locate the appropriate file (which is usually setup.exe, autorun.exe, or something similar). Follow the installer's instructions as usual and it should install fine.

For more information about using Wine, I'd suggest going to their website and having a good look around. Nearly every piece of software you can think of has been tried with Wine, and they give ratings for how well it works in Wine, often including instructions.

Now, I won't claim that Wine is perfect. Not everything will work on it, and not everything that does work on it works well. But you may be surprised at how well it does do, and it's improving all the time. If there's one or two applications you use in Windows that are keeping you from making the switch to Ubuntu, why not try Wine to see if they will run?

2 comments:

Kyle Richardson said...

Another great point is the availibility of Crossover for free today. Today only!

MattBD said...

Yes, I'd heard about that too, and I've grabbed a copy of Crossover Games, though I'll wait till I'm running Intrepid before I install it.