Wine Basic Usage Tutorial
Wine, originally an acronym for Wine Is Not an Emulator, is the software you can use on non-Windows systems to run Windows software. I was dissatisfied with the Wine tutorials I saw on Steemit and decided to create my own as they failed to mention extremely useful features of Wine or the annoying bits that you generally have to work around, so here is my Wine tutorial.
This tutorial is different from others in that it includes the following topics all in the same article:
- The WineHQ Database
- Wine Bottles (WINEPREFIX)
- Wine Architecture (WINEARCH)
- Wine Tricks (winetricks)
The level of knowledge required for this tutorial is a passing familiarity with Linux. Being able to open a terminal and run commands should be sufficient.
I'll be doing this on an Ubuntu 17.10 system, but most of the concepts and commands port to other distributions, as well.
Before we do anything, you need wine installed. For Ubuntu you just apt-get install it, both the 32 and 64 bit varieties, and the winetricks scripts.
sudo apt-get install wine64 wine32:i386 wine64-tools winetricks
I only covered that because the next step may require either a 32 or 64 bit version of wine.
General Approach
When installing a new windows program under Linux there is a very simple approach to yielding the best results.
- Check WineHQ's WineDB
- Choose an Appropriate Architecture
- Create a Wine Bottle
- Configure the Bottle's level of Desktop Integration
- Run any
winetrickstweaks - Install the Application
- Run it
Check WineHQ's WineDB
Before you attempt to install any software package, you should check the WineHQ Database. If the title you wish to install has been out for a while, there's a good chance it's in the Wine Database and someone else may have explicit instructions on how to install it and get it working.
So, if you are reading this tutorial because you are trying to get a specific piece of software to work, head on over the database. They have a search box at the top of the site, use it. They have a color rating system for compatibility that range from Platinum (fully functional) to to silver (problematic at best to not working at all.)
Generally you wont find complete HOWTOs, but rather a set of instructions on how to fix specific bugs that may come up with a piece of software. One key item you may wish to look out for, is whether to run the 32 or 64 bit version of the software you are trying to install.
Choose an Appropriate Architecture
Whether the software is 32 or 64 bit is important. By default, wine attempts to run everything using a 32 bit windows architecture. This wont work very well if your application is 64 bit. One shortcut is to simply try a 64 bit wine prefix and if the application fails and the file command reveals that it's actually a 32 bit application you can try again using a 32 bit wine prefix.
For example, the 32 bit SkyrimLauncher.exe is examined:
not-a-bird@nest$: file SkyrimLauncher.exe
SkyrimLauncher.exe: PE32 executable (GUI) Intel 80386, for MS Windows
In the case of a 32 bit application, the file type is PE32.
Another example, the 64 bit Unturned.exe is examined here:
not-a-bird@nest$: file Unturned.exe
Unturned.exe: PE32+ executable (GUI) x86-64, for MS Windows
In the case of a 64 bit application, the file type is listed as PE32+ and includes x86-64.
Create a Wine Bottle
Wine supports a feature called the Wine prefix that enables you to create individually tailored Wine configurations or Wine Bottles. Essentially, you can have separate Wine environments for different software. This makes it easier to have multiple applications installed that may require conflicting settings. Configuring a Wine prefix is how you create a Wine Bottle. You set the WINEPREFIX variable to a specific directory and you create a new bottle by running a wine command. You set variables with the export keyword, this will show up in an example soon, so read on.
Once you know which architecture you want (see Choose an Approach Architecture above), you will need to set environment variables that determine where to put your new Wine Bottle and what architecture it will run.
For example, if we were creating a general purpose Windows 32 Bit bottle, we might store this in the user's home directory in a directory called wine32. To do this, we would run the following commands in a terminal:
export WINEPREFIX=${HOME}/wine32
export WINEARCH=win32
wineboot
This will set the prefix to a wine32 directory in the user's home directory, set the architecture to windows 32 bit, and then initialize the wine bottle.
If instead you wanted a 64 bit bottle, you would run the following commands in a terminal:
export WINEPREFIX=${HOME}/wine64
export WINEARCH=win64
wineboot
Both of these approaches will cause dialog boxes to pop up while it's actively configuring various components. Unless a tutorial on WineHQ says otherwise, you generally want to let it install the Wine Gecko plugin.
Note, I very commonly mix up the WINEARCH and win32 with regard to which one has an E in it, make sure the variable is WINEARCH with an E and that win32 of the value does not have an e. I know, sounds silly, but I mix this up all the time...
Configure the Bottle's level of Desktop Integration
There is a particularly annoying helpful feature of Wine where it likes to create symbolic links for the various Windows "My Documents", "My Pictures", "My Music", and "My Videos" folders. It's less annoying than it used to be, in that they don't all just link to your home directory any more, but I really don't like these links. I'd much rather keep my wine bottles self-contained. So, after running wineboot, I like to run winecfg
It will result in a dialog like the following
Click on the "Desktop Integration" tab and it should look like the following:
Next, click on each Folder beneath the Folders section and uncheck the Link to box so that they are no longer symlinks.
It will look like the following after you unlink all of those folders:
Note that this is an optional step, but I like to do this the first time I install something in case I need to delete the entire bottle, then I don't have to go hunting for any of it's droppings in my home directory.
Depending on the application it may also be necessary to configure a desktop size to prevent the program from going full screen and to confine it to a window of a fixed size. This can be found under the Graphics tab.
For example, check the Emulate a virtual desktop option and set the Desktop Size to 800x600 and then the application will be confined to an 800x600 window but it will "think" it's full screen.
Run any winetricks tweaks
If you know of a specific application framework needed by the application you are trying to install, winetricks might make it easier to install. For example, if you know your application needs a specific version of DirectX (It's not uncommon for this to be in the WineDB entry for a game), you can use winetricks to install it. Or if you need a particular flavor of IE because it's a game that uses one of those annoying HTML based patcher/launchers, you can install that.
Rather unintuitively, the script doesn't proved a top-level menu for the DLLs, but it does provide DLLs for installation if you invoke it with the dlls option.
To launch winetricks, make sure that you are in your wine bottle directory, make sure the WINEPREFIX is set, and then use winetricks dlls to view a list of application DLLs.
For example:
cd ~/wine32
export WINEPREFIX=~/wine32
winetricks dlls
You should be greeted with a window like the following:
Unfortunately the different packages satisfy varying definitions of the term "working" but generally you can install a working version of a given subsystem this way.
Install the Application
Now, you can finally install the application. If the application is distributed as an executable file, you can execute that file with the wine command. If it is distributed as an MSI file, you can execute it with the msiexec command. If the file is a zip, you will need to unzip it and then use one of the aforemntioned commands.
If it's an executable
Make sure your WINEPREFIX is set.
Make sure your WINEARCH is set.
Then just invoke wine.
For example, assuming the file was downloaded as setup.exe the following is how you would install it (AFTER doing previous sections of this tutorial):
export WINEPREFIX=~/wine32
export WINEARCH=win32
wine ~/Downloads/setup.exe
If it's an MSI file
Make sure your WINEPREFIX is set.
Make sure your WINEARCH is set.
Then invoke msiexec /i.
For example, assuming the file was downloaded as setup.msi the following is how you would install it using wine's msiexec (AFTER doing previous sections of this tutorial):
export WINEPREFIX=~/wine32
export WINEARCH=win32
msiexec /i ~/Downloads/setup.exe
If it's a ZIP file
Extract the contents of the zip file and then look for an executable or MSI file in that, then follow one of the previous two subsections.
For example:
mkdir setup
cd setup
unzip ~/Downloads/setup.zip
ls
Run it
Some applications will run after they have been installed, others will require explicitly launching them. Either way, you will likely want to launch the application again in the future. To do so you may find it convenient to create a launcher to make it easier to run the application. You can put it at the top level of the wine bottle so that it's easier to find. This also makes it easier to package up specific workarounds.
For example, the Steam program requires a special argument to work around a bug in font display. You could launch your favorite text editor, put the following in a script, and use it to launch Steam:
#!/bin/bash
export WINEPREFIX=$HOME/wine32
cd $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/Steam/
wine Steam.exe -no-dwrite
If you saved that to a file called run.sh you could do the following to launch it:
chmod +x run.sh
./run.sh
Then you could either run it from the terminal or create a shortcut for it in your graphical environment of choice.
Summary
You should have a pretty good starting point for using Wine to install windows applications under Linux.
This tutorial covered the following topics:
- The WineHQ Database
- Wine Bottles (WINEPREFIX)
- Wine Architecture (WINEARCH)
- Wine Tricks (winetricks)
References:



I remember doing this about five years ago. Then, like now, I get a laugh out of calling a window initiation process WINE. I also remember the headaches that came out of it, and how after getting frustrated that I really wanted a glass of wine.
Thank you for reminding me of this.
But did you know then that you could bottle up the instances so you could throw away the offending ones?
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Hey @not-a-bird I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x