How to install and configure Wine in Ubuntu?- Stack All Flow
Tags: ubuntu, softwareinstallation
Published: 2021-11-27 06:22:54

---
title: How to install and configure Wine in Ubuntu?- Stack All Flow
published: true
date: 2021-11-23 15:59:50 UTC
tags: Ubuntu,softwareinstallation
canonical_url: https://stackallflow.com/ubuntu/how-to-install-and-configure-wine-in-ubuntu/
---

<header>
<p><span style="font-size: 1.2em; color: initial;">software installation</span><span style="font-size: 1.2em; color: initial;">wine</span></p>
</header>

I am looking for a step by step instruction to guide me in the ways of installing, configuring and debugging many of the issues new users have when dealing with Wine in Ubuntu.

What is the recommended way of installing Wine, some of the key issues that it has and how to solve them?

If I have a specific problem with an App in Wine, how do I go about solving it? What are the recommended steps to ensure that I can fix a problem related to an app I wish to use?

#### Accepted Answer

If you want to use the latest development/staging version of Wine, please make sure to follow the guide in the [Official WineHQ Guide for Ubuntu](https://wiki.winehq.org/Ubuntu), basically covering:

- If you are using a 64-bit Architecture, then enable 32-bit for better compatibility
```
sudo dpkg --add-architecture i386

```
- Add the Wine Key, Wine Repository & Update Repositories
```
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key

```

We would add the repository like this (`lsb_release -sc` will automatically fetch the [codename](https://wiki.ubuntu.com/DevelopmentCodeNames)):

```
sudo apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu/ $(lsb_release -sc) main"
sudo apt update

```

- Then install the version of Wine you wish to use:
  - **Based on Wine Development (Stable)** (eg: 4.0)
```
sudo apt install --install-recommends winehq-stable

```
  - **Based on Wine Development (Testing Stage)** (eg: 4.1)
```
sudo apt install --install-recommends wine-devel winehq-devel

```
  - **Based on Wine-Staging (Bleeding Edge)** (eg: 4.1.1)
```
sudo apt install --install-recommends wine-staging winehq-staging

```

Lastly run

```
WINEARCH=win32 winecfg

```

in the terminal to make sure it configures Wine correctly (In that order). You will also need to install `winetricks` (Another configuration package, really helpful for installing Windows components like .NET Framework and other needed libraries). So after this, please do:

```
sudo apt install winetricks

```

Video Demostration showing Wine 1.9.X in Action – [Wine 1.9.X Performance](https://youtu.be/WiJDgKQRmQc "Wine 1.9.X Performance")

## 1. Differences between Wine Stable, Development & Staging versions

**Stable** versions offer less bugs with better stability and receive updates every 3-6 months after release.

**Development** version is the next stable version in development and receives updates every 2 weeks.

**Staging** version is the same as Development Version but includes all patches and enhancements from [Wine-Staging](https://www.wine-staging.com/)

The decision to stick with the stable version (Even number versions: 1.0, 1.2, 1.4…) or with the unstable versions (Odd number versions: 1.1, 1.3, 1.5…) is up to the user, the main difference is compatibility and performance which are both enhanced in the Development version. You get the latest fixes it offers, and also become a tester that can help in the development cycle.

## 2. Installing the Recommended Stable Wine version (from PPA)

In the terminal type the following to add the Wine PPA, update repositories, and install latest Wine & Winetricks version:

```
wget -nc https://dl.winehq.org/wine-builds/Release.key && sudo apt-key add Release.key && sudo apt-add-repository -y https://dl.winehq.org/wine-builds/ubuntu/ && sudo apt update && sudo apt install wine-devel winehq-devel winetricks

```

or you could include the Wine 32-Bit Arch (Better support) and configuring winecfg (This should only be applied to new installations since it will move the existing Wine installation to a folder called winebck):

```
sudo dpkg --add-architecture i386 && wget -nc https://dl.winehq.org/wine-builds/Release.key && sudo apt-key add Release.key && sudo apt-add-repository -y https://dl.winehq.org/wine-builds/ubuntu/ && sudo apt update && sudo apt install wine-devel winehq-devel winetricks && export WINEARCH=win32 && winecfg

```

## 3. How to know which components an application needs

To find out what components an app needs, look in the [Wine Application Database](http://appdb.winehq.org/). It lists if the application is usable, what components it needs and how to install them.

## 4. How to install additional components, DLLS and Libraries to Wine

To have a working and enhanced Wine environment for your games and apps, I suggest you use `winetricks` to install additional components which offer better compatibility with games. To have a better working system do the following here is an example for HL/HL2 (Non-Steam. For the Steam Version go here: [How can I install Steam?](https://askubuntu.com/questions/1784/how-can-i-install-steam) . Know that [Half-Life](http://store.steampowered.com/app/70/) and HL2 are natively supported in Ubuntu):

To play HL/HL2 you need the Wine PPA as mentioned above. After opening `winecfg` at least once on the terminal, open `winetricks` by running `winetricks --gui` then follow this steps:

Select **Select the default wineprefix**

![enter image description here](https://i.stack.imgur.com/zO9TV.png)

Select **Install a windows DLL or component**

![enter image description here](https://i.stack.imgur.com/MvhTA.png)

Install all that I have marked (and any additional you need). This covers many apps:

![enter image description here](https://i.stack.imgur.com/GtGzo.png)

![enter image description here](https://i.stack.imgur.com/NJi9D.png)

![enter image description here](https://i.stack.imgur.com/691J7.png)

![enter image description here](https://i.stack.imgur.com/8aSrF.png)

Right click the installer for HL/HL2 and select **Open with Wine**. Both games should work perfectly. This applies to apps in general and depending on the app you will need to install more or less components.

You can also install each component in terminal by adding the name of the component after the `winetricks` command:

`winetricks vcrun2010` – Will install vcrun2010 using winetricks

`winetricks xna40` – Will install xna40

## 5. Troubleshooting a Wine App

Sometimes, when running an App one or several of the following can actions can happen:

- Frozen App
- Wine opens a Blue window for a moment and then closes it
- Nothing appears to happen
- Inside the Wine window everything is Black in the start or at some point
- For most of this problems there are solutions. Here are the recommended steps for you to start troubleshooting your way into a Wine app:

`sudo apt-get install libtxc-dxtn-s2tc0` ( note in recent version of Ubuntu `libtxc-dxtn-s2tc0` is not longer needed )

Wine has come a LONG way from the days where newer games could not be played. It has gotten to a point where playing in Ubuntu is effortless. Wine has even some support for SM4.0 and DirectX 10/11 on Wine 1.6. If the problem persists it means that either your video card does not support this or you are missing the correct libraries.

Another reason that Wine might not detect Shader Model is because it might be set to **Disabled** in the Winetricks. Open the Dash and type `winetricks`. Select your wineprefix then **Change Settings**. Then look for the **glsl=enabled** option and select it. This should solve the Shader Model issue. Cases like the game Limbo are solved this way.

## 6. How do I open multiple Wine apps without them using the same Window (Overlapping)

You can setup multiple Wine windows by adjusting some Wine parameters before starting each individual Wine program. The fastest way is to open the terminal where the executable of the app you want to run exists. Let us assume it is the **Wow.exe** app. Then simply type the following:

```
wine explorer /desktop=WOW,1024x768 "Wow.exe" -opengl -console

```

This would open the Wow.exe executable with a Window titled “WOW”, a resolution of 1024×768 for that specific Window and it would apply the parameters -opengl and -console to the Wow executable. Now assuming you have the game installed somewhere else, you would the following change:

```
wine explorer /desktop=WOW,1024x768 "/media/cyrex/fun/wow/Wow.exe" -opengl -console

```

This executes Wow.exe assuming it resides in the folder wow inside a partition called fun in your /media/USER folder. The output should be similar to this when running for example 4 apps:

![Wine](https://i.stack.imgur.com/Kbsdt.png)

There is a more easier way to accomplish this. The idea is to create a Desktop shortcut by right clicking on the Desktop and selecting **New Document** –> **Empty Document**. This should create an “Untitled Document” file on your desktop. Now open the file and paste in it the following:

```
[Desktop Entry]
Type=Application

```

Now save it and rename the file to the application you want to open but at the end add “.desktop”. It will turn into an “Executable Windows Icon”. Now right click the Icon again and go to **Properties** –> Permissions –> Activate **Allow executing file as program**. Now go to the **Basic** Tab and insert the information you need to execute that wine app. The end result should be something like this:

![enter image description here](https://i.stack.imgur.com/1vrvs.png)

## 7. Does having Ubuntu 64 bit influence Wine

Yes, having Ubuntu 64 Bit will also set Wine as 64 bit. This will create several problems for many Windows apps that only work on 32 Bit, for example not being able to install several of the .NET Frameworks since they will only work on the 32-Bit version, which will result in the user not being able to run many Windows applications. To solve this you need to do the following after having succesfully installed the PPA version as I mentioned above. Immediately afer installing the PPA wine package and before opening `winecfg` open the terminal (Make sure you are at your home folder by typing `cd ~`) and type the following:

```
rm -fr ~/.wine  
export WINEARCH=win32  
export WINEPREFIX="/home/USER/.wine"  
winecfg

```

Change **USER** with your user account. For example in My case, that line would read `export WINEPREFIX="/home/cyrex/.wine"`

With this method you have changed the Wine architecture to 32 bit and on the moment you open Winecfg, it will configure all the Windows versions available to 32 Bit.

## 8. Alternatives to Wine PPA

**PlayOnLinux (PoL)**

Although you can actually install and configure everything you need with Wine alone and it’s complementing apps (winetricks, regedit, explorer) using PoL can save you some trouble and time when installing an application. With PoL you can find a list of apps that you can select and install in it’s database:

![enter image description here](https://i.stack.imgur.com/1f22V.png)

and by simply selecting to install you achieve the following benefits:

- Creating an independent container which holds the app installed, a specific Wine version for the app installed (In some cases, a specific Wine version works better for a specific app than the current Wine version).
- Automatically installing any additional DLL and Components the app needs to function correctly.
- Adding the appropriate registry keys the app needs
- Of course, it is important to know that PoL works side by side with Wine and it needs Wine to work correctly (It is based on it). In many cases, an app might not work with PoL but will work with the default Wine configurations I have mentioned in this guide. So if you find the app you want to use in PoL, great. But if you don’t find it, remember you always have the alternative to using the default Wine to install and configure the app.

## 9. What are some special parameters and tips I can use with Wine

There are a couple, for example:

**COMMANDS**

`wine --version` – Shows the version of wine

`wineserver -k` – Kills all wine versions for the specific user. This is useful if your Wine app is frozen, took the whole screen and does not let you use Ubuntu, has the mouse or keyboard focused on it and other Wine issues that might appear with some apps.

`wine explorer` – Will open an explorer similar to the Windows Explorer

`wine explorer /desktop=X,Y` – Creates a virtual desktop where **X** is the name of the Desktop Window and **Y** is the resolution of the Window. For example: `wine explorer /desktop=WOW,1024x768 Wow.exe`

`regedit` – Will open the regedit version of Wine similar to the Windows one.

`wine uninstaller` – Will open the Add & Remove of Wine similar to the one in Windows. Here you will be able not only see which apps you have install and uninstall them, but also be able to install new apps if you wish.

`winetricks` – Will open the winetricks app to install missing Libraries, DLLS and Components essential for the correct functionality of many Windows apps.

`winecfg` – Will open the Wine Configuration where you can set Video, Sound and Windows version.

`wine ipconfig` – Shows you the IP that Wine can see. Similar to ipconfig.

`wine netstat` – Shows you the IP/Port connections made. Similar to netstat.

`wine start` – Sets the working directory for the executable. This option helps in cases where the executable only works from the same folder and not from a full path. An example is if you wanted to run a .bat file or simply execute a command from another folder (eg: Parent folder), you would do something like this, assuming we are not in the same folder as MetroLL.exe:

```
 `wine start /d "C:\Program Files\GMT-MAX.ORG\Metro Last Light" MetroLL.exe`

```

This would do two things, it will first set the directory to the `Metro Last Light` folder and then it would run the `MetroLL.exe` mentioned at the end. This is similar as running the executable from the same folder but it has the advantage of running the app from any other place. The thing to know here is that:

- Wine does not like Unix paths, so you need to separate folders with `\` instead of ``
- You need to use an absolute path. You need to start from `C:\` to make sure the executable will always work as it should.
- If the executable is outside the `C:` drive, then add the corresponding letter. For example, to execute a Windows binary outside of Wine, you would use the `Z:\` letter since `Z:` normally points to the Linux system’s root directory.
- If in doubt ask the command for help with the `/?` parameter, (eg: `wine start /?`)

`export WINEPREFIX` – This variable is used to change the Wine Prefix to another location. For example if you wish to merge PoL and Wine (Not recommended since PoL has multiple Prefixes) you can do the following:

```
   `export WINEPREFIX="/home/USER/.PlayOnLinux/wineprefix/PREFIX"`

```

Where PREFIX is the one you want to merge with Wine. You would have to run winecfg again.

**TIPS**

- wine explorer /desktop=WOW,1024×768 “/media/cyrex/My Partition/World of Warcraft/Wow.exe” -opengl -console

- Parameters that are applied to an app should always be OUTSIDE the quoted strings. Using the example above, we can see **-opengl** and **-console** outside the quotes.
- When dealing with apps that take hold of you mouse and/or keyboard, you can use `wineserver -k` to kill the app, or simply opening the App in Windows mode or setting the Windows mode with the `wine explorer /desktop` parameter will save you from having this mouse/keyboard problems.

## 10. Stability, Performance and App Support Wine offers to end users

**APP SUPPORT**

I have tried Wine since 2005 and seen how the developing process in Wine under Ubuntu has been quickly catching up to the latest games.

Before Wine 1.2 came out around 2012, it was difficult to get many apps working on Wine, but after [Wine 1.2](https://www.winehq.org/announce/1.2) came out it was a totally different result. Even more so after [1.4 came out in 2012](https://www.winehq.org/announce/1.4), [1.6 in 2013](https://www.winehq.org/announce/1.6) and then [1.8 in 2015](https://www.winehq.org/announce/1.8). Many cases started to appear where they would work out of the box. Cases like Deep Space 2 which is/was one of the latest games I could play at that moment and which I tested 3 days after it was released. Alice in Wonderland (The new one I mean), The Sims 3, World of Warcraft, Amnesia and others. Even Skyrim could be played. These are games that demand powerful graphics and you can play them with little to no additional setups other than the normal install provided above.

To know what games you can play on Wine I recommend visiting the Wine App Database: [http://appdb.winehq.org/](http://appdb.winehq.org/) which holds more than 10K+. This includes information about their performance & stability and it helps in knowing if a game is playable.

The Wine App Database also offers a **Ranking** which determines what games can be played with less issues, if any. When you see this ranks, you have an idea if the App will work or not. Mind that you need to also take into consideration what hardware and Wine version the tester shows on the Wine Database. The rankings are as follow:

**Platinum Rank** – Means you have an almost 100% chance the app will work out of the box.

**Gold Rank** – Means you might find yourself doing a little bit of configuring but it will work out at the end.

**Silver Rank** – Means that the app will run, but might have graphical, sound or control issues.

**Bronze Rank** – Means the app will not work correctly.

**Garbage Rank** – Means the app still does not work and probably will not even install. The only way you could make it work would be when Superman starts eating kryptonian cereal in the morning.

For reference, a couple of years ago the amount of Platinum games was less than 50. In 2012 you could find [More than 1.5K games](http://appdb.winehq.org/objectManager.php?bIsQueue=false&bIsRejected=false&sClass=application&sTitle=Browse%20Applications&iItemsPerPage=25&iPage=1&sOrderBy=appName&bAscending=true) out of which almost 200 were in the [Latest Titles](http://appdb.winehq.org/objectManager.php?bIsQueue=false&bIsRejected=false&sClass=application&sTitle=Browse%20Applications&iItemsPerPage=25&iPage=1&sOrderBy=appName&bAscending=true). Today there are more than 6K+ Games of which 4K+ are Platinum. The more people that participate in testing Wine apps, the better. Main reason I always recommend using the PPA from Wine.

**PERFORMANCE**

For performance information see [Gaming performance difference between Windows and Ubuntu](https://askubuntu.com/questions/163903/gaming-performance-difference-between-windows-and-ubuntu/163931#163931)

## 11. How to Uninstall Wine

Uninstalling Wine can be done in 2 ways depending on your needs. If you only need to “Reset” Wine to the default values, you can simply delete the `.wine` folder and then create it again by running `winecfg`. If you have apps on the `.wine` folder that you wish to backup, now would be a good time before deleting the folder. To delete the folder simply do the following and it will take care of the whole Wine environment:

`rm -fr ~/.wine`  
`rm -fr ~/.cache/wine`

Now if you want to actually uninstall Wine from Ubuntu, you can do the following, but note that this will **NOT** delete your `.wine` or cached folder:

`sudo apt purge wine*`

This would uninstall every package related to wine, including wine, wine1.9, winehq, winetricks and more. Basically removing anything related to wine.

The post [How to install and configure Wine in Ubuntu?](https://stackallflow.com/ubuntu/how-to-install-and-configure-wine-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).