Wine
Related articles
Wine is a compatibility layer capable of running Microsoft Windows applications on Unix-like operating systems. Programs running in Wine act as native programs would, without the performance/memory penalties of an emulator. See the official project home and wiki pages for longer introduction.
Contents
- 1 Installation
- 2 Configuration
- 3 Running Windows applications
-
4 Tips and tricks
- 4.1 Unregister Wine file associations
- 4.2 Dual Head with different resolutions
- 4.3 exe-thumbnailer
- 4.4 CSMT patch
- 4.5 CSMT via wine-staging
- 4.6 Changing the language
- 4.7 Installing Microsoft Office 2010
- 4.8 Proper mounting of optical media images
- 4.9 Burning optical media
- 4.10 OpenGL modes
- 4.11 Using Wine as an interpreter for Win16/Win32 binaries
- 4.12 Wineconsole
- 4.13 Winetricks
- 4.14 Installing .NET framework 4.0
- 4.15 Crackling sound when using PulseAudio
- 4.16 16 Bit Programs
- 5 Third-party interfaces
- 6 See also
Installation
Wine can be installed with the package wine, available in the official repositories. If you are running a 64-bit system, you will need to enable the Multilib repository first.
You may also want to install wine_gecko and wine-mono for applications that need support for Internet Explorer and .NET, respectively. These packages are not strictly required as Wine will download the relevant files as needed. However, having the files downloaded in advance allows you to work off-line and makes it so Wine does not download the files for each Wine prefix needing them.
Architectural differences
Wine by default is 32-bit, as is the i686 Arch package. As such, it is unable to execute any 64-bit Windows applications.
The x86_64 Arch package, however, is built with --enable-win64
. This activates the Wine version of WoW64.
- In Windows, this complicated subsystem allows the user to use 32-bit and 64-bit Windows programs concurrently and even in the same directory.
- In Wine, the user will have to make separate directories/prefixes. See Wine64 for specific information on this.
If you run into problems with winetricks
or programs with a 64-bit environment, try creating a new 32-bit WINEPREFIX
. See below: #WINEARCH. Using the x86_64 Wine package with WINEARCH=win32
should have the same behaviour as using the i686 Wine package.
Configuration
Configuring Wine is typically accomplished using:
- winecfg is a GUI configuration tool for Wine. You can run it from a console window with:
$ winecfg
, or$ WINEPREFIX=~/.some_prefix winecfg
. - control.exe is Wine's implementation of Windows' Control Panel which can be accessed with:
$ wine control
. - regedit is Wine's registry editing tool. If winecfg and the Control Panel were not enough, see WineHQ's article on Useful Registry Keys.
WINEPREFIX
By default, Wine stores its configuration files and installed Windows programs in ~/.wine
. This directory is commonly called a "Wine prefix" or "Wine bottle". It is created/updated automatically whenever you run a Windows program or one of Wine's bundled programs such as winecfg. The prefix directory also contains a tree which your Windows programs will see as C:
(the C-drive).
You can override the location Wine uses for a prefix with the WINEPREFIX
environment variable. This is useful if you want to use separate configurations for different Windows programs. The first time a program is run with a new Wine prefix, Wine will automatically create a directory with a bare C-drive and registry.
For example, if you run one program with $ env WINEPREFIX=~/.win-a wine program-a.exe
, and another with $ env WINEPREFIX=~/.win-b wine program-b.exe
, the two programs will each have a separate C-drive and separate registries.
To create a default prefix without running a Windows program or other GUI tool you can use:
$ env WINEPREFIX=~/.customprefix wineboot -u
WINEARCH
If you have a 64-bit system, Wine will start an 64-bit environment by default. You can change this behavior using the WINEARCH
environment variable. Rename your ~/.wine
directory and create a new Wine environment by running $ WINEARCH=win32 winecfg
. This will get you a 32-bit Wine environment. Not setting WINEARCH
will get you a 64-bit one.
You can combine this with WINEPREFIX
to make a separate win32
and win64
environment:
$ WINEARCH=win32 WINEPREFIX=~/win32 winecfg $ WINEPREFIX=~/win64 winecfg
You can also use WINEARCH
in combination with other Wine programs, such as winetricks (using Steam as an example):
WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam
To have them permanently defined for bash configuration ~/.bashrc do:
export WINEPREFIX=$HOME/.config/wine/ export WINEARCH=win32
Graphics drivers
For most games, Wine requires high performance accelerated graphics drivers. This likely means using proprietary NVIDIA or AMD Catalyst drivers, although the open source ATI driver is increasingly become proficient for use with Wine. Intel drivers should mostly work as well as they are going to out of the box.
See Gaming On Wine: The Good & Bad Graphics Drivers for more details.
A good sign that your drivers are inadequate or not properly configured is when Wine reports the following in your terminal window:
Direct rendering is disabled, most likely your OpenGL drivers have not been installed correctly
For 64-bit systems, additional multilib packages are required. Please install the one that is listed in the Multilib Package column in the table in Xorg#Driver installation.
Sound
By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in winecfg. Currently, the Alsa driver is the most supported.
If you want to use Alsa driver in Wine on a 64-bit system, you will need to install lib32-alsa-lib and lib32-alsa-plugins. If you are also using PulseAudio, you will need to install lib32-libpulse.
If you want to use OSS driver in Wine, you will need to install the lib32-alsa-oss package. The OSS driver in the kernel will not suffice.
If winecfg still fails to detect the audio driver (Selected driver: (none)), configure it via the registry.
Games that use advanced sound systems may require installations of lib32-openal.
MIDI support
MIDI was a quite popular system for video games music in the 90's. If you are trying out old games, it is not uncommon that the music will not play out of the box. Wine has excellent MIDI support. However you first need to make it work on your host system. See the wiki page for more details. Last but not least you need to make sure Wine will use the correct MIDI output. See the Wine Wiki for a detailed setup.
Other libraries
- Some applications (e.g. Office 2003/2007) require the MSXML library to parse HTML or XML, in such cases you need to install lib32-libxml2.
- Some applications that play music may require lib32-mpg123.
- Some applications that use a color management engine (e.g. pdf viewers, image viewers, etc) may require lib32-lcms2.
- Some applications that use native image manipulation libraries may require lib32-giflib and lib32-libpng.
- Some applications that require encryption support may require lib32-gnutls.
Fonts
If Wine applications are not showing easily readable fonts, you may not have Microsoft's Truetype fonts installed. See MS Fonts. If this does not help, try running winetricks allfonts
.
After running such programs, kill all Wine servers and run winecfg
. Fonts should be legible now.
If the fonts look somehow smeared, import the following text file into the Wine registry with regedit:
[HKEY_CURRENT_USER\Software\Wine\X11 Driver] "ClientSideWithRender"="N"
See also Font configuration#Applications without fontconfig support.
Installing Windows programs in Wine should result in the appropriate menu/desktop icons being created. For example, if the installation program (e.g. setup.exe) would normally add an icon to your Desktop or "Start Menu" on Windows, then Wine should create corresponding freedesktop.org style .desktop files for launching your programs with Wine.
By default, installation of Wine does not create desktop menus/icons for the software which comes with Wine (e.g. for winecfg, winebrowser, etc). These instructions will add entries for these applications.
First, install a Windows program using Wine to create the base menu. After the base menu is created, you can create the following files in ~/.local/share/applications/wine/
:
wine-browsedrive.desktop
[Desktop Entry] Name=Browse C: Drive Comment=Browse your virtual C: drive Exec=wine winebrowser c: Terminal=false Type=Application Icon=folder-wine Categories=Wine;
wine-uninstaller.desktop
[Desktop Entry] Name=Uninstall Wine Software Comment=Uninstall Windows applications for Wine Exec=wine uninstaller Terminal=false Type=Application Icon=wine-uninstaller Categories=Wine;
wine-winecfg.desktop
[Desktop Entry] Name=Configure Wine Comment=Change application-specific and general Wine options Exec=winecfg Terminal=false Icon=wine-winecfg Type=Application Categories=Wine;
And create the following file in ~/.config/menus/applications-merged/
:
wine.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd"> <Menu> <Name>Applications</Name> <Menu> <Name>wine-wine</Name> <Directory>wine-wine.directory</Directory> <Include> <Category>Wine</Category> </Include> </Menu> </Menu>
If these settings produce a ugly/non-existent icon, it means that there are no icons for these launchers in the icon set that you have enabled. You should replace the icon settings with the explicit location of the icon that you want. Clicking the icon in the launcher's properties menu will have the same effect. A great icon set that supports these shortcuts is GNOME-colors.
Menu entries created by Wine are located in ~/.local/share/applications/wine/Programs/
. Remove the program's .desktop entry to remove the application from the menu.
In addition to remove unwanted extensions binding by Wine, execute the following commands (taken from the Wine website):
$ rm ~/.local/share/mime/packages/x-wine* $ rm ~/.local/share/applications/wine-extension* $ rm ~/.local/share/icons/hicolor/*/*/application-x-wine-extension* $ rm ~/.local/share/mime/application/x-wine-extension*
The Wine menu items may appear in "Lost & Found" instead of the Wine menu in KDE 4. This is because kde-applications.menu
is missing the MergeDir
option.
Edit /etc/xdg/menus/kde-applications.menu
At the end of the file add <MergeDir>applications-merged</MergeDir>
after <DefaultMergeDirs/>
, it should look like this:
<Menu> <Include> <And> <Category>KDE</Category> <Category>Core</Category> </And> </Include> <DefaultMergeDirs/> <MergeDir>applications-merged</MergeDir> <MergeFile>applications-kmenuedit.menu</MergeFile> </Menu>
Alternatively you can create a symlink to a folder that KDE does see:
$ ln -s ~/.config/menus/applications-merged ~/.config/menus/kde-applications-merged
This has the added bonus that an update to KDE will not change it, but is per user instead of system wide.
Running Windows applications
To run a Windows application:
$ wine path_to_exe
To install using an MSI installer, use the included msiexec utility:
$ msiexec /i path_to_msi
Tips and tricks
Unregister Wine file associations
By default, Wine takes over as the default application for a lot of formats. Some (e.g. vbs
or chm
) are Windows-specific, and opening them with Wine can be a convenience. However, having other formats (e.g. gif
, jpeg
, txt
, js
) open in Wine's bare-bones simulations of Internet Explorer and Notepad can be annoying.
Wine's file associations are set in ~/.local/share/applications/
as wine-extension-{extension}.desktop
files. Delete the files corresponding to the extensions you want to unregister. Or, to remove all wine extensions:
$ rm -f ~/.local/share/applications/wine-extension*.desktop $ rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*
Next, remove the old cache:
$ rm -f ~/.local/share/applications/mimeinfo.cache $ rm -f ~/.local/share/mime/packages/x-wine* $ rm -f ~/.local/share/mime/application/x-wine-extension*
And, update the cache:
$ update-desktop-database ~/.local/share/applications
Please note Wine will still create new file associations and even recreate the file associations if the application sets the file associations again.
Dual Head with different resolutions
If you have issues with dual-head setups and different display resolutions you are probably missing lib32-libxrandr.
exe-thumbnailer
This is a small piece of UI code meant to be installed with (or even before) Wine. It provides thumbnails for executable files that show the embedded icons when available, and also gives the user a hint that Wine will be used to open it. Details can be found at Wine wiki. Install it with the gnome-exe-thumbnailerAUR package.
CSMT patch
Currently wine developers experiment with stream/worker thread optimizations for Wine. You may experience an enormous performance improvement by using this experimental patched Wine versions. Many games may run as fast as on Windows or even faster. This Wine patch is is known as CSMT patch and works with NVidia and AMD graphics cards.
The easy way is to install playonlinux. Then install your game and activate the Wine version 1.7.4-CSMT from the Tools
→ Manage Wine Versions
menu in PlayOnLinux. For now it is recommended to use the patched Wine version 1.7.4-CSMT.
Open your game's configuration settings and copy the following settings to the Miscellaneous
/Command to exec before running the program
section of your game configuration settings:
export WINEDEBUG=-all export LD_PRELOAD="libpthread.so.0 libGL.so.1" export __GL_THREADED_OPTIMIZATIONS=0 export __GL_SYNC_TO_VBLANK=1 export __GL_YIELD="NOTHING" export CSMT=enabled
Make sure you have disabled StrictDrawOrdering
from Tools
→ General
.
CSMT via wine-staging
Wine-staging includes CSMT support, and can be installed with the wine-stagingAUR package, or directly via the wine-staging Arch Linux repo.
CSMT support needs to be enabled before it can be used, instructions can be found here, no further configuration is needed.
Further Information
Phoronix Forum discussion with the CSMT developer Stefan Dösinger
FOSDEM2014 CSMT presentation of CSMT with benchmarks
Here you find some game videos running with CSMT enabled
Changing the language
Some programs may not offer a language selection, they will guess the desired language upon the sytem locales. Wine will transfer the current environment (including the locales) to the application, so it should work out of the box. If you want to force a program to run in a specific locale (which is fully generated on your system), you can call Wine with the following setting:
LC_ALL=xx_XX.encoding wine /path/to/program
For instance
LC_ALL=it_IT.UTF-8 wine /path/to/program
Installing Microsoft Office 2010
Microsoft Office 2010 works without any problems (tested with Microsoft Office Home and Student 2010, Wine 1.5.27 and 1.7.5). Activation over Internet also works.
Start by installing wine-mono, wine_gecko, samba, lib32-libxslt and lib32-libxml2.
Proceed with launching the installer:
$ export WINEPREFIX=~/.wine # Wine prefix to use $ export WINEARCH=win32 $ wine /path/to/office_cd/setup.exe
If you do not want to setup Office in the default Wine prefix (~/.wine
), create new one as described in #WINEPREFIX section. You could also put the above exports into your shell initialization script as also noted there.
Once installation has completed, open Word or Excel to activate over the Internet. After activation run winecfg and set riched20
(under libraries) to (native,builtin)
. This will enable PowerPoint to work.
For additional info, see the WineHQ article.
Proper mounting of optical media images
Some applications will check for the optical media to be in drive. They may check for data only, in which case it might be enough to configure the corresponding path as being a CD-ROM drive in winecfg. However, other applications will look for a media name and/or a serial number, in which case the image has to be mounted with these special properties.
Some virtual drive tools do not handle these metadata, like fuse-based virtual drives (Acetoneiso for instance). CDEmu will handle it correctly.
Burning optical media
To burn CDs or DVDs, you will need to load the sg
kernel module.
OpenGL modes
Many games have an OpenGL mode which may perform better than their default DirectX mode. While the steps to enable OpenGL rendering is application specific, many games accept the -opengl
parameter.
$ wine /path/to/3d_game.exe -opengl
You should of course refer to your application's documentation and Wine's AppDB for such application specific information.
Using Wine as an interpreter for Win16/Win32 binaries
It is also possible to tell the kernel to use Wine as an interpreter for all Win16/Win32 binaries:
echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
To make the setting permanent, create a /etc/binfmt.d/wine.conf
file with the following content:
# Start WINE on Windows executables :DOSWin:M::MZ::/usr/bin/wine:
systemd automatically mounts the /proc/sys/fs/binfmt_misc
filesystem using proc-sys-fs-binfmt_misc.mount
(and automount) and runs the systemd-binfmt.service
to load your settings.
Try it out by running a Windows program:
$ chmod +x exefile.exe $ ./exefile.exe
If all went well, exefile.exe should run.
Wineconsole
Often you may need to run .exe's to patch game files, for example a widescreen mod for an old game, and running the .exe normally through Wine might yield nothing happening. In this case, you can open a terminal and run the following command:
$ wineconsole cmd
Then navigate to the directory and run the .exe file from there.
Winetricks
Winetricks is a script to allow one to install base requirements needed to run Windows programs. Installable components include DirectX 9.x, MSXML (required by Microsoft Office 2007 and Internet Explorer), Visual Runtime libraries and many more.
Install the winetricks package (or alternatively winetricks-gitAUR). Then run it with:
$ winetricks
Installing .NET framework 4.0
First create a new 32-bit Wine prefix if you are on a 64-bit system.
$ WINEARCH=win32 WINEPREFIX=~/win32 winecfg
Then install the following packages using winetricks
$ WINEARCH=win32 WINEPREFIX=~/win32 winetricks -q msxml3 dotnet40 corefonts
Crackling sound when using PulseAudio
If you experience crackling sound in Wine applications when PulseAudio is in use, edit the file /etc/pulse/daemon.conf
by uncommenting the line ; default-fragment-size-msec = 25
and setting the value to 5
such that it looks like this:
default-fragment-size-msec = 5
See here for further information.
16 Bit Programs
Upon running older Windows 9x programs, the following error may be encountered:
modify_ldt: Invalid argument err:winediag:build_module Failed to create module for "krnl386.exe", 16-bit LDT support may be missing. err:module:attach_process_dlls "krnl386.exe16" failed to initialize, aborting
In this case, running the following may fix it:
echo 1 > /proc/sys/abi/ldt16
Source: Fedora Mailing List
Third-party interfaces
These have their own sites, and are not supported in the official Wine forums/bugzilla.
CrossOver
CrossOver Has its own wiki page.
PlayOnLinux/PlayOnMac
PlayOnLinux is a graphical Windows and DOS program manager. It contains scripts to assist the configuration and running of programs, it can manage multiple Wine versions and even use a specific version for each executable (e.g. because of regressions). If you need to know which Wine version works best for a certain game, try the Wine Application Database. You can find the playonlinux package in community.
PyWinery
PyWinery is a graphical and simple wine-prefix manager which allows you to launch apps and manage configuration of separate prefixes, also have a button to open winetricks in the same prefix, to open prefix dir, winecfg, application uninstaller and wineDOS. You can install You can install PyWinery with the pywineryAUR package. It is especially useful for having differents settings like DirectX games, office, programming, etc, and choose which prefix to use before you open an application or file.
It is recommended using winetricks by default to open .exe files, so you can choose between any Wine configuration you have.
Q4wine
Q4Wine is a graphical wine-prefix manager which allows you to manage configuration of prefixes. Notably it allows exporting Qt themes into the Wine configuration so that they can integrate nicely. You can find the q4wine package in multilib.
Wine-staging
Wine-Staging (formerly wine-compholio) is a special wine version containing bug fixes and features, which are not yet available in regular wine versions. The idea of Wine Staging is to provide new features faster to end users and to give developers the possibility to discuss and improve their patches before they are sent upstream. Available via the wine-stagingAUR package or directly via the wine-staging Arch Linux repo.
See also
- Official Wine website
- Wine application database
- Advanced configuring of video card and OpenGL in Wine; Speed up Wine
- FileInfo - Find Win32 PE/COFF headers in exe/dll/ocx files under Linux/Unix environment.
- Gentoo's Wine Wiki Page