Wine

Introduction
Wine is an open-source implementation of the Windows API, built on X and UNIX. In more practical terms, this means that you can use it to run Windows programs on your Linux computer. Do not mistake Wine as a machine emulator: Wine only mimics a Windows environment. It doesn't run Windows, just Windows programs. Since Wine is a reimplementation of the Windows API, you can run programs at speeds up to, or in some cases even faster than, native Windows performance.

If you want a full machine emulator go with a virtual machine such as QEmu or VirtualBox.

Cedega (former WineX) is a proprietary fork of Wine which might sometimes run some games better. It used to have superior Direct3D and copy-protection handling to Wine for a long time after the fork but nowadays Wine has passed it on the Direct3D front and has progressed much on the copy-protection front.

Stable
Install it normally through emerge :

Portage will, by default, try to drag in media-fonts/corefonts, which is non-free. To disable this, set USE="-truetype".

Latest (unstable)
If there is a new feature in Wine that you absolutely must have, there are generally newer builds in ~arch. To access these packages, one must add wine to the list of packages to unmask Code: Installing Wine ~arch (Newer, Possibly Unstable, but Possible More Features)

The first line adds the text "app-emulation/wine ~x86 or ~amd64 to the file packages.keywords, which tells portage to let you use the development version of wine. The second then emerges wine, however, you will be emerging the ~arch version of it.

Configuring Wine
The configuration file at ~/.wine/config is now deprecated. Edit your configuration with Configuring Wine 1 or Configuring Wine 2

What for?
Configuring DOS-drives is a vital thing to do if you wish to install programs via wine. This is especially important for installing and playing certain games (so that the cd/dvd-drives are detected, and to bypass cd-rom protection mechanisms), such as Warcraft 3.

Manually (old way)
Emulated DOS-drive letters are stored in ~/.wine/dosdevices, as symbolic links (symlinks). For instance, to set up /mnt/cdrom as your D: drive, you would create a symlink called "d:" in the dosdevices directory that points to /mnt/cdrom. Example symlink

winecfg (new way)
Creating the symlinks can also be done via the Wine Configuration Utility (winecfg), under the Drives tab.

Third-party configuration utilities
These aren't supported by Wine developers so report any bugs on these pieces of software on the bug trackers of the respective project. These can also interfere with debugging Wine itself so it's recommended to completely remove them and install the program inside a fresh wineprefix (usually ~/.wine) if your program doesn't work and you need help with it.

winetricks
You can also use the tool that originally expanded on sidenet, winetricks. It provides you with some Microsoft drivers, fonts, runtimes, etc.

Wine Doors
Note: The referenced link states only that Wine Doors is broken and the author has no time to fix it.

A new alternative to WineTools, called Wine Doors, is being developed. While currently immature, it is runnable. and it will hopefully become a good option in the future.

Philosophy: To provide a replacement for winetools which has apt/yum functionality to it, to do away with the bad aspects of winetools whilst keeping the good ones and expanding on the origninal idea with a more modern design approach.

Sound
Q: I get sound delay by a second or more A: Try using the OSS driver instead. If it isn't in the list, you have to enable it in the kernel and useflags.

Q: After configuring sound games won't start (or crashes) A: This is probably because you have chosen options (Sample Rate & Default Bits) your sound card or wine can't handle. "Default Sample Rate" of 22050 and 8 "Bits Per Sample" are usually safe options. Sometimes this can also be because you use the wrong driver. Try changing between them.

Q: Sound is crackled or generally bad A: Try to set Hardware Acceleration in the Audio tab of winecfg to Full. That fixes the bad sound in for instance Warcraft 3.

Video
'''Q: It seems the screen doesn't refresh after returning from a fullscreen application. I get this strange teal colour covering my screen.''' A: That can happen when the game's resolution isn't the same resolution as your desktop's. Change to your desktop's resolution in the game and it should be fine.

Q: OpenGL applications fail with a message mentioning glXChooseFBConfig You have to set your X server color depth to 24 bit in your.

Issues on amd64
On 64-bit systems, performance may be hindered by the fact that Wine, by default, uses 32-bit libraries for some functionality. If this appears to cause you problems, use wine >=1.1.13 and enable the USE flag; this will, however cause difficulties with Wine running 32-bit applications and generate the following error:

One way to work around this issue is to make a 32-bit chroot environment to run 32 bit apps (see here for instruction on creating a 32bit chroot.) and run 32-bit apps in that.

Uninstalling Wine
Uninstalling Wine is almost as easy as installing it in the first place.

To also remove the config files and programs that you installed with Wine, you'll have to delete the directory it creates in your home folder.

Note that by doing this, you'll also be removing all the Windows programs you installed, and you'll have to install them again if you decide to go back to Wine!

Font Smoothing
Open up ~/.wine/user.reg file and change "FontSmoothing" from "0" to "1". This is disabled by default due to patents on ClearType and other font-hinting techniques (ones by Apple).

You can also use  and go to. All the relevant  values are located there. Defaults seem to be:

These will affect ClearType/font-hinting. FontSmoothing must be at least 1 for any font-smoothing to occur.

Useful Links

 * Official Wine homepage
 * Wine application compatibility database
 * Wine/Cedega Games