Linux Format

The Grapes of Tux

Sommelier Jonni Bidwell shows you how to get your pesky Windows applicatio­ns running on Linux, as he uncorks the latest Wine release.

-

If there’s a Windows program stopping you switching to Linux, or stopping you doing so full time, now is the time to see if it works with Wine. No, we’re not advocating drowning your sorrows or drinking on the job (uh oh– Ed). We’re here to tell you about the powerful Wine applicatio­n, which translates Windows function calls to Linux ones, thus enabling your Windows programs (be they serious tools or relaxing games) to run on our favourite operating system. That’s the theory, anyway. In practice ,things may need some tweaking. Or they may not work at all; Wine can’t work miracles yet.

Be that as it may, there is a brand new release to try: Wine 9.0. It may be the solution to all your problems. If you’ve never touched Wine before, we’ll show you everything you need to get started. And if you’re a seasoned user, we’re here to show you everything that’s new – including Wayland support and the improved Vulkan renderer. We’ve also got some tips for when things don’t work, so you don’t hit the bottle.

For gamers, we’ll show you how to use Proton – the Wine fork from Valve Software used in its Steam platform and on its Steam Deck. Valve has gone to great lengths to ensure popular titles work with Proton. So, if your favourite game doesn’t work with Wine proper, there’s a good chance Proton can sort it.

A fine bouquet

Readers (and writers) may be no strangers to one form or another of Wine, but for this outing, we’re talking about the fantastic bit of software that lets an awful lot of Windows software run hassle-free on Linux. To

avoid disappoint­ment, we’ll let you know right now that this magic doesn’t extend to running the newest editions of Microsoft Office (the one from 2010 reportedly works) or the Adobe Creative Cloud suite, although the commercial CrossOver Office from Codeweaver­s (www.codeweaver­s.com) does work. Profits from CrossOver Office directly fund open source Wine developmen­t.

Wine 9.0 was released in January 2024. So, for the first time ever, the major version number rhymes with the project title. And we’re here to show you what’s new and how to run this hitherto hapax legomenon of a release [when Wine 29 comes out, I’m going to come back to these parenthese­s and point out that your terminolog­y is wrong – ed]. That quark of Greek being awkwardly shoehorned into place, we should also note that at the time of writing, the developmen­t release 9.3 is also available. Folks who want to live on that bleeding edge will be catered for in a moment. We’re already getting ahead of ourselves.

Drinking games

For a long time, one of the most popular use cases for Wine was running Windows-only games. And in particular doing so through Valve’s Steam. This was a very messy affair, and thankfully one for which there shouldn’t really be any need these days (except perhaps for older 2D titles). This is thanks to Steam incorporat­ing its own Wine implementa­tion, dubbed Proton. Proton is the underlying technology for the Steam Play feature, which is what allows so many titles to work on the Steam Deck, Valve’s portable gaming device, which runs a custom version of Arch Linux.

Proton is special in that it incorporat­es a magical layer called DXVK (https://github.com/doitsujin/dxvk),

which allows DirectX (versions 9 to 11) calls to be converted to Vulkan. This obviates what for a long time was hobbling Wine – that translatin­g Direct3D calls to OpenGL was at best clunky and at worst impossible. So, if you want to run Windows-only games, you might want to just install Steam instead. You can use Steam to run non-Steam titles, too. Alternativ­ely, you might prefer to use the open source Lutris (https://lutris.net) or Heroic Games Launcher (https://github.com/ Heroic-Games-Launcher/HeroicGame­sLauncher),

both of which enable you to run custom Wine/Proton

versions. Or even your own manually installed DXVK if you really must.

Gamers will be keen to point out that AAA titles these days all use DirectX12. But fear not, Wine

now has its own subsystem, vkd3d, for dealing with translatio­n from DirectX12 to Vulkan. This subsystem has a counterpar­t in Proton, and that fork, imaginativ­ely titled vkd3d-proton, saw a new release, 2.11.1, in December 2023. This included fixes for such glitzy titles as The Callisto Protocol, Halo: Infinite and Pioneers of Pagonia. We’ll need to give Valve some time to rebase Proton on Wine 9, but we’re pretty confident that experiment­al versions will start appearing in Steam in the second quarter of 2024

– in fact at the time of publicatio­n Proton 9.0 beta was currently going through its release testing.

To muddy the waters slightly, Wine has its own native support for Direct3D, which is named wined3d. However, this is focused more on API emulation rather than actually getting games to work. All the same, Wine 9.0 includes improved support for DirectX10 effects, as well as miscellane­ous DirectShow and DirectSoun­d enhancemen­ts.

Wine on Ubuntu

If you’re reading this from the not-too-distant future, Ubuntu 24.04 will already have been released, and Wine 9.x will already be incorporat­ed in its repos. So, you can install it directly from the Software Centre.

But if (like us) you’re still running Ubuntu 22.04 (or a derivative of it, like Mint 21), you need to install Wine by hand. For other distros (including Debian), it’s best to refer to the official instructio­ns at https://wiki.winehq. org/Category:Distributi­ons. Since Ubuntu no longer supports 32-bit installs, you need to explicitly enable the i386 architectu­re with Dpkg:

$ sudo dpkg --add-architectu­re i386

There are still 32-bit packages in the official repositori­es (for example, the libraries required for Steam and others), it’s just Apt will refuse to install

them unless the archive is activated. Wine and Steam both allow 32-bit programs to run, and as such rely on 32-bit libraries. But they both allow you to run 64-bit programs (in entirely different ways), making the whole situation far too complicate­d to wade into right now. Instead, let’s add a directory to house external keyrings and add the WineHQ archive key to it:

$ sudo mkdir -pm 755 /etc/apt/keyrings

$ sudo wget -O /etc/apt/keyrings/winehq-archive.

key https://dl.winehq.org/wine-builds/winehq.key

Now we can add the WineHQ repo to Apt:

$ sudo wget -NP /etc/apt/sources.list.d/ https://dl. winehq.org/wine-builds/ubuntu/dists/jammy/ winehq-jammy.sources

If you’re using the previous Ubuntu LTS release, 22.04 (Focal Fossa), you need to substitute focal in the two occurrence­s of jammy above Or, if you’re using Ubuntu 23.10 (Mantic Minotaur), substitute mantic

instead. You should also be aware that 23.10 will go

end of life (EoL) in July 2024. Finally, we can update our package lists and install Wine from its own repo: $ sudo apt update

$ sudo apt install --install-recommends winehqstab­le

It’s important to note that installing Wine this way can be a little hit or miss. Which is a polite way of saying that if you blindly confirm the last command, you can royally trash your system. In particular, check that it doesn’t want to remove important-sounding packages (such as ubuntu-desktop). If it does, cancel the install and see if you can find up-to-date guidance on the official forums at https://forum.winehq.org/ viewforum.php?f=8. On our nearly clean install of Ubuntu 22.04, the install worked fine, but it did pull in some 300MB of dependenci­es, so we were careful to study the extensive output before confirming.

The Stable release should be fine for most people, but if you really must have all the latest features, you might want to try the Developmen­t release instead. In that case, install the package wine-devel instead. It’s possible to have both versions installed side by side, but the manual advises using different prefixes (directorie­s where Wine’s per-user configurat­ions are stored, see later) for each. Besides the Developmen­t release, there’s the absolute bleeding-edge Staging version; this includes some bug fixes not present in the dev version, but probably some new bugs, too. It’s also where new features are first staged, hence the name. If you think this is for you, grab wine-staging.

Tasting Notes

We’ll start simple and show you how to get the popular Notepad++ text editor running. Because of its popularity, Canonical already offers a Snap of this package (you’ll find it in the Snap Store), but behind the scenes, it’s still using Wine. You might not be using Ubuntu, or you might just not like Snaps. In which case, do read on. Grab the 64-bit (unless you really want the 32-bit one) installer from https://notepad-plus-plus. org/downloads/ then run:

$ cd ~/Downloads

$ wine npp.8.6.3.Installer.x64.exe

Update the version number to match what you downloaded. You’ll see some odd-looking (but mostly harmless) output in the terminal. If this is your first time running Wine, then the Mono (an open source re-imagining of Microsoft’s .NET framework) installer will spring into life. Then you’ll be able to click through the Notepad++ install as if you were in Windows. Wine maintains its own virtual C:\ drive, so all the standard Windows directorie­s are there. That drive is stored inside the default Wine prefix (the hidden .wine/

directory in your home folder – press Ctrl+H in Files if you can’t see it) at /home/user/.wine/drive_c/. The installer gives you the option to start Notepad++ right away, so do that and you should see that everything looks roughly as it would within Windows. Yes, the fonts might be a bit fuzzy, but generally speaking, it’s all there. Make a text file and save it if you want, or explore the applicatio­n and puzzle at why people prefer it to Vim if you’re not familiar with it.

Quit Notepad++, open a terminal and run Winecfg. This is Wine configurat­ion tool, where the current prefix can be tweaked. Again, you may see some

peculiar warnings as it starts, and again these are nothing to worry about. The Applicatio­ns tab lets you choose which version of Windows to ‘emulate’, and this can be configured on a per-applicatio­n basis. We won’t get into substituti­ng libraries here, but it is possible to specify whether to use Wine’s built-in version of a particular DLL (dynamic link library) or a native file from Windows. We will say that it’s a terrible idea to use Windows files for low-level stuff (such as gdi32.dll, ntdll.dll, kernel32.dll). Apart from one-off library substituti­ons, it’s much better to use the Winetricks script (see box) to manage libraries.

The Drives tab shows you virtual drives and enables you to set up additional ones (for example, for an ISOmounted DVD drive). Besides the C: drive, you’ll see a Z: drive, which is your root filesystem. If you investigat­e this further (seeing where Notepad++ can save a file, for instance), you’ll see that Wine has access to the same bits of the filesystem as you do. So, if you were to run some Window malware, it could very well trash your home directory (or other places where you have write access). The other tabs in Winecfg are best explained by the documentat­ion.

Next, let’s check out the big news with this release, namely Wine’s improved Wayland support. If you’re not running Wayland, this won’t be of much interest, but Ubuntu (where Wayland has been the default for some time, even on Nvidia cards) users in particular would be well advised to check this out. Whatever your distro, first check that you’re indeed running Wayland with:

$ echo $XDG_SESSION_TYPE

Hopefully, this says wayland . If not, log out and see if your login screen gives you a choice of Wayland or X.org. To enable the Wayland support, we need to edit a registry key. Windows aficionado­s might want to use Wine’s own Registry Editor (see screenshot – p.45 – or run wine regedit to see it for yourself), but it’s probably easier to just type:

$ wine reg.exe add HKCU\\Software\\Wine\\

Drivers /v Graphics /d x11,wayland

We also need to unset the $DISPLAY environmen­t variable, which is an X11-thang:

$ unset DISPLAY

There isn’t anything else user-centric to configure here, but with this enabled, Wayland users should see better HiDPI support, have more luck when using multiple monitors and enjoy better desktop integratio­n. In particular, titles exhibiting strange behaviour when using mouse-look should behave much better. Wine’s

(still experiment­al) Vulkan driver now supports Vulkan 1.3.272, so Windows titles using new Vulkan extensions there will work and look nicer. See the Winetricks box (right) for instructio­ns to enable the Vulkan renderer.

We avoided discussion of 32 vs 64-bit executable­s earlier, but now we’re settled in, we should note that Wine now handles 64-bit Windows binaries in a much more robust way. This is part of a years-long effort to revamp the WoW64 (Wine on Windows 64) componentr­y. This allows 32-bit programs to run without 32-bit libraries on the host system. And the so-called new WoW64 mode also allows such apps to run on a purely 64-bit system. This mode isn’t yet enabled by default (which is why our instructio­ns add the i386 architectu­re), and to use it you have to build from source. The default old WoW64 mode runs 32-bit apps inside a 32-bit process. The Wine devs state that while the new mode should be fine, old mode is better for 16-bit stuff (maybe you prefer the Windows 3.1 version of Paint) and OpenGL programs.

 ?? ??
 ?? ?? Wine has its own Registry Editor and (rather minimal) Control Panel, styled just like in Windows.
Wine has its own Registry Editor and (rather minimal) Control Panel, styled just like in Windows.
 ?? ?? Some Windows users swear by Notepad Plus. Now you can swear by (or at) it in Linux.
Some Windows users swear by Notepad Plus. Now you can swear by (or at) it in Linux.
 ?? ?? You can use the Winetricks script from the command line, or through this fetching wizard.
You can use the Winetricks script from the command line, or through this fetching wizard.
 ?? ?? Steam Play is enabled by default on Linux for supported titles, but flip this switch if you want to try it on others.
Steam Play is enabled by default on Linux for supported titles, but flip this switch if you want to try it on others.

Newspapers in English

Newspapers from Australia