Difference between revisions of "Wine"

From ArchWiki
Jump to: navigation, search
m (Architectural differences: reword as requested in talk page)
(Explain how to enable font Subpixel smoothing and link to the original answer on askubuntu.)
(413 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
[[Category:Wine (English)]]
+
[[Category:Emulation]]
 +
[[Category:Gaming]]
 +
[[cs:Wine]]
 +
[[de:Wine]]
 +
[[es:Wine]]
 
[[fr:Wine]]
 
[[fr:Wine]]
{{i18n|Wine}}
+
[[it:Wine]]
 +
[[ja:Wine]]
 +
[[ru:Wine]]
 +
[[zh-hans:Wine]]
 +
[[zh-hant:Wine]]
 +
{{Related articles start}}
 +
{{Related|CrossOver}}
 +
{{Related|Wine package guidelines}}
 +
{{Related articles end}}
 +
[[Wikipedia:Wine (software)|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.
  
[[Wikipedia:Wine (software)|Wine]] is a compatibility layer capable of running Microsoft Windows applications on Unix-like operating systems. Windows programs running in Wine act as native programs would, running without the performance or memory usage penalties of an emulator, with a similar look and feel to other applications on your desktop environment.
+
{{Warning|If you can access a file or resource with your user account, programs running in Wine can too. See [[#Running Wine under a separate user account]] and [[Security#Sandboxing applications]] for possible precautions.}}
  
 
== Installation ==
 
== Installation ==
Wine is constantly updated and available in the [community] repository for i686 and in [multilib] for x86_64.
 
{{Note|If you are on x86_64, you will need to enable the [multilib] repository (disabled by default) in {{ic|/etc/pacman.conf}} or you will get an error because [[pacman]] can not find the wine package without it.}}
 
# pacman -S wine
 
  
You may also require wine_gecko if your applications make use of Internet Explorer
+
Wine can be installed by enabling the [[Multilib]] repository and [[install]]ing the {{Pkg|wine}} (stable) or {{Pkg|wine-staging}} (testing) package. [https://wine-staging.com/ Wine Staging] is a patched version of [https://www.winehq.org/ Wine], which contains bug fixes and features that have not been integrated into the stable branch yet. See also [[#Graphics drivers]] and [[#Sound]].
  
# pacman -S wine_gecko
+
Consider installing {{pkg|wine_gecko}} and {{pkg|wine-mono}} for applications that depend on 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 ===
+
== Configuration ==
Wine in Arch Linux on i686 is packaged just like expected. It includes a standard 32-bit Wine installation and is unable to execute any 64-bit Windows applications. However, the x86_64 Wine package includes both, a 32-bit and a 64-bit Windows compatibility layer in one.  
+
Configuring Wine is typically accomplished using:
 +
* [https://wiki.winehq.org/Winecfg winecfg] is a GUI configuration tool for Wine, which can be started by running {{ic|winecfg}}.
 +
* [https://wiki.winehq.org/Regedit regedit] is Wine's registry editing tool,  which can be started by running {{ic|regedit}}. See WineHQ's article on [https://wiki.winehq.org/Useful_Registry_Keys Useful Registry Keys].
 +
* [https://wiki.winehq.org/Control control] is Wine's implementation of the Windows Control Panel, which can be started by running {{ic|wine control}}.
 +
* See WineHQ's [https://wiki.winehq.org/List_of_Commands List of Commands] for the full list.
  
This so called [[Wikipedia:WoW64|WoW64]] allows the user to use 32-bit and 64-bit Windows programs concurrently and even in the same WINEPREFIX with a win64 WINEARCH. The current support for this in Wine itself is limited and users are recommended to use a win32 WINEPREFIX. See [[Wine#Using_WINEARCH]] for more information on this.
+
=== WINEPREFIX ===
 +
By default, Wine stores its configuration files and installed Windows programs in {{ic|~/.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 {{ic|C:}} (the C-drive).
  
To clarify the above, using the x86_64 Wine package with {{ic|1=WINEARCH=win32}} will have exactly the same behaviour as using the i686 Wine package.
+
You can override the location Wine uses for a prefix with the {{ic|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.
  
== Configuration ==
+
For example, if you run one program with {{ic|1= $ env WINEPREFIX=~/.win-a wine program-a.exe}}, and another with {{ic|1= $ env WINEPREFIX=~/.win-b wine program-b.exe}}, the two programs will each have a separate C-drive and separate registries.
By default, Wine stores its configuration files and installed Windows programs in {{ic|~/.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: 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.  For example if you run one program with
+
{{Note|Wine prefixes are not [[Wikipedia:Sandbox (computer security)|sandboxes]]! Programs running under Wine can still access the rest of the system! (for example, {{ic|Z:}} is mapped to {{ic|/}}, regardless of the Wine prefix).}}
$ 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 separate "C: drives" and registries.
 
  
To create a default prefix without running a Windows program or other GUI tool you can use
+
To create a default prefix without running a Windows program or other GUI tool you can use:
 
  $ env WINEPREFIX=~/.customprefix wineboot -u
 
  $ env WINEPREFIX=~/.customprefix wineboot -u
  
{{Note|Wine prefixes should not be confused with the same kind of "containment" found with other "virtual" environments. Generally speaking, if you can access a file or resource with your user account, programs running with Wine can too. Wine is not a jail.}}
+
=== WINEARCH ===
  
Configuring Wine is typically accomplished using winecfg, Wine's control panel, and regedit.
+
Wine will start an 64-bit environment by default. You can change this behavior using the {{ic|WINEARCH}} [[environment variable]]. Rename your {{ic|~/.wine}} directory and create a new Wine environment by running {{ic|1=$ WINEARCH=win32 winecfg}}. This will get you a 32-bit Wine environment. Not setting {{ic|WINEARCH}} will get you a 64-bit one.
* [http://wiki.winehq.org/winecfg winecfg] is a GUI configuration tool for Wine. You can run it from a console window with {{bc|$ winecfg}} or {{bc|1=$ WINEPREFIX=~/.some_prefix winecfg}}
 
* [http://wiki.winehq.org/control control.exe] is Wine's implementation of Windows' Control Panel which can be accessed with {{bc|$ wine control}}
 
* [http://wiki.winehq.org/regedit regedit] is Wine's registry editing tool. If winecfg and the Control Panel were not enough, see [http://wiki.winehq.org/UsefulRegistryKeys WineHQ's article on Useful Registry Keys]
 
  
=== Using WINEARCH ===
+
You can combine this with {{ic|WINEPREFIX}} to make a separate {{ic|win32}} and {{ic|win64}} environment:
If you are using wine from [multilib], you will notice that '''winecfg''' will get you a 64-bit wine 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
  $ WINEARCH=win32 WINEPREFIX=~/win32 winecfg  
 
 
  $ WINEPREFIX=~/win64 winecfg
 
  $ WINEPREFIX=~/win64 winecfg
  
Note that a win64 WINEARCH is meant to be able to run 32-bit Windows applications as well as 64-bit ones. However, support for this is limited in Wine and users are encouraged to use a win32 WINEPREFIX for the time being until support improves.
+
You can also use {{ic|WINEARCH}} in combination with other Wine programs, such as ''winetricks'' (using Steam as an example):
  
{{Note|During prefix creation, the 64-bit version of wine treats all folders as 64-bit prefixs and will not create a 32-bit in any existing folder. To create a 32-bit prefix you have to let wine create the folder specified in WINEPREFIX.}}
+
WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam
  
You can also use winetricks and WINEARCH in one command for installing something from winetricks like this (using Steam as an example):
+
=== Graphics drivers ===
env WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam
 
Note: you do not have create the steam subdirectory in the wineprefixes directory, it will create for you. See the Bottles section below for more information.
 
  
=== Graphics Drivers ===
+
You need to install the 32-bit version of your graphics driver. Please install the package that is listed in the ''OpenGL (Multilib)'' column in the table in [[Xorg#Driver installation]].
For most games, Wine requires high performance accelerated graphics drivers. This likely means using proprietary binary drivers from [[Nvidia]] or [[ATI|Amd/ATI]].  [[Intel]] drivers should mostly work as well as they are going to out of the box.
 
  
 
A good sign that your drivers are inadequate or not properly configured is when Wine reports the following in your terminal window:
 
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
 
  Direct rendering is disabled, most likely your OpenGL drivers have not been installed correctly
  
For x86-64 systems, additional 32-bit [multilib] or [[AUR]] packages are required:
+
{{Note|You might need to restart X after having installed the correct library.}}
* '''NVIDIA''': {{bc|# pacman -S lib32-nvidia-utils}} For older lib32-nvidia-utils (e.g. nvidia-96xx drivers), see [http://aur.archlinux.org/packages.php?K=lib32-nvidia-utils here].
+
 
* '''Intel''': {{bc|# pacman -S lib32-intel-dri}} Run Wine with {{bc|1=LIBGL_DRIVERS_PATH=/usr/lib32/xorg/modules/dri}}
+
=== Sound ===
* '''AMD/ATI''': {{bc|# pacman -S lib32-ati-dri}} For ATI's proprietary drivers, install {{AUR|lib32-catalyst-utils}} from AUR
 
  
{{Note|You might need to restart after having installed the correct library!}}
+
By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in ''winecfg''.
  
=== Sound ===
+
* If you want to use the [[ALSA]] driver in Wine, you will need to install {{Pkg|lib32-alsa-lib}} and {{Pkg|lib32-alsa-plugins}}.
 +
* If you want to use the [[PulseAudio]] driver in Wine, you will need to install the {{Pkg|lib32-libpulse}} package.
 +
* If you want to use the [[OSS]] driver in Wine, you will need to install the {{Pkg|lib32-alsa-oss}} package. The OSS driver in the kernel will not suffice.
 +
* Games that use advanced sound systems (''e.g.'' TESV: Skyrim) may additionally require installations of {{Pkg|lib32-openal}}.
 +
 
 +
If ''winecfg'' '''still''' fails to detect the audio driver (Selected driver: (none)), [https://www.winehq.org/docs/wineusr-guide/using-regedit#Configuring_Sound configure it via the registry]. For example, in a case where the microphone was not working in a 32-bit Windows application on a 64-bit stock install of wine-1.9.7, this provided full access to the sound hardware (sound playback and mic): open ''regedit'', look for the key HKEY_CURRENT_USER → Software → Wine → Drivers, and add a string called ''Audio'' and give it the value ''alsa''. Also, it may help to [[#WINEARCH|recreate the prefix]].
 +
 
 +
==== 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, as explained in [[MIDI]]. Last but not least you need to make sure Wine will use the correct MIDI output.
 +
 
 +
=== 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 {{Pkg|lib32-libxml2}}.
 +
 
 +
*Some applications that play music may require {{Pkg|lib32-mpg123}}.
 +
 
 +
*Some applications that use a color management engine (e.g. pdf viewers, image viewers, etc) may require {{Pkg|lib32-lcms2}}.
 +
 
 +
*Some applications that use native image manipulation libraries may require {{Pkg|lib32-giflib}} and {{Pkg|lib32-libpng}}.
 +
 
 +
*Some applications that require encryption support may require {{Pkg|lib32-gnutls}}.
 +
 
 +
*Some applications require 32-bit video codecs or the program crashes. Install {{Pkg|lib32-gst-plugins-base}}, {{Pkg|lib32-gst-plugins-good}}, {{Aur|lib32-gst-plugins-bad}} and {{Aur|lib32-gst-plugins-ugly}}.
 +
 
 +
=== Fonts ===
 +
 
 +
If Wine applications are not showing easily readable fonts, you may not have any fonts installed. To easily link all of the system fonts so they are accessible from wine:
 +
 
 +
  cd ${WINEPREFIX:-~/.wine}/drive_c/windows/Fonts && for i in /usr/share/fonts/**/*.{ttf,otf}; do ln -s "$i" ; done
  
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.
+
Wine uses freetype to render fonts, and freetype's defaults changed a few releases ago. Try using this environment setting for wine programs:
  
If you want to use [[OSS]] in Wine, you will need to install the '''oss''' package. The OSS driver in the kernel will not suffice.
+
  FREETYPE_PROPERTIES="truetype:interpreter-version=35"
  
===Fonts===
+
Another possibility is to install Microsoft's Truetype fonts into your wine prefix. See [[MS Fonts]]. If this does not help, try running {{ic|winetricks corefonts}} first, then {{ic|winetricks allfonts}} as a last resort.
  
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 {{ic|winetricks allfonts}}. (See [[#Winetricks]] below.)
+
After running such programs, kill all Wine servers and run {{ic|winecfg}}. Fonts should be legible now.
  
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 [https://wiki.winehq.org/FAQ#How_do_I_edit_the_Wine_registry.3F regedit]:
  
If the fonts look somehow smeared, import the following text file into the Wine registry with [http://wiki.winehq.org/regedit regedit]:
+
Windows Registry Editor Version 5.00
 
  [HKEY_CURRENT_USER\Software\Wine\X11 Driver]
 
  [HKEY_CURRENT_USER\Software\Wine\X11 Driver]
 
  "ClientSideWithRender"="N"
 
  "ClientSideWithRender"="N"
  
=== Desktop Launcher Menus ===
+
For high resolution displays, you can adjust dpi values in winecfg.
By default, installation of Wine does not create desktop menus/icons for the software which comes with Wine (e.g. for winecfg, winebrowser, etc). However, installing Windows programs with Wine, in most cases, 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.
+
 
 +
See also [[Font configuration#Applications without fontconfig support]].
 +
 
 +
==== Enable font smoothing ====
 +
A good way to improve wine font rendering is to enable cleartype font smoothing.
 +
To enable "Subpixel smoothing (ClearType) RGB":
 +
 
 +
{{bc|<nowiki>cat << EOF > /tmp/fontsmoothing
 +
REGEDIT4
 +
 
 +
[HKEY_CURRENT_USER\Control Panel\Desktop]
 +
"FontSmoothing"="2"
 +
"FontSmoothingOrientation"=dword:00000001
 +
"FontSmoothingType"=dword:00000002
 +
"FontSmoothingGamma"=dword:00000578
 +
EOF
 +
 
 +
WINE=${WINE:-wine} WINEPREFIX=${WINEPREFIX:-$HOME/.wine} $WINE regedit /tmp/fontsmoothing 2> /dev/null</nowiki>}}
 +
 
 +
For more information, check [https://askubuntu.com/a/219795/514682 the original answer]
 +
 
 +
=== Desktop launcher menus ===
 +
 
 +
When a Windows application installer creates a shortcut Wine creates a {{ic|.desktop}} file instead. The default locations for those files in Arch Linux are:
 +
* Desktop shortcuts are put in {{ic|~/Desktop}}
 +
* Start menu shortcuts are put in {{ic|~/.local/share/applications/wine/Programs/}}
 +
 
 +
{{Note|1=Wine does not support installing Windows applications for all users, so it will not put {{ic|.desktop}} files in {{ic|/usr/share/applications}}. See WineHQ bug [https://bugs.winehq.org/show_bug.cgi?id=11112 11112]}}
 +
 
 +
{{Tip|If menu items were ''not'' created while installing software or have been lost, {{ic|wine winemenubuilder}} may be of some use.}}
  
{{Tip|If menu items were ''not'' created while installing software or have been lost, [http://wiki.winehq.org/winemenubuilder winemenubuilder] may be of some use.}}
+
==== Creating menu entries for Wine utilities ====
  
If you wish to add on to the menu to create an Ubuntu-like Wine sub-menu, then follow these instructions:
+
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.
  
==== Creating Menu Entries ====
+
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 {{ic|~/.local/share/applications/wine/}}:
First, install a Windows program using Wine to create the base menu. After the base menu is created, you can start to add the menu entries. In GNOME, right-click on the desktop and select "Create Launcher...".  The steps might be different for KDE/Xfce. Make three launchers using these settings:
 
'''Type''': Application
 
'''Name''': Configuration
 
'''Command''': winecfg
 
'''Comment''': Configure the general settings for Wine
 
  
'''Type''': Application
+
{{hc|wine-browsedrive.desktop|2=
'''Name''': Uninstall Programs
+
[Desktop Entry]
'''Command''': wine uninstaller
+
Name=Browse C: Drive
'''Comment''': Uninstall Windows programs under Wine properly
+
Comment=Browse your virtual C: drive
 +
Exec=wine winebrowser c:
 +
Terminal=false
 +
Type=Application
 +
Icon=folder-wine
 +
Categories=Wine;
 +
}}
 +
 
 +
{{hc|wine-uninstaller.desktop|2=
 +
[Desktop Entry]
 +
Name=Uninstall Wine Software
 +
Comment=Uninstall Windows applications for Wine
 +
Exec=wine uninstaller
 +
Terminal=false
 +
Type=Application
 +
Icon=wine-uninstaller
 +
Categories=Wine;
 +
}}
 +
 
 +
{{hc|wine-winecfg.desktop|2=
 +
[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 {{ic|~/.config/menus/applications-merged/}}:
 +
 
 +
{{hc|wine.menu|<nowiki>
 +
<!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>
 +
</nowiki>}}
  
'''Type''': Application
 
'''Name''': Browse C:\ Drive
 
'''Command''': wine winebrowser c:\\
 
'''Comment''': Browse the files in the virtual Wine C:\ drive
 
Now that you have these three launchers on your desktop, it is time to put them into the menu. But, first you should change the launchers to dynamically change icons when a new icon set is installed. To do this, open the launchers that you just made in your favorite text editor. Change the following settings to these new values:
 
''Configuration'' launcher:
 
Icon[en_US]=wine-winecfg
 
Icon=wine-winecfg
 
''Uninstall Programs'' launcher:
 
Icon[en_US]=wine-uninstaller
 
Icon=wine-uninstaller
 
''Browse C:\ Drive'' launcher:
 
Icon[en_US]=wine-winefile
 
Icon=wine-winefile
 
 
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 [http://www.gnome-look.org/content/show.php/GNOME-colors?content=82562 GNOME-colors].
 
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 [http://www.gnome-look.org/content/show.php/GNOME-colors?content=82562 GNOME-colors].
  
Now that you have the launchers fully configured, now it is time to put them in the menu. Copy them into {{ic|~/.local/share/applications/wine/}}.
+
==== Removing menu entries ====
 +
 
 +
Menu entries created by Wine are located in {{ic|~/.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*
 +
 
 +
=== Printing ===
 +
 
 +
In order to use your installed printers (both local and network) with wine applications in ''win32 prefixes'' (e.g. MS Word), install the {{Pkg|lib32-libcups}} package, reboot wine (''wineboot'') and restart your wine application.
 +
 
 +
== Usage ==
 +
 
 +
{{Warning|Do not run or install Wine applications as root! See [https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F Wine FAQ] for details.}}
 +
 
 +
See [https://wiki.winehq.org/FAQ Wine FAQ] and [https://wiki.winehq.org/Wine_User%27s_Guide Wine User's Guide] for general information on Wine usage.
 +
 
 +
See [https://appdb.winehq.org/ Wine Application Database (AppDB)] for information on running Windows applications in Wine.
 +
 
 +
== Tips and tricks ==
 +
 
 +
=== 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 ===
 +
 
 +
[https://wiki.winehq.org/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.
  
Wait a second, they are not in the menu yet! There is one last stepCreate the following text file {{hc|~/.config/menus/applications-merged/wine-utilities.menu|<nowiki>
+
[[Install]] the {{pkg|winetricks}} package (or alternatively {{AUR|winetricks-git}}). Then run it with:
  <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
+
$ winetricks
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
+
 
  <Menu>
+
=== Performance ===
  <Name>Applications</Name>
+
 
  <Menu>
+
==== CSMT ====
    <Name>wine-wine</Name>
+
 
    <Directory>wine-wine.directory</Directory>
+
CSMT is a technology used by Wine to use a separate thread for the OpenGL calls to improve performance noticeably. Since Wine 3.3, CSMT is enabled by default. However, CSMT support needs to be enabled manually for Wine versions lower than 3.3. For vanilla Wine run {{ic|wine regedit}} and set the DWORD value for ''HKEY_CURRENT_USER -> Software > Wine > Direct3D > csmt'' to 0x01 (enabled). For wine-staging run {{ic|winecfg}} and enable it in the staging tab.
    <Include>
+
 
<Filename>wine-Configuration.desktop</Filename>
+
Further information:
    </Include>
+
*[http://www.phoronix.com/forums/showthread.php?93967-Wine-s-Big-Command-Stream-D3D-Patch-Set-Updated/page3&s=7775d7c3d4fa698089d5492bb7b1a435 Phoronix Forum discussion] with the CSMT developer Stefan Dösinger
    <Include>
+
 
<Filename>wine-Browse C:\ Drive.desktop</Filename>
+
==== Force OpenGL mode in games ====
    </Include>
+
 
    <Include>
+
Some games might 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 {{Ic|-opengl}} parameter.
<Filename>wine-Uninstall Programs.desktop</Filename>
+
  $ wine ''/path/to/3d_game.exe'' -opengl
    </Include>
+
 
  </Menu>
+
You should of course refer to your application's documentation and Wine's [http://appdb.winehq.org AppDB] for such application specific information.
</Menu>
+
 
</nowiki>}}
+
==== DXVK ====
Go check in the menu and there should be the minty fresh options waiting to be used!
+
[https://github.com/doitsujin/dxvk DXVK] is a promising new implementation for DirectX 11 over Vulkan. This should allow for greater performance, and in some cases, even better compatibility. Battlefield 1 for example, only runs under DXVK. On the other hand, DXVK does not support all Wine games (yet).
 +
 
 +
To use it, install {{aur|dxvk-bin}} for official binaries, or {{aur|dxvk-git}} for the development version. Then run the following command to activate it in your Wineprefix (by default {{ic|~/.wine}}):
 +
  $ WINEPREFX=''your-prefix'' setup_dxvk64
 +
 
 +
Use {{ic|setup_dxvk32}} for 32-bit applications.
 +
 
 +
{{note|For Wine versions below 3.5 you need to configure Vulkan support manually, following the instructions at [https://github.com/roderickc/wine-vulkan GitHub]. {{Pkg|wine}}, {{Pkg|wine-staging}} and {{Pkg|wine-staging-nine}} work out of the box.}}
 +
 
 +
{{warning|DXVK overrides the DirectX 11 DLLS, which may be considered cheating in online multiplayer games, and may get your account '''banned'''. Use at your own risk!}}
 +
 
 +
=== Unregister existing Wine file associations ===
 +
 
 +
By default, Wine takes over as the default application for a lot of formats. Some (e.g. {{ic|vbs}} or {{ic|chm}}) are Windows-specific, and opening them with Wine can be a convenience. However, having other formats (e.g. {{ic|gif}}, {{ic|jpeg}}, {{ic|txt}}, {{ic|js}}) open in Wine's bare-bones simulations of Internet Explorer and Notepad can be annoying.
 +
 
 +
Wine's file associations are set in {{ic|~/.local/share/applications/}} as {{ic|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:
  
==== KDE 4 Menu Fix[https://bugs.launchpad.net/ubuntu/+source/wine/+bug/263041] ====
+
$ rm -f ~/.local/share/applications/mimeinfo.cache
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.
+
$ rm -f ~/.local/share/mime/packages/x-wine*
 +
$ rm -f ~/.local/share/mime/application/x-wine-extension*
  
Edit {{ic|/etc/xdg/menus/kde-applications.menu}}
+
And, update the cache:
  
At the end of the file add {{ic|<MergeDir>applications-merged</MergeDir>}} after {{ic|<DefaultMergeDirs/>}}, it should look like this:
+
$ update-desktop-database ~/.local/share/applications
        <Include>
+
$ update-mime-database ~/.local/share/mime/
                <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:
+
Alternatively you can delete all wine related stuff:
ln -s ~/.config/menus/applications-merged ~/.config/menus/kde-applications-merged
 
  
This has the added bonus that an update to KDE won't change it, but is per user instead of system wide.
+
$ find ~/.local/share -name "*wine*" | xargs --no-run-if-empty rm -r
  
== Running Windows Applications ==
+
And update the cache as above.
{{Warning|Do not run or install Wine applications as root! See http://wiki.winehq.org/FAQ#run_as_root for more details.}}
 
To run a 32-bit windows application:
 
$ wine <path to exe>
 
  
To run a 64-bit windows application on a x86-64 system:
+
Please note Wine will still create new file associations and even recreate the file associations if the application sets the file associations again.
$ wine64 <path to exe>
 
  
To install using an MSI installer, use the included msiexec utility:
+
=== Prevent new Wine file associations ===
$ msiexec installername.msi
 
  
{{Tip|The [http://www.winehq.org official Wine site] contains a wealth of information about running Windows applications with Wine.  Of particular interest are:
+
Prevent wine from creating any file associations by editing the registry:
* [http://wiki.winehq.org/FAQ The official FAQ] - General information about Wine and Frequently Asked Questions
 
* [http://appdb.winehq.org/ The Wine Application Database (AppDB)] - Information about running specific Windows applications (Known issues, ratings, guides, etc tailored to specific applications)
 
* [http://forum.winehq.org/ The WineHQ Forums] - A great place to ask questions ''after'' you have looked through the FAQ and AppDB
 
  
If it does not "just work," these resources will often be your first stops toward getting your Windows software working.
+
{{hc|1=associations.reg|2=
 +
Windows Registry Editor Version 5.00
 +
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices]
 +
"winemenubuilder"="C:\\windows\\system32\\winemenubuilder.exe -r"
 
}}
 
}}
  
== Tips and Tricks ==
+
Add this to your Wine registry, by running {{ic|wine regedit associations.reg}}, or alternatively by running {{ic|wine regedit}} and importing it from the menu in ''Registry > Import Registry File''.
These tools will assist in the installation of typical Windows components. In most cases they should be used as a last effort, as it may severely alter your wine configuration.
+
 
 +
This has to be done for each WINEPREFIX which should not update file associations.
 +
 
 +
You can disable winemenubuilder for all WINEPREFIXes by setting an environment variable:
 +
 
 +
$ export WINEDLLOVERRIDES="winemenubuilder.exe=d"
 +
 
 +
=== Execute Windows binaries with Wine implicitly ===
  
=== Installing Microsoft Office 2007 ===
+
The {{pkg|wine}} package installs a ''binfmt'' file which will allow you to run Windows programs directly, e.g. {{ic|''./myprogram.exe''}} will launch as if you had typed {{ic|wine ''./myprogram.exe''}}. All you have to do in order to use this is to [[start]]/[[enable]] {{ic|systemd-binfmt.service}}.
  
A small tweak is needed to install the office suite. Follow these steps to accomplish it:
+
{{Note|Make sure the Windows binary is executable, otherwise the binary will not be executed: e.g. run {{ic|chmod +x ''windows-binary''}}.}}
  
$ WINEARCH=win32 WINEPREFIX=/path/to/wineprefix winecfg
+
=== Dual Head with different resolutions ===
# pacman -S winetricks
 
$ winetricks msxml3
 
$ wine /path/to/office_cd/setup.exe
 
  
For additional info, see the [http://appdb.winehq.org/appview.php?iVersionId=4992 WineHQ] article.
+
If you have issues with dual-head setups and different display resolutions you are probably missing {{Pkg|lib32-libxrandr}}.
  
=== OpenGL Modes ===
+
Also installing {{Pkg|lib32-libxinerama}} might fix dual-head issues with wine.
Many games have an OpenGL mode which ''may'' preform better than their default DirectX mode.  While the steps to enable OpenGL rendering is ''application specific'', many games accept the {{Ic|-opengl}} parameter.
 
$ wine /path/to/3d_game.exe -opengl
 
  
You should of course refer to your application's documentation and Wine's [http://appdb.winehq.org AppDB] for such application specific 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
 +
 
 +
If you need to run these programs under Wine, you will have to [[Kernels/Arch Build System|compile and install a custom kernel]] (unless bug {{Bug|57408}} is fixed). Your kernel config will need the following options:
 +
 
 +
CONFIG_X86_16BIT=y
 +
CONFIG_X86_ESPFIX64=y
 +
CONFIG_MODIFY_LDT_SYSCALL=y
 +
 
 +
=== Burning optical media ===
 +
 
 +
To burn CDs or DVDs, you will need to load the {{ic|sg}} [[kernel module]].
 +
 
 +
=== 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.
 +
 
 +
=== Show FPS overlay in games ===
 +
 
 +
Wine features an embedded FPS monitor which works for all graphical applications if the environment variable {{ic|1=WINEDEBUG=fps}} is set. This will output the framerate to stdout. You can display the FPS on top of the window thanks to {{ic|osd_cat}} from the {{pkg|xosd}} package. See [https://gist.github.com/anonymous/844aefd70bb50bf72b35 winefps.sh] for a helper script.
 +
 
 +
=== Running Wine under a separate user account ===
 +
 
 +
{{Note|The following approach only works when enabling root for Xorg. See [[Xorg#Rootless Xorg]] for more information.}}
 +
 
 +
It may be desirable to run Wine under a specifically created user account in order to reduce concerns about Windows applications having access to your home directory.
 +
 
 +
First, create a [[Users and groups|user account]] for Wine:
 +
 
 +
# useradd -m -s /bin/bash wineuser
 +
 
 +
Afterwards, in order to open Wine applications using this new user account you need to add the new user to the X server permissions list:
  
=== PlayOnLinux ===
+
$ xhost +SI:localuser:wineuser
[http://www.playonlinux.com/ PlayOnLinux] is a graphical Windows and DOS program manager. It contains many scripts to assist the configuration and running of progams. You can find the [http://aur.archlinux.org/packages.php?ID=14986 PKGBUILD] in AUR.
 
  
PlayOnLinux can also manage multiple Wine versions and use a specific version for each executable because of regressions. If you need to know what Wine version works best for a certain game, try the [http://appdb.winehq.org/ Wine Application Database].
+
Finally, you can run Wine via the following command, which uses {{ic|env}} to launch Wine with the environment variables it expects:
  
=== PyWinery ===
+
$ sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine ''arguments''
[http://code.google.com/p/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 [https://aur.archlinux.org/packages.php?ID=48382 PyWinery from AUR]. 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's recommended using winetricks by default to open. exe files, so you can choose between any wine configuration you have.
+
It is possible to automate the process of running Windows applications with Wine via this method by using a shell script as follows:
 +
{{hc|1=/usr/local/bin/runaswine|2=
 +
#!/bin/bash
 +
xhost +SI:localuser:wineuser
 +
sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine "$@"}}
  
=== Sidenet Wine Configuration Utility ===
+
Wine applications can then be launched via:
{{Note|The link appears to be broken.}}
 
  
[http://sidenet.ddo.jp/winetips/config.html Sidenet's wine-config]
+
$ runaswine ''"C:\path\to\application.exe"''
  
* Download the latest version
+
In order to not be asked for a password each time Wine is run as another user the following entry can be added to the sudoers file: {{ic|1=''mainuser'' ALL=(wineuser) NOPASSWD: ALL}}. See [[Sudo#Configuration]] for more information.
* unpack it
 
* READ THE README
 
* execute
 
./setup
 
* Follow the instructions
 
  
'''Keep in mind''': Like stated on the [http://sidenet.ddo.jp/winetips/config.html site], you are only allowed to install DCOM98 if you possess a valid License for Windows98.
+
It is recommended to run {{ic|winecfg}} as the Wine user and remove all bindings for directories outside the home directory of the Wine user in the "Desktop Integration" section of the configuration window so no program run with Wine has read access to any file outside the special user's home directory.
  
=== Using Wine as an interpreter for Win16/Win32 binaries ===
+
Keep in mind that audio will probably be non-functional in Wine programs which are run this way if [[PulseAudio]] is used. See [[PulseAudio/Examples#Allowing multiple users to use PulseAudio at the same time]] for information about allowing the Wine user to access the PulseAudio daemon of the principal user.
It is also possible to tell the kernel to use wine as an interpreter for all Win16/Win32 binaries. First mount the binfmt_misc filesystem:
 
# mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
 
Or you can add this line to your {{ic|/etc/fstab}}:
 
none /proc/sys/fs/binfmt_misc binfmt_misc defaults 0 0
 
Then, tell the kernel how to interpret Win16 and Win32 binaries:
 
echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register
 
You can add this line to {{ic|/etc/rc.local}} to make this setting permanent. In this case you may want to ignore stderr to avoid error messages when changing runlevels:
 
{ echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register; } 2>/dev/null
 
Now try to run a Windows program:
 
chmod 755 exefile.exe
 
./exefile.exe
 
  
=== Wineconsole ===
+
=== Temp directory on tmpfs ===
  
Often you may need to run .exes 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:
+
To prevent Wine from writing its temporary files to a physical disk, one can define an alternative location, like ''tmpfs''. Remove Wine's default directory for temporary files and creating a symlink:
  
  $ wineconsole cmd
+
  $ rm -r ~/.wine/drive_c/users/$USER/Temp
 +
$ ln -s /tmp/ ~/.wine/drive_c/users/$USER/Temp
  
Then navigate to the directory and run the .exe file from there.
+
=== Prevent installing Mono/Gecko ===
 +
If Gecko and/or Mono are not present on the system nor in the Wine prefix, Wine will prompt to download them from the internet. If you do not need Gecko and/or Mono, you might want to disable this dialog, by  setting the {{ic|WINEDLLOVERRIDES}} [[environment variable]] to {{ic|1=mscoree=d;mshtml=d}}.
  
=== Wine-doors ===
+
=== Vulkan ===
 +
Vulkan support is included, since Wine 3.3. The default Wine Vulkan ICD loader works fine for most applications, but does not support advanced features, like Vulkan layers. To use these features, you have to install the official Vulkan SDK, see step 2-4 on the original Vulkan patches author's [https://github.com/roderickc/wine-vulkan GitHub page].
  
[http://www.wine-doors.org/ Wine-doors]
+
{{note|The Wine ICD loader was added in Wine 3.5, you need to install the official Vulkan SDK to use Vulkan in Wine 3.3 and 3.4}}
  
Wine-doors is a WineTools replacement. It features a GNOME GUI and works like a package manager. Works fine in 64bit. [No longer available in the AUR].
+
== Third-party applications ==
  
=== WineTools assistant ===
+
These have their own communities and websites, and are '''not supported''' by greater Wine community. See [https://wiki.winehq.org/Third_Party_Applications Wine Wiki] for more details.
{{Note|This tool is currently slightly outdated, but working.}}
 
  
[http://www.von-thadden.de/Joachim/WineTools Winetools] is a script that facilitates in the installation of some core components for wine in order to install other programs. Note this is not necessary for wine, but does help if you want to get Internet Explorer running.
+
*{{App|[[CrossOver]]|Paid, commercialized version of Wine which provides more comprehensive end-user support.|{{AUR|crossover}}|https://www.codeweavers.com/}}
  
{{Note|Microsoft policy is that you must have a license for IE6 in order to install DCOM98 or Internet Explorer 6. If you have ever owned a copy of Windows, you should be fine.}}
+
*{{App|exe-thumbnailer|Generates thumbnails for Windows executable files (.exe, .lnk, .msi, and .dll).|{{AUR|exe-thumbnailer}}|https://github.com/exe-thumbnailer/exe-thumbnailer}}
  
You can download the [http://aur.archlinux.org/packages.php?ID=8913 PKGBUILD] script and see [[AUR]] for instructions to build and install.
+
*{{App|Lutris|Gaming launcher for all types of games, including Wine games (with prefix management), native Linux games and emulators.|{{AUR|lutris}}|https://lutris.net/}}
<!--
 
  
=== Winetricks ===
+
*{{App|PlayOnLinux|Graphical prefix manager for Wine. Contains scripts to assist with program installation and configuration.|{{Pkg|playonlinux}}|https://www.playonlinux.com/}}
[http://wiki.winehq.org/winetricks Winetricks] is a quick script that allows one to install base requirements needed to run some Windows programs. Installable components includes DirectX 9.x, msxml (required by Microsoft Office 2007 and Internet Explorer), visual runtime libraries and many more.
 
  
You can install winetricks via pacman.
+
*{{App|PyWinery|Simple graphical prefix manager for Wine.|{{AUR|pywinery}}|https://github.com/ergoithz/pywinery}}
# pacman -S winetricks
 
Then run winetricks '''as a normal user''':
 
$ winetricks
 
  
== Alternatives to Win16 / Win32 binaries ==
+
*{{App|Q4Wine|Graphical prefix manager for Wine. Can export [[Qt]] themes into the Wine configuration for better integration.|{{AUR|q4wine}}|https://sourceforge.net/projects/q4wine/}}
  
* [[Codeweavers]] - Codeweavers' Crossover Office; Aimed at Office Users
+
== See also ==
  
== External Resources ==
+
* [https://www.winehq.org/ Wine Homepage]
* [http://www.winehq.com/ Official Wine Website]
+
* [https://wiki.winehq.org/ Wine Wiki]
* [http://appdb.winehq.org/ Wine Application Database]
+
* [https://appdb.winehq.org/ Wine Application Database (AppDB)] - Information about running specific Windows applications (Known issues, ratings, guides, etc tailored to specific applications)
* [http://linuxgamingtoday.wordpress.com/2008/02/16/quick-tips-to-speed-up-your-gaming-in-wine/ Advanced configuring your gfx card and OpenGL settings on wine; Speed up wine]
+
* [https://forum.winehq.org/ Wine Forums] - A great place to ask questions ''after'' you have looked through the FAQ and AppDB
* [http://wiki.gotux.net/code:perl:fileinfo FileInfo] - Find Win32 PE/COFF headers in EXE/DLL/OCX files under linux/unix environment.
+
* [https://wiki.gentoo.org/wiki/Wine Wine - Gentoo Wiki]

Revision as of 07:20, 18 April 2018

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.

Warning: If you can access a file or resource with your user account, programs running in Wine can too. See #Running Wine under a separate user account and Security#Sandboxing applications for possible precautions.

Installation

Wine can be installed by enabling the Multilib repository and installing the wine (stable) or wine-staging (testing) package. Wine Staging is a patched version of Wine, which contains bug fixes and features that have not been integrated into the stable branch yet. See also #Graphics drivers and #Sound.

Consider installing wine_gecko and wine-mono for applications that depend on 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.

Configuration

Configuring Wine is typically accomplished using:

  • winecfg is a GUI configuration tool for Wine, which can be started by running winecfg.
  • regedit is Wine's registry editing tool, which can be started by running regedit. See WineHQ's article on Useful Registry Keys.
  • control is Wine's implementation of the Windows Control Panel, which can be started by running wine control.
  • See WineHQ's List of Commands for the full list.

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.

Note: Wine prefixes are not sandboxes! Programs running under Wine can still access the rest of the system! (for example, Z: is mapped to /, regardless of the Wine prefix).

To create a default prefix without running a Windows program or other GUI tool you can use:

$ env WINEPREFIX=~/.customprefix wineboot -u

WINEARCH

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

Graphics drivers

You need to install the 32-bit version of your graphics driver. Please install the package that is listed in the OpenGL (Multilib) column in the table in Xorg#Driver installation.

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
Note: You might need to restart X after having installed the correct library.

Sound

By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in winecfg.

  • If you want to use the ALSA driver in Wine, you will need to install lib32-alsa-lib and lib32-alsa-plugins.
  • If you want to use the PulseAudio driver in Wine, you will need to install the lib32-libpulse package.
  • If you want to use the OSS driver in Wine, you will need to install the lib32-alsa-oss package. The OSS driver in the kernel will not suffice.
  • Games that use advanced sound systems (e.g. TESV: Skyrim) may additionally require installations of lib32-openal.

If winecfg still fails to detect the audio driver (Selected driver: (none)), configure it via the registry. For example, in a case where the microphone was not working in a 32-bit Windows application on a 64-bit stock install of wine-1.9.7, this provided full access to the sound hardware (sound playback and mic): open regedit, look for the key HKEY_CURRENT_USER → Software → Wine → Drivers, and add a string called Audio and give it the value alsa. Also, it may help to recreate the prefix.

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, as explained in MIDI. Last but not least you need to make sure Wine will use the correct MIDI output.

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 use a color management engine (e.g. pdf viewers, image viewers, etc) may require lib32-lcms2.
  • Some applications that require encryption support may require lib32-gnutls.

Fonts

If Wine applications are not showing easily readable fonts, you may not have any fonts installed. To easily link all of the system fonts so they are accessible from wine:

 cd ${WINEPREFIX:-~/.wine}/drive_c/windows/Fonts && for i in /usr/share/fonts/**/*.{ttf,otf}; do ln -s "$i" ; done

Wine uses freetype to render fonts, and freetype's defaults changed a few releases ago. Try using this environment setting for wine programs:

 FREETYPE_PROPERTIES="truetype:interpreter-version=35"

Another possibility is to install Microsoft's Truetype fonts into your wine prefix. See MS Fonts. If this does not help, try running winetricks corefonts first, then winetricks allfonts as a last resort.

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:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"ClientSideWithRender"="N"

For high resolution displays, you can adjust dpi values in winecfg.

See also Font configuration#Applications without fontconfig support.

Enable font smoothing

A good way to improve wine font rendering is to enable cleartype font smoothing. To enable "Subpixel smoothing (ClearType) RGB":

cat << EOF > /tmp/fontsmoothing
REGEDIT4

[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
"FontSmoothingOrientation"=dword:00000001
"FontSmoothingType"=dword:00000002
"FontSmoothingGamma"=dword:00000578
EOF

WINE=${WINE:-wine} WINEPREFIX=${WINEPREFIX:-$HOME/.wine} $WINE regedit /tmp/fontsmoothing 2> /dev/null

For more information, check the original answer

Desktop launcher menus

When a Windows application installer creates a shortcut Wine creates a .desktop file instead. The default locations for those files in Arch Linux are:

  • Desktop shortcuts are put in ~/Desktop
  • Start menu shortcuts are put in ~/.local/share/applications/wine/Programs/
Note: Wine does not support installing Windows applications for all users, so it will not put .desktop files in /usr/share/applications. See WineHQ bug 11112
Tip: If menu items were not created while installing software or have been lost, wine winemenubuilder may be of some use.

Creating menu entries for Wine utilities

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.

Removing menu entries

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*

Printing

In order to use your installed printers (both local and network) with wine applications in win32 prefixes (e.g. MS Word), install the lib32-libcups package, reboot wine (wineboot) and restart your wine application.

Usage

Warning: Do not run or install Wine applications as root! See Wine FAQ for details.

See Wine FAQ and Wine User's Guide for general information on Wine usage.

See Wine Application Database (AppDB) for information on running Windows applications in Wine.

Tips and tricks

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

Performance

CSMT

CSMT is a technology used by Wine to use a separate thread for the OpenGL calls to improve performance noticeably. Since Wine 3.3, CSMT is enabled by default. However, CSMT support needs to be enabled manually for Wine versions lower than 3.3. For vanilla Wine run wine regedit and set the DWORD value for HKEY_CURRENT_USER -> Software > Wine > Direct3D > csmt to 0x01 (enabled). For wine-staging run winecfg and enable it in the staging tab.

Further information:

Force OpenGL mode in games

Some games might 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.

DXVK

DXVK is a promising new implementation for DirectX 11 over Vulkan. This should allow for greater performance, and in some cases, even better compatibility. Battlefield 1 for example, only runs under DXVK. On the other hand, DXVK does not support all Wine games (yet).

To use it, install dxvk-binAUR for official binaries, or dxvk-gitAUR for the development version. Then run the following command to activate it in your Wineprefix (by default ~/.wine):

$ WINEPREFX=your-prefix setup_dxvk64

Use setup_dxvk32 for 32-bit applications.

Note: For Wine versions below 3.5 you need to configure Vulkan support manually, following the instructions at GitHub. wine, wine-staging and wine-staging-nine work out of the box.
Warning: DXVK overrides the DirectX 11 DLLS, which may be considered cheating in online multiplayer games, and may get your account banned. Use at your own risk!

Unregister existing 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
$ update-mime-database ~/.local/share/mime/

Alternatively you can delete all wine related stuff:

$ find ~/.local/share -name "*wine*" | xargs --no-run-if-empty rm -r

And update the cache as above.

Please note Wine will still create new file associations and even recreate the file associations if the application sets the file associations again.

Prevent new Wine file associations

Prevent wine from creating any file associations by editing the registry:

associations.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices]
"winemenubuilder"="C:\\windows\\system32\\winemenubuilder.exe -r"

Add this to your Wine registry, by running wine regedit associations.reg, or alternatively by running wine regedit and importing it from the menu in Registry > Import Registry File.

This has to be done for each WINEPREFIX which should not update file associations.

You can disable winemenubuilder for all WINEPREFIXes by setting an environment variable:

$ export WINEDLLOVERRIDES="winemenubuilder.exe=d"

Execute Windows binaries with Wine implicitly

The wine package installs a binfmt file which will allow you to run Windows programs directly, e.g. ./myprogram.exe will launch as if you had typed wine ./myprogram.exe. All you have to do in order to use this is to start/enable systemd-binfmt.service.

Note: Make sure the Windows binary is executable, otherwise the binary will not be executed: e.g. run chmod +x windows-binary.

Dual Head with different resolutions

If you have issues with dual-head setups and different display resolutions you are probably missing lib32-libxrandr.

Also installing lib32-libxinerama might fix dual-head issues with wine.

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

If you need to run these programs under Wine, you will have to compile and install a custom kernel (unless bug FS#57408 is fixed). Your kernel config will need the following options:

CONFIG_X86_16BIT=y
CONFIG_X86_ESPFIX64=y
CONFIG_MODIFY_LDT_SYSCALL=y

Burning optical media

To burn CDs or DVDs, you will need to load the sg kernel module.

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.

Show FPS overlay in games

Wine features an embedded FPS monitor which works for all graphical applications if the environment variable WINEDEBUG=fps is set. This will output the framerate to stdout. You can display the FPS on top of the window thanks to osd_cat from the xosd package. See winefps.sh for a helper script.

Running Wine under a separate user account

Note: The following approach only works when enabling root for Xorg. See Xorg#Rootless Xorg for more information.

It may be desirable to run Wine under a specifically created user account in order to reduce concerns about Windows applications having access to your home directory.

First, create a user account for Wine:

# useradd -m -s /bin/bash wineuser

Afterwards, in order to open Wine applications using this new user account you need to add the new user to the X server permissions list:

$ xhost +SI:localuser:wineuser

Finally, you can run Wine via the following command, which uses env to launch Wine with the environment variables it expects:

$ sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine arguments

It is possible to automate the process of running Windows applications with Wine via this method by using a shell script as follows:

/usr/local/bin/runaswine
#!/bin/bash
xhost +SI:localuser:wineuser
sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine "$@"

Wine applications can then be launched via:

$ runaswine "C:\path\to\application.exe"

In order to not be asked for a password each time Wine is run as another user the following entry can be added to the sudoers file: mainuser ALL=(wineuser) NOPASSWD: ALL. See Sudo#Configuration for more information.

It is recommended to run winecfg as the Wine user and remove all bindings for directories outside the home directory of the Wine user in the "Desktop Integration" section of the configuration window so no program run with Wine has read access to any file outside the special user's home directory.

Keep in mind that audio will probably be non-functional in Wine programs which are run this way if PulseAudio is used. See PulseAudio/Examples#Allowing multiple users to use PulseAudio at the same time for information about allowing the Wine user to access the PulseAudio daemon of the principal user.

Temp directory on tmpfs

To prevent Wine from writing its temporary files to a physical disk, one can define an alternative location, like tmpfs. Remove Wine's default directory for temporary files and creating a symlink:

$ rm -r ~/.wine/drive_c/users/$USER/Temp
$ ln -s /tmp/ ~/.wine/drive_c/users/$USER/Temp

Prevent installing Mono/Gecko

If Gecko and/or Mono are not present on the system nor in the Wine prefix, Wine will prompt to download them from the internet. If you do not need Gecko and/or Mono, you might want to disable this dialog, by setting the WINEDLLOVERRIDES environment variable to mscoree=d;mshtml=d.

Vulkan

Vulkan support is included, since Wine 3.3. The default Wine Vulkan ICD loader works fine for most applications, but does not support advanced features, like Vulkan layers. To use these features, you have to install the official Vulkan SDK, see step 2-4 on the original Vulkan patches author's GitHub page.

Note: The Wine ICD loader was added in Wine 3.5, you need to install the official Vulkan SDK to use Vulkan in Wine 3.3 and 3.4

Third-party applications

These have their own communities and websites, and are not supported by greater Wine community. See Wine Wiki for more details.

  • CrossOver — Paid, commercialized version of Wine which provides more comprehensive end-user support.
crossoverAUR || https://www.codeweavers.com/
  • exe-thumbnailer — Generates thumbnails for Windows executable files (.exe, .lnk, .msi, and .dll).
exe-thumbnailerAUR || https://github.com/exe-thumbnailer/exe-thumbnailer
  • Lutris — Gaming launcher for all types of games, including Wine games (with prefix management), native Linux games and emulators.
lutrisAUR || https://lutris.net/
  • PlayOnLinux — Graphical prefix manager for Wine. Contains scripts to assist with program installation and configuration.
playonlinux || https://www.playonlinux.com/
  • PyWinery — Simple graphical prefix manager for Wine.
pywineryAUR || https://github.com/ergoithz/pywinery
  • Q4Wine — Graphical prefix manager for Wine. Can export Qt themes into the Wine configuration for better integration.
q4wineAUR || https://sourceforge.net/projects/q4wine/

See also