Difference between revisions of "Wine"

From ArchWiki
Jump to: navigation, search
(Undo revision 225553 by Sc (talk) conclusively disproven in IRC)
m (added missing word 'a'.)
 
(200 intermediate revisions by 71 users not shown)
Line 1: Line 1:
 
[[Category:Wine]]
 
[[Category:Wine]]
 
[[cs:Wine]]
 
[[cs:Wine]]
 +
[[de:Wine]]
 
[[es:Wine]]
 
[[es:Wine]]
 
[[fr:Wine]]
 
[[fr:Wine]]
 
[[it:Wine]]
 
[[it:Wine]]
 +
[[ja:Wine]]
 
[[ru:Wine]]
 
[[ru:Wine]]
 
[[zh-CN:Wine]]
 
[[zh-CN:Wine]]
 
[[zh-TW:Wine]]
 
[[zh-TW:Wine]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|[[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.}}
+
{{Related|Steam/Wine}}
 
+
{{Related|CrossOver}}
{{Article summary heading|Related}}
+
{{Related|Wine package guidelines}}
{{Article summary wiki|Steam}}
+
{{Related articles end}}
{{Article summary wiki|CrossOver}}
+
[[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. See the [http://www.winehq.org/ official project home] and [https://wiki.winehq.org/ wiki] pages for longer introduction.
{{Article summary end}}
+
 
+
See the [http://www.winehq.org/ official project home] and [http://wiki.winehq.org/ wiki] pages for longer introduction.  
+
  
 
== Installation ==
 
== Installation ==
{{Warning| If you can access a file or resource with your user account, programs running in Wine can too. Wine prefixes are not [[wikipedia:Sandbox_%28computer_security%29|sandboxes]]. Consider using [[wikipedia:Virtualization|virtualization]] if security is important.}}
+
{{Warning|If you can access a file or resource with your user account, programs running in Wine can too. Wine prefixes are '''not''' [[wikipedia:Sandbox (computer security)|sandboxes]]. Consider using [[wikipedia:Virtualization|virtualization]] if security is important.}}
  
Wine is constantly updated and available in the <nowiki>[</nowiki>[[community]]] repository for i686 and in <nowiki>[</nowiki>[[multilib]]] for x86_64:
+
Wine can be installed with the packages {{Pkg|wine}} (stable) or {{Pkg|wine-staging}} (testing). [https://wine-staging.com/ Wine Staging] is a patched version of [https://www.winehq.org/ Wine], which contains bug fixes and features (e.g. [[#CSMT patch|CSMT patch]]), which have not been integrated into the stable branch yet. If you are running a 64-bit system, you will need to enable the [[Multilib]] repository first. See also [[#Sound]].
  
# pacman -S wine
+
You may also want to install {{pkg|wine_gecko}} and {{pkg|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.
 
+
You may also require {{pkg|wine_gecko}}, if your applications make use of Internet Explorer:
+
 
+
# pacman -S wine_gecko
+
 
+
or [http://wiki.winehq.org/Mono Mono] for .NET applications. The package {{AUR|wine-mono}} available in the [[AUR]], which will place the installer in {{ic|/usr/share/wine/mono/}} for Wine to autodetect (thus preventing Wine from redownloading the installer for every new prefix).
+
  
 
'''Architectural differences'''
 
'''Architectural differences'''
  
The default Wine is 32-bit, as is the i686 Arch package. As such, it is unable to execute any 64-bit Windows applications (which are still fairly rare at this point anyway).
+
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 Wine package for x86_64, however, is currently built with {{ic| --enable-win64}}. This activates the Wine version of [[Wikipedia:WoW64|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. The support for this feature in Wine is currently experimental and users are recommended to use a win32 {{ic|WINEPREFIX}}. See [http://wiki.winehq.org/Wine64 Wine64] for specific information on this.
+
  
To summarize, using the Arch 64-bit Wine package with {{ic|1=WINEARCH=win32}} should have the same behaviour as using the i686 Wine package.
+
The x86_64 Arch package, however, is built with {{ic|--enable-win64}}. This activates the Wine version of [[Wikipedia:WoW64|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, some 32-bit programs do not work properly in a 64-bit prefix. In that case the user will have to make separate directories/prefixes. See the [https://wiki.winehq.org/FAQ#How_do_I_create_a_32_bit_wineprefix_on_a_64_bit_system.3F Wine FAQ] for specific information on this.
  
{{Note| If you run into problems with {{ic|winetricks}} or programs with a 64-bit environment, try creating a new 32-bit {{ic|WINEPREFIX}}. See below: [[#Using_WINEARCH]]}}
+
If you run into problems with {{ic|winetricks}} or programs with a 64-bit environment, try creating a new 32-bit {{ic|WINEPREFIX}}. See below: [[#WINEARCH]]. Using the x86_64 Wine package with {{ic|1=WINEARCH=win32}} should have the same behaviour as using the i686 Wine package.
  
 
== Configuration ==
 
== Configuration ==
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 {{ic|winecfg}}. The prefix directory also contains a tree which your Windows programs will see as {{ic | C:\}} (C-drive)
+
Configuring Wine is typically accomplished using:
 +
* [https://wiki.winehq.org/Winecfg winecfg] is a GUI configuration tool for Wine. You can run it from a console window with: {{ic|$ wine winecfg}}, or {{ic|1=$ WINEPREFIX=~/.some_prefix wine winecfg}}.
 +
* {{ic|control.exe}} is Wine's implementation of Windows' Control Panel which can be accessed with: {{ic|$ wine control}}.
 +
* [https://wiki.winehq.org/FAQ#How_do_I_edit_the_Wine_registry.3F regedit] is Wine's registry editing tool. If ''winecfg'' and the Control Panel are not enough, see WineHQ's article on [https://wiki.winehq.org/Useful_Registry_Keys Useful Registry Keys].
 +
* See WineHQ's [https://wiki.winehq.org/List_of_Commands List of Commands] for the full list.
  
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.  
+
=== 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).
  
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 separate "C:\" and registries.
+
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.
 +
 
 +
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.
 +
 
 +
{{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).}}
  
 
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
  
Configuring Wine is typically accomplished using:
+
=== WINEARCH ===
* [http://wiki.winehq.org/winecfg winecfg] is a GUI configuration tool for Wine. You can run it from a console window with: {{ic|$ winecfg}}, or {{ic|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: {{ic|$ 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]
+
If you have a 64-bit system, 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.
  
=== 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 {{ic|winecfg}} will get you a 64-bit wine 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.
+
  
You can combine this with {{ic|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|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 {{ic|WINEPREFIX}}.}}
+
{{Note|1=During prefix creation, the 64-bit version of Wine treats all folders as 64-bit prefixes 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 {{ic|WINEPREFIX}}. See WineHQ bug [https://bugs.winehq.org/show_bug.cgi?id=29661 29661]}}
  
You can also use winetricks and {{ic|WINEARCH}} in one command for installing something from winetricks like this (using Steam as an example):
+
You can also use {{ic|WINEARCH}} in combination with other Wine programs, such as ''winetricks'' (using Steam as an example):
env WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam
+
{{Note|You do not have create the steam subdirectory in the {{ic|wineprefixes}} directory, it will create for you. See the Bottles section below for more information.}}
+
  
=== Graphics Drivers ===
+
WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam
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:
+
To have them permanently defined for [[Bash#Shell and environment variables|bash configuration ~/.bashrc]] do:
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:
+
export WINEPREFIX=$HOME/.config/wine/
 +
export WINEARCH=win32
  
* '''NVIDIA''': {{ic|# pacman -S lib32-nvidia-utils}} For older cards search the AUR for [http://aur.archlinux.org/packages.php?K=lib32-nvidia-utils lib32-nvidia-utils] (e.g. -173xx).
+
=== Graphics drivers ===
  
* '''NVIDIA (using nouveau-dri)''': {{ic|# pacman -S lib32-nouveau-dri}}
+
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]].
  
* '''Intel''': {{ic|# pacman -S lib32-intel-dri}} Run Wine with: {{ic|1=LIBGL_DRIVERS_PATH=/usr/lib32/xorg/modules/dri}}
+
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
* '''AMD/ATI''': {{ic|# pacman -S lib32-ati-dri}} For ATI's proprietary drivers, install {{AUR|lib32-catalyst-utils}} from the AUR.
+
  
 
{{Note|You might need to restart X after having installed the correct library.}}
 
{{Note|You might need to restart X after having installed the correct library.}}
  
 
=== Sound ===
 
=== Sound ===
By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in {{ic|winecfg}}. Currently, the [[Alsa]] driver is the most supported.
 
  
If you want to use [[Alsa]] driver in Wine, and are using x86_64, you'll need to install the {{Pkg|lib32-alsa-lib}}. If you are also using PulseAudio, you will need to install {{Pkg|lib32-libpulse}}.
+
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 best supported.
  
If you want to use [[OSS]] driver in Wine, you will need to install the {{Pkg|lib32-alsa-oss}} package. The OSS driver in the kernel will not suffice.
+
* If you want to use the [[ALSA]] driver in Wine on a 64-bit system, 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.
  
If {{ic|winecfg}} '''still''' fails to detect the audio driver (Selected driver: (none)), [http://wiki.jswindle.com/index.php/Wine_Registry#Configuring_Sound configure it via the registry].
+
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 wasn't 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, if you are using a 64-bit Arch, it may help to [[#WINEARCH|recreate the prefix]].  
  
 
Games that use advanced sound systems may require installations of {{Pkg|lib32-openal}}.
 
Games that use advanced sound systems may require installations of {{Pkg|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, as explained in [[MIDI]]. Last but not least you need to make sure Wine will use the correct MIDI output.
  
 
=== Other libraries ===
 
=== Other libraries ===
  
Some applications require ability to parse HTML or XML (they use MSXML library), in such case you need to install {{Pkg|lib32-libxml2}}.
+
*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}}.
  
Applications that play music may require {{Pkg|lib32-mpg123}}.
+
*Some applications that play music may require {{Pkg|lib32-mpg123}}.
  
For application that use native image manipulation libraries installation of {{Pkg|lib32-giflib}} and {{Pkg|lib32-libpng}} may be required.
+
*Some applications that use a color management engine (e.g. pdf viewers, image viewers, etc) may require {{Pkg|lib32-lcms2}}.
  
For encryption support on x86_64 you need to install {{Pkg|lib32-gnutls}}.
+
*Some applications that use native image manipulation libraries may require {{Pkg|lib32-giflib}} and {{Pkg|lib32-libpng}}.
  
===Fonts===
+
*Some applications that require encryption support may require {{Pkg|lib32-gnutls}}.
  
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}}.
+
=== Fonts ===
  
After running such programs, kill all wine servers and run {{ic|winecfg}}. Fonts should be legible now.
+
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 corefonts}} first, then {{ic|winetricks allfonts}} as a last resort.
 +
 
 +
After running such programs, kill all Wine servers and run {{ic|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]:
 
 
  [HKEY_CURRENT_USER\Software\Wine\X11 Driver]
 
  [HKEY_CURRENT_USER\Software\Wine\X11 Driver]
 
  "ClientSideWithRender"="N"
 
  "ClientSideWithRender"="N"
  
=== Desktop Launcher Menus ===
+
See also [[Font configuration#Applications without fontconfig support]].
By default, installation of Wine does not create desktop menus/icons for the software which comes with Wine (e.g. for {{ic|winecfg}}, {{ic|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. {{ic|setup.exe}}) would normally add an icon to your Desktop or "Start Menu" on Windows, then Wine should create corresponding freedesktop.org style {{ic|.desktop}} files for launching your programs with Wine.
+
  
{{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.}}
+
=== Desktop launcher menus ===
  
If you wish to add on to the menu to create an Ubuntu-like Wine sub-menu, then follow these instructions:
+
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/}}
  
==== Creating Menu Entries ====
+
{{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]}}
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 {{ic|"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
+
{{Tip|If menu items were ''not'' created while installing software or have been lost, {{ic|wine winemenubuilder}} may be of some use.}}
'''Name''': Uninstall Programs
+
'''Command''': wine uninstaller
+
'''Comment''': Uninstall Windows programs under Wine properly
+
  
'''Type''': Application
+
==== Creating menu entries for Wine utilities ====
'''Name''': Browse C:\
+
'''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:
+
  
{{ic|Configuration}} launcher:
+
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.
Icon[en_US]=wine-winecfg
+
 
Icon=wine-winecfg
+
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/}}:
{{ic|Uninstall Programs}} launcher:
+
 
Icon[en_US]=wine-uninstaller
+
{{hc|wine-browsedrive.desktop|2=
Icon=wine-uninstaller
+
[Desktop Entry]
{{ic|Browse C:\}} launcher:
+
Name=Browse C: Drive
Icon[en_US]=wine-winefile
+
Comment=Browse your virtual C: drive
Icon=wine-winefile
+
Exec=wine winebrowser c:
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].
+
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;
 +
}}
  
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/}}.
+
And create the following file in {{ic|~/.config/menus/applications-merged/}}:
  
Wait a second, they are not in the menu yet! There is one last step. Create the following text file: {{hc|~/.config/menus/applications-merged/wine-utilities.menu|<nowiki>
+
{{hc|wine.menu|<nowiki>
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
+
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
+
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
+
<Menu>
  <Name>Applications</Name>
+
  <Name>Applications</Name>
  <Menu>
+
  <Menu>
    <Name>wine-wine</Name>
+
    <Name>wine-wine</Name>
    <Directory>wine-wine.directory</Directory>
+
    <Directory>wine-wine.directory</Directory>
    <Include>
+
    <Include>
<Filename>wine-Configuration.desktop</Filename>
+
      <Category>Wine</Category>
    </Include>
+
    </Include>
    <Include>
+
  </Menu>
<Filename>wine-Browse C:\.desktop</Filename>
+
</Menu>
    </Include>
+
    <Include>
+
<Filename>wine-Uninstall Programs.desktop</Filename>
+
    </Include>
+
  </Menu>
+
</Menu>
+
 
</nowiki>}}
 
</nowiki>}}
Go check in the menu and there should be the minty fresh options waiting to be used!
 
  
==== KDE 4 Menu Fix[https://bugs.launchpad.net/ubuntu/+source/wine/+bug/263041] ====
+
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].
The Wine menu items may appear in {{ic|"Lost & Found"}} instead of the Wine menu in KDE 4. This is because {{ic|kde-applications.menu}} is missing the {{ic|MergeDir}} option.
+
  
Edit {{ic|/etc/xdg/menus/kde-applications.menu}}
+
==== Removing menu entries ====
  
At the end of the file add {{ic|<MergeDir>applications-merged</MergeDir>}} after {{ic|<DefaultMergeDirs/>}}, it should look like this:
+
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.
        <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:
+
In addition to remove unwanted extensions binding by Wine, execute the following commands (taken from the Wine website):
  ln -s ~/.config/menus/applications-merged ~/.config/menus/kde-applications-merged
+
  $ 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*
  
This has the added bonus that an update to KDE won't change it, but is per user instead of system wide.
+
== Using Windows applications ==
  
== Running Windows Applications ==
+
{{Warning|Do not run or install Wine applications as root! See [https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F Running Wine as root] for the official statement.}}
{{Warning|Do not run or install Wine applications as root! See [http://wiki.winehq.org/FAQ#run_as_root Running Wine as root] for the official statement.}}
+
To run a windows application:
+
$ wine <path to exe>
+
  
To install using an MSI installer, use the included msiexec utility:
+
See [https://wiki.winehq.org/FAQ#Installing_Windows_Applications Installing Windows Applications] at WineHQ. See [[#Desktop launcher menus]] for information on where the shortcuts were created.
$ msiexec installername.msi
+
 
 +
See [https://wiki.winehq.org/FAQ#Running_applications Running applications] at WineHQ. The {{ic|.desktop}} files created by the installer should automatically appear as entries in any X menu or file manager applications. They can also be examined to determine what command to use to run the application from a terminal.
 +
 
 +
See [https://wiki.winehq.org/FAQ#How_do_I_uninstall_Windows_applications.3F How do I uninstall Windows applications?] at WineHQ.
 +
 
 +
== Tips and tricks ==
  
== Tips and Tricks ==
 
 
{{Tip|In addition to the links provided in the beginning of the article the following may be of interest:
 
{{Tip|In addition to the links provided in the beginning of the article the following may be of interest:
 
* [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://appdb.winehq.org/ The Wine Application Database (AppDB)] - Information about running specific Windows applications (Known issues, ratings, guides, etc tailored to specific applications)
Line 218: Line 218:
 
}}
 
}}
  
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.
+
=== Wineconsole ===
  
=== Installing Microsoft Office ===
+
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:
  
A small tweak is needed to install the office suite. Follow these steps to accomplish it:
+
$ wineconsole cmd
  
$ WINEARCH=win32 WINEPREFIX=/path/to/wineprefix winecfg
+
Then navigate to the directory and run the ''.exe'' file from there.
# pacman -S winetricks
+
$ winetricks msxml3 # For MS Office 2007
+
$ winetricks msxml3 msxml6 # For MS Office 2010
+
$ wine /path/to/office_cd/setup.exe
+
  
For additional info, see the [http://appdb.winehq.org/appview.php?iVersionId=4992 WineHQ] article.
+
=== Winetricks ===
  
=== OpenGL Modes ===
+
[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.
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.
+
 
 +
[[Install]] the {{pkg|winetricks}} package (or alternatively {{AUR|winetricks-git}}). Then run it with:
 +
$ winetricks
 +
 
 +
=== CSMT patch ===
 +
 
 +
Since 2013 Wine developers have been experimenting with [http://www.winehq.org/pipermail/wine-devel/2013-September/101106.html stream/worker thread optimizations]. 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 known as CSMT patch and works with NVidia and AMD graphics cards.
 +
 
 +
[http://www.wine-staging.com/ Wine-staging] includes CSMT support (included again since [http://www.wine-staging.com/news/2016-05-18-release-1.9.10.html version 1.9.10]), and can be installed with the {{Pkg|wine-staging}} package.
 +
 
 +
CSMT support needs to be enabled before it can be used, instructions can be found [https://github.com/wine-compholio/wine-staging/wiki/CSMT#enabledisable-csmt here], no further configuration is needed.
 +
 
 +
Further information:
 +
*[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
 +
*[https://www.youtube.com/playlist?list=PL0P2a_sII2eTd8uq-azTNpQjiFLqBhDjg Here] you find some game videos running with CSMT enabled
 +
 
 +
=== 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:
 +
 
 +
$ 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 | grep wine | xargs rm
 +
 
 +
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 ===
 +
 
 +
To prevent wine from creating any file associations edit your {{ic|$WINEPREFIX/system.reg}} file, Search for {{ic|winemenubuilder}} and remove {{ic|-a}}, so you'll get:
 +
 
 +
{{hc|1=$WINEPREFIX/system.reg|2=
 +
[Software\\Microsoft\\Windows\\CurrentVersion\\RunServices]
 +
"winemenubuilder"="C:\\windows\\system32\\winemenubuilder.exe -r"
 +
}}
 +
 
 +
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"
 +
 
 +
=== Dual Head with different resolutions ===
 +
 
 +
If you have issues with dual-head setups and different display resolutions you are probably missing {{Pkg|lib32-libxrandr}}.
 +
 
 +
Also installing {{Pkg|lib32-libxinerama}} might fix dual-head issues with wine.
 +
 
 +
=== 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. Install it with the {{AUR|gnome-exe-thumbnailer}} package.
 +
 
 +
=== 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 [[Locale|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''
 +
 
 +
=== 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 the {{ic|/etc/binfmt.d/wine.conf}} file with the following content:
 +
{{hc|/etc/binfmt.d/wine.conf|2=
 +
# Start WINE on Windows executables
 +
:DOSWin:M::MZ::/usr/bin/wine:
 +
}}
 +
 
 +
[[systemd]] automatically mounts the {{ic|/proc/sys/fs/binfmt_misc}} filesystem using {{ic|proc-sys-fs-binfmt_misc.mount}} (and automount) and runs the {{ic|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.
 +
 
 +
=== 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: [http://www.spinics.net/linux/fedora/fedora-users/msg450821.html Fedora Mailing List]
 +
 
 +
=== 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.
 +
 
 +
=== Force OpenGL mode in games ===
 +
 
 +
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 {{Ic|-opengl}} parameter.
 
  $ wine /path/to/3d_game.exe -opengl
 
  $ 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.
 
You should of course refer to your application's documentation and Wine's [http://appdb.winehq.org AppDB] for such application specific information.
  
=== Using Wine as an interpreter for Win16/Win32 binaries ===
+
=== Show FPS overlay in games ===
It is also possible to tell the kernel to use wine as an interpreter for all Win16/Win32 binaries. First mount the {{ic|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 ===
+
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.
  
Often you may need to run {{ic|.exes}} to patch game files, for example a widescreen mod for an old game, and running the {{ic|.exe}} normally through wine might yield nothing happening. In this case, you can open a terminal and run the following command:
+
=== Installing .NET Framework 4.0 ===
  
  $ wineconsole cmd
+
First create a new 32-bit Wine prefix if you are on a 64-bit system.
 +
  $ WINEARCH=win32 WINEPREFIX=~/win32 winecfg
  
Then navigate to the directory and run the {{ic|.exe}} file from there.
+
Then install the following packages using winetricks
 +
$ WINEARCH=win32 WINEPREFIX=~/win32 winetricks -q msxml3 dotnet40 corefonts
  
=== Winetricks ===
+
=== Installing Microsoft Office ===
[http://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.
+
==== Office 2010 ====
 +
Microsoft Office 2010 works without any problems (tested with Microsoft Office Home and Student 2010, Wine 1.7.5; Microsoft Office Professional Plus 2010, Wine 1.7.51). Activation over Internet also works.
  
You can install {{pkg|winetricks}} via [[pacman]] or use the {{AUR|winetricks-svn}} package available in the [[AUR]]. Then run it with:
+
Start by installing {{pkg|wine-mono}}, {{pkg|wine_gecko}}, {{pkg|samba}}, {{pkg|lib32-libxslt}} and {{pkg|lib32-libxml2}}.
$ winetricks
+
 
 +
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 ({{ic|~/.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 {{ic|riched20}} (under libraries) to {{ic|(native,builtin)}}. This will enable PowerPoint to work and makes the drop-down list of countries visible for phone activation.
 +
 
 +
For OneNote to work, run {{ic|winetricks wininet}} and then make sure that {{ic|wininet}} is set to {{ic|(native,builtin)}}
 +
 
 +
For additional info, see the [http://appdb.winehq.org/appview.php?iVersionId=4992 WineHQ] article.
 +
 
 +
As an alternative to the above method, {{Pkg|playonlinux}} provides custom installer scripts that make the installation of Office 2003, 2007 and 2010 an ease. You just have to provide the ''setup.exe'' or ISO and the installer will guide you seamlessly through the installation procedure. You do not have to deal with the underlying Wine at all. The playonlinux installation for Office 2010 improves on the minimum installation instructions provided above by enabling xml conversions for Word documents created with certain earlier versions of Word.
 +
 
 +
==== Office 2013 ====
 +
{{Out of date|[https://www.winehq.org/announce/1.7.55 Wine 1.7.55]}}
 +
[https://www.codeweavers.com/ CodeWeawers] managed to install and run Microsoft Office 2013 with many bugs. It is still pretty unusable. You can read more [https://www.codeweavers.com/about/blogs/caron/2015/07/13/two-weeks-in-crossover-microsoft-office-2013-installs-and-launches here].
 +
 
 +
==== Office 2016 ====
 +
Doesn't work.
  
 
== Third-party interfaces ==
 
== Third-party interfaces ==
These have their own sites, and are not supported in the Wine forums.
+
 
 +
These have their own sites, and are ''not supported'' in the official Wine forums/bugzilla.
 +
 
 
=== CrossOver ===
 
=== CrossOver ===
 +
 
[http://www.codeweavers.com/about/ CrossOver] Has its own [[CrossOver|wiki page]].
 
[http://www.codeweavers.com/about/ CrossOver] Has its own [[CrossOver|wiki page]].
 +
 
=== PlayOnLinux/PlayOnMac ===
 
=== PlayOnLinux/PlayOnMac ===
[http://www.playonlinux.com/ 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 (eg. because of regressions). If you need to know which Wine version works best for a certain game, try the [http://appdb.winehq.org/ Wine Application Database]. You can find the {{Pkg|playonlinux}} package in [[community]].
+
 
 +
[http://www.playonlinux.com/ 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 [http://appdb.winehq.org/ Wine Application Database]. You can find the {{Pkg|playonlinux}} package in [[community]].
 +
 
 +
{{Tip| PlayOnLinux supports Bumblebee. Open POL console, type this command {{ic|POL_Config_Write PRE_WINE '''optirun'''}} and hit enter. '''optirun''' command will used and each application will be run using '''optirun'''. You can even use '''primusrun''' instead!}}
  
 
=== PyWinery ===
 
=== PyWinery ===
[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, {{ic|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 {{ic|.exe}} files, so you can choose between any wine configuration you have.
+
[https://github.com/ergoithz/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 {{AUR|pywinery}} 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 ===
 +
 
 +
[http://sourceforge.net/projects/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 {{Pkg|q4wine}} package in [[multilib]].
 +
 
 +
== See also ==
  
== External Resources ==
+
* [http://www.winehq.com/ Official Wine website]
* [http://www.winehq.com/ Official Wine Website]
+
* [http://appdb.winehq.org/ Wine application database]
* [http://appdb.winehq.org/ Wine Application Database]
+
* [http://linuxgamingtoday.wordpress.com/2008/02/16/quick-tips-to-speed-up-your-gaming-in-wine/ Advanced configuring of video card and OpenGL in Wine; Speed up Wine]
* [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]
+
* [http://wiki.gotux.net/code:perl:fileinfo FileInfo] - Find Win32 PE/COFF headers in exe/dll/ocx files under Linux/Unix environment.
* [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 Gentoo's Wine Wiki Page]

Latest revision as of 04:50, 21 July 2016

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.

Installation

Warning: If you can access a file or resource with your user account, programs running in Wine can too. Wine prefixes are not sandboxes. Consider using virtualization if security is important.

Wine can be installed with the packages wine (stable) or wine-staging (testing). Wine Staging is a patched version of Wine, which contains bug fixes and features (e.g. CSMT patch), which have not been integrated into the stable branch yet. If you are running a 64-bit system, you will need to enable the Multilib repository first. See also #Sound.

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, some 32-bit programs do not work properly in a 64-bit prefix. In that case the user will have to make separate directories/prefixes. See the Wine FAQ 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: $ wine winecfg, or $ WINEPREFIX=~/.some_prefix wine 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 are not enough, see WineHQ's article on Useful Registry Keys.
  • 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

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
Note: During prefix creation, the 64-bit version of Wine treats all folders as 64-bit prefixes 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. See WineHQ bug 29661

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 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.

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. Currently, the Alsa driver is the best supported.

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 wasn't 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, if you are using a 64-bit Arch, it may help to recreate the prefix.

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, 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 Microsoft's Truetype fonts installed. 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:

[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"ClientSideWithRender"="N"

See also Font configuration#Applications without fontconfig support.

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*

Using Windows applications

Warning: Do not run or install Wine applications as root! See Running Wine as root for the official statement.

See Installing Windows Applications at WineHQ. See #Desktop launcher menus for information on where the shortcuts were created.

See Running applications at WineHQ. The .desktop files created by the installer should automatically appear as entries in any X menu or file manager applications. They can also be examined to determine what command to use to run the application from a terminal.

See How do I uninstall Windows applications? at WineHQ.

Tips and tricks

Tip: In addition to the links provided in the beginning of the article the following may be of interest:

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

CSMT patch

Since 2013 Wine developers have been experimenting with stream/worker thread optimizations. 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 known as CSMT patch and works with NVidia and AMD graphics cards.

Wine-staging includes CSMT support (included again since version 1.9.10), and can be installed with the wine-staging package.

CSMT support needs to be enabled before it can be used, instructions can be found here, no further configuration is needed.

Further information:

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 | grep wine | xargs rm

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

To prevent wine from creating any file associations edit your $WINEPREFIX/system.reg file, Search for winemenubuilder and remove -a, so you'll get:

$WINEPREFIX/system.reg
[Software\\Microsoft\\Windows\\CurrentVersion\\RunServices]
"winemenubuilder"="C:\\windows\\system32\\winemenubuilder.exe -r"

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"

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.

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. Install it with the gnome-exe-thumbnailerAUR package.

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

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 the /etc/binfmt.d/wine.conf file with the following content:

/etc/binfmt.d/wine.conf
# 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.

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

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.

Force OpenGL mode in games

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.

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.

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

Installing Microsoft Office

Office 2010

Microsoft Office 2010 works without any problems (tested with Microsoft Office Home and Student 2010, Wine 1.7.5; Microsoft Office Professional Plus 2010, Wine 1.7.51). 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 and makes the drop-down list of countries visible for phone activation.

For OneNote to work, run winetricks wininet and then make sure that wininet is set to (native,builtin)

For additional info, see the WineHQ article.

As an alternative to the above method, playonlinux provides custom installer scripts that make the installation of Office 2003, 2007 and 2010 an ease. You just have to provide the setup.exe or ISO and the installer will guide you seamlessly through the installation procedure. You do not have to deal with the underlying Wine at all. The playonlinux installation for Office 2010 improves on the minimum installation instructions provided above by enabling xml conversions for Word documents created with certain earlier versions of Word.

Office 2013

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: Wine 1.7.55 (Discuss in Talk:Wine#)

CodeWeawers managed to install and run Microsoft Office 2013 with many bugs. It is still pretty unusable. You can read more here.

Office 2016

Doesn't work.

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.

Tip: PlayOnLinux supports Bumblebee. Open POL console, type this command POL_Config_Write PRE_WINE optirun and hit enter. optirun command will used and each application will be run using optirun. You can even use primusrun instead!

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.

See also