PLAY WINDOWS GAMES ON LINUX
Discover how to get classic Windows games working in Ubuntu.
Game developers are increasingly taking advantage of the growing market in Linux gaming, but that’s not always been the case, and even now some games aren’t released outside of Windows. Thanks to a clever tool called Wine, though, you can run many Windows games — and other apps, including Office — as though they were native to Linux.
Wine provides a skeletal virtual version of Windows, inside which you install extra components and perform various tweaks (for example, selecting which version of Windows you want to emulate) to get your app working. Sadly, it’s not a silver bullet that will get all your Windows games working in Linux, but it should be able to give you access to at least some of them.
The biggest hurdle is that Wine is a command-line tool — great for purists; not so convenient if you want to point and click your way to gaming heaven. Thankfully, others have developed graphical ‘wrappers’ that sit on top of Wine to make it easier to use from the Ubuntu desktop.
In this guide, we’re focusing on one such free tool called PlayOnLinux. Not only does it provide a graphical front end, but PlayOnLinux (or POL to its pals) provides a series of pre-built scripts that, in theory, make it easy to install and play specific games. As you’ll see, in practice that’s not always the case, but we’ll take you on a tour of the program’s features, plus step you through the process of installing through scripts and manually to hopefully get your game up and running.
We’ll also explore an alternative Wine wrapper (and touch on another way to play Windows games in Linux), plus reveal how to play old DOS games in addition to Windows classics. So, plug in your game controller, dig out your old Windows discs, and prepare to enter gaming nirvana.
For the most part, playing Windows games in Linux involves the Wine emulator. PlayOnLinux (POL) is effectively a more user-friendly front end to Wine, enabling you to configure and access it from outside the command line. Generally, Windows games are played in a 32-bit environment, so if you’re running a 64-bit build of Linux, you need to open a Terminal window and issue the following commands:
$ sudo dpkg --addarchitecture i386 $ sudo apt-get update The following steps install the latest version of Wine:
$ wget -nc https://dl.winehq.org/wine-builds/Release.key
$ sudo apt-key add Release. key
$ sudo apt-add-repository https://dl.winehq.org/winebuilds/ubuntu/ $ sudo apt-get update && sudo apt-get install --install-recommends winehqstable
Note: This is a hefty install — around 800MB — so make sure you have sufficient drive space. Once done, you can move on to install POL itself:
$ wget -q “http://deb.playonlinux.com/public.gpg”-O-|sudo apt-key add -
$ sudo wget http://deb.playonlinux.com/playonlinux_ trusty.list -O /etc/apt/ sources.list.d/playonlinux.list
$ sudo apt-get update && sudo apt-get install playonlinux Open Launcher and type PlayOnLinux to launch the app. When prompted, we recommend clicking Yes to anonymously record and share your hardware configuration with POL the first time you attempt to run a Windows program — this helps determine its suitability for similar setups as yours.
The main screen appears and you might be immediately informed that a newer version is available — if that’s the case, go to www.playonlinux.com/en/download.html and save the latest deb file (4.2.12) to your Downloads folder, then open a Terminal window, and type the following to install it:
$ sudo apt install ~/Downloads/PlayOnLinux_ 4.2.12.deb $ playonlinux --version This should now read ‘4.2.12’. Launch PlayOnLinux again.
INSTALL A SUPPORTED GAME
When the main screen appears again, click ‘Install a program’ and the Install menu appears. Click the Games button to see a list of supported games. Either browse through the list or use the Search button to find a specific game. Some of the games listed require the original disc to run, so make sure that’s handy if required.
If you find the game you want, click Install and note the warning: Games should always be installed to ‘drive C’ of the virtual machine; don’t automatically launch the game at the end of the installation if asked; and only reboot virtual Windows if asked to by the program. Click Next.
You’re also told how POL isn’t related to WineHQ — one additional advantage of POL is that it allows you to install and run multiple versions of Wine at the same time, so if an earlier version is known to work with a specific game, the POL script installs that and uses it automatically. This warning merely points out you should address any problems you encounter to the POL website, not WineHQ. Click Next again.
The installation wizard proper launches — work your way through it as you would with any other Windows program. Step one may be to download a specific version of Wine (and required prerequisites) known to work with the game you’ve chosen — this is done automatically for you.
Next, you might be prompted to choose the game source. This could be a setup file you’ve downloaded manually to your PC, a program download (which POL handles for you), a Steam store version (in which case, a virtual version of Steam needs to be installed), or the original game CD.
Any known additional prerequisites, such as Microsoft fonts, are now flagged up and installed automatically for you. Here, the automatic wizard comes into its own, highlighting settings and Windows elements you may not be aware of. You might also be asked additional questions, such as how much memory your graphics card has; enter the following in a Terminal window if you’re not sure. sudo dmseg | grep drm If the script continues to run properly, you can now skip to ‘Install the game’ on page 68.
FIND AN UNSUPPORTED GAME
If you can’t find your game listed in PlayOnLinux — or the script fails to work (see the box opposite for a workaround involving Steam-powered games) — don’t panic (yet). Head to the Wine Application Database at appdb. winehq.org and type the name of your game into the Search box. Scroll down,
and click the first AppDB result. Note the game’s rating: Platinum and Gold indicate the game should work with few problems; Silver and Bronze suggest there may be issues, such as random crashes; Garbage means it won’t work. If multiple versions are listed, choose the one closest to your distro and the game.
From here, work through the ‘Test Results’ and ‘Known Bugs’ to see how other people have fared, then expand ‘HowTo/Notes’ to see what guidance there is in terms of prerequisites, which version of Wine to choose and so on. Also check Comments for further information.
In some cases, you receive detailed instructions on what extras to install and how to configure your virtual disk, but sometimes the notes are incredibly sketchy. Try Googling the name of your game along with Wine or PlayOnLinux to see if you can find more information, typically via forum posts from people asking the exact same questions you.
If you’re happy there’s a good chance the game will work, make sure you have the correct version of Wine installed (you can install multiple versions). In PlayOnLinux, open the Tools menu, and select ‘Manage Wine Versions’. You’ll see a list of available Wine versions on the left under the ‘ Wine versions (x86)’ tab. Scroll to find the one recommended and click the > button to install it.
Close the versions manager window, then click ‘Install a program’, followed by ‘Install a non-listed program’. Click Next, then choose ‘Install a program in a new virtual drive’ and click Next again. Give a name for your game’s virtual drive — the game’s name should suffice. You’re given three optional choices to select: choose a different version of Wine; configure Wine; and install some libraries. Select those you’ll need — ‘Use another version of Wine’ almost certainly — then click Next. If you’re choosing a different version of Wine, select it from the list. Click Next. Leave ‘32-bit Windows installation’ selected, and click Next again.
If you opted to install additional libraries, you’re given a list of options marked with a POL prefix. They’re largely self-explanatory — you’ll see many refer to installing additional components, such as DirectX or GDIplus, for example.
If you opt to tweak Wine settings, the Wine configuration window opens.
This is split into seven tabs, all of which are largely self-explanatory. Key ones to consider are Libraries, where you can specify DLL overrides for compatibility purposes: Graphics for determining whether the program runs full-screen or in its own desktop window, and Audio for tweaking sound settings, should you need to. Click OK when done.
INSTALL THE GAME
Whether you’re installing from a script or manually, the actual game setup process is the same. Hopefully, your CD or DVD will be automatically detected, otherwise click the Browse button to locate your game’s setup file — if it’s on CD or DVD, select the disc in the Places menu. Locate the file you need to run — try ‘setup.exe’ if there’s no guidance from the AppDB — and click Open, then Next. PlayOnLinux now tries to install the game.
You should see a setup screen from the program itself, which is actually running inside the virtual drive POL created — in other words, proof your skeletal version of Windows is up and running. From here, it’s a case of following the game’s own wizard through to see whether it’s able to complete successfully — leave the default file location selected when prompted. If errors are thrown up, you may find the game still runs, so attempt to continue to the end if possible by clicking Next.
If successful, you’re prompted to choose a file that PlayOnLinux will use as a shortcut. Select it from the list, or click Browse if none is provided to hunt your virtual drive for one. It uses the Windows filesystem, so start your search under C:\Program Files. Once done, you’re prompted to add as many additional shortcuts as you need. Leave ‘I don’t want to make another shortcut’ selected and click Next when done.
These shortcuts appear on both your desktop and the main PlayOnLinux window; the former enables you to launch your game without having to open PlayOnLinux first, but can be safely deleted without removing the others. You can recreate desktop shortcuts from the main PlayOnLinux window by selecting a shortcut and clicking ‘Create a shortcut’ in the left-hand pane.
THE MOMENT OF TRUTH
It’s time to see how your game plays — if you’ve installed it manually using
a guide from AppDB, you should have forewarning about any potential issues, but your experience may be different. Double-click the shortcut, which should launch the game directly or open Wine Explorer (in which case, click the shortcut again). The game will hopefully launch, and you can start playing it. In most cases, however — particularly if you’ve installed it manually — things won’t be quite that simple, in which case, you may need to dig deeper into your virtual drive’s configuration.
First, the game may change your desktop resolution to 640x480 and not reset after it’s finished (or crash, leaving you stuck with only the top-left corner of your screen showing). To restore your original desktop resolution, press Ctrl-Alt-T to open a Terminal window, then type the following, and hit Enter: $ xrandr -s 0
The screen blanks momentarily and your default resolution is restored. To prevent this happening again, try running the game in a virtual window: Click Configure, select your virtual drive, and switch to the Wine tab. Click ‘Configure Wine’ and wait for the Windows-like multi-tabbed window to appear. Switch to the Graphics tab, and select ‘Emulate a virtual desktop’, then set it to the game’s resolution: 640x480, 800x600, or 1024x768.
The POL configuration window also offers more configuration options — the Wine tab gives you access to your virtual drive’s Task Manager, Control Panel and a Kill Processes option, if you’re having trouble shutting it down, for example. Return to the General tab to run arguments when launching your game. The ‘Install components’ tab enables you to install more Windows components, while Display enables you to experiment with various settings that may or may not fix display glitches. Lastly, Miscellaneous lets you open a shell to your virtual drive or manually launch a Windows .exe file (a setup file, for example, not covered under ‘Install components’).
As before, these features are quite technical and you’re best served by investigating the POL forums and other web resources for help in understanding and using these with specific programs. And if that’s too technical, check out the box on the right for an alternative to PlayOnLinux that may not be free, but is simpler to use, better supported and provides working scripts for a greater number of games.
Configure your virtual desktop using the Wine configuration dialog box.
Games are installed just as they would be in Windows.
Check for patches after installing your games.
POL enables you to run multiple versions of Wine at once.
You only need the command line to install Wine and PlayOnLinux.
POL provides literally hundreds of scripts for games.
You can tweak your virtual desktop via a series of tabs.
Run games inside their own virtual desktop window if necessary.