A complete guide to running windows software on linux

Table of contents

While many applications provide versions for Windows and Linux operating systems, some remain windows-only. While not compatible with all windows programs, wine can emulate a significant amount of them and make them available on linux systems without the overhead of a full virtual machine.

Installing wine

We are assuming a debian-based system for all installation commands. Other distributions will have similar packages, consult your specific package manager for those.

sudo apt install wine wine64 wine32 ttf-mscorefonts-installer

This ensures the wine installation can handle both 32bit and 64bit systems and avoids a common bug with rendering Microsoft TrueType fonts on wine.

Running wine for the first time will take a short moment while it sets up the default wine prefix for the user usually in ~/.wine.

Running standalone Windows programs

Many programs won't need to be installed to run. For those programs, simply start them from a terminal:

wine my_program.exe

You can also builtin commands this way, for example the Windows Command Prompt:

wine cmd

Or execute batch files:

wine cmd /c my_script.bat

Install and uninstall programs

Installing programs on wine works just like running a standalone program:

wine winrar_installer.exe

This will start the normal graphical installer. Following the installation instructions will make the software available on the host system. If you are running a modern window manager like Gnome, the program will show up along all the other installed programs when pressing the command/windows key.

If not, it can be started through wine directly:

wine winrar

When installing programs in a wine prefix, make sure to consult the WineHQ Application Database, which contains downloadable .exe files for many programs, as well as notes on known good versions, bugs and workarounds.

To uninstall a program previously installed on wine, start the graphical uninstaller:

wine uninstaller

Simply select the software you want and click the "Modify / Remove Program" button:

After following the uninstaller window's instructions, the software will be removed from your wine prefix.

Managing the wine config

By default, wine installations on debian systems ship with the winecfg tool to manage settings around the virtual windows environment

wine winecfg

This will open a configuration window like this:

If you wanted to change the windows version that wine uses, you can do this in just a few steps. First, check the current version:

wine cmd /c ver

For the default Windows 7 version, you should see something like this:

Microsoft Windows 6.1.7601

now, open the Applications tab on winecfg and select "Windows 10" from the "Windows Version" dropdown:

After clicking the "Apply" button, checking the version again will show it correctly changed to Windows 10:

wine cmd /c ver

It should now output something like this:

Microsoft Windows 10.0.18362

Fixing window focus issues for Alt+Tab and fullscreen

For some programs running through wine, using shortcuts like Alt+Tab or similar to change focus to a different window can lead to bugs where the wine applications stops responding or ignore mouse/keyboard inputs. This is usually a problem with focus handling by the driver, which can often be adjusted by setting the UseTakeFocus registry key with value N.

For a quick automated fix, this command will solve the problem:

wine reg add 'HKEY_CURRENT_USER\Software\Wine\X11 Driver' /t REG_SZ /v UseTakeFocus /d N /f 

If you prefer the GUI method, first start the registry viewer:

wine regedit

Next, navigate to HKEY_CURRENT_USER > Software > Wine > X11 Driver. The X11 Driver folder may not exist; if it doesn't, right-click the Wine folder and choose New > Key :

Make sure to use a capitol "X" and keep the space for the name "X11 Driver".

Next, select the new X11 Driver folder on the left and then right-click in the white space on the right to choose New > String Value from the context menu:

Name the newly created string value "UseTakeFocus", then right-click it and select Modify...:

In the new window that pops up, type N as the value for the UseTakeFocus string value and press the "OK" button:


You can now close the registry editor window. Programs running through wine should now behave as expected when switching between windows and out of fullscreen.

Fixing permission errors

When using wine, you may run into errors like this:

wine: could not load kernel32.dll, status c0000135

This is most often caused by permission errors in the wine prefix, for example if you ran wine with sudo or as root (don't ever do that, it wreaks havoc on your wine prefix). You can try fixing the permissions:

cd $HOME && sudo chown -R $USER:$USER .wine

If this doesn't work, you will likely have to reinstall your wine prefix. You can do that by renaming (or deleting) the ~/.wine directory, and running wine again to have a new wine prefix generated for you:

rm -r ~/.wine && wine cmd /c exit

Be careful to only run the wine command for wine prefix directories that were created as the current user, stay away from sudo or using .wine/ directories from other users!

Fixing invisible text

If programs work correctly, but text inside (especially in menus) is invisible, you are likely missing the core fonts. You can add them to your wine prefix automatically:

winetricks corefonts

The command will download and install several common text fonts. Once finished, text should be displayed properly for programs run through wine.

More articles

Essential SSH commands

Securely managing remote servers

How software compression works

Making files smaller without losing information

Checking disk health in Linux

Identify bad drives before they fail

Modern linux networking basics

Getting started with systemd-networkd, NetworkManager and the iproute2 suite

Understanding how RAID 5 works

Striking a balance between fault tolerance, speed and usable disk space

A practical guide to filesystems

Picking the best option to format your next drive