Wine (software)
Wine is a compatibility layer to allow application software and computer games developed for Microsoft Windows to run on Unix-like operating systems. Wine is free and open-source software and is predominantly written using black-box testing reverse engineering, to avoid copyright issues.
Wine is primarily developed for Linux, macOS and FreeBSD. Developers can compile Windows applications against WineLib to help port them to Unix-like systems. No code emulation or virtualization occurs, except on Apple silicon Mac computers, where Rosetta 2 is used to translate x86 code to ARM code.
In a 2007 survey by desktoplinux.com of 38,500 Linux desktop users, 31.5% of respondents reported using Wine to run Windows applications. This plurality was larger than all x86 virtualization programs combined, and larger than the 27.9% who reported not running Windows applications.
History
Bob Amstadt, the initial project leader, and Eric Youngdale started the Wine project in 1993 as a way to run Windows applications on Linux. It was inspired by two Sun Microsystems products, Wabi for the Solaris operating system, and the Public Windows Interface, which was an attempt to get the Windows API fully reimplemented in the public domain as an ISO standard but rejected due to pressure from Microsoft in 1996. Wine originally targeted 16-bit applications for Windows 3.x, but focuses on 32-bit and 64-bit versions which have become the standard on newer operating systems. The project originated in discussions on Usenet in comp.os.linux in June 1993. Alexandre Julliard has led the project since 1994.The project has proven time-consuming and difficult for the developers, mostly because of incomplete and incorrect documentation of the Windows API. While Microsoft extensively documents most Win32 functions, some areas such as file formats and protocols have no public, complete specification available from Microsoft. Windows also includes undocumented low-level functions, undocumented behavior and obscure bugs that Wine must duplicate precisely in order to allow some applications to work properly. Consequently, the Wine team has reverse-engineered many function calls and file formats in such areas as thunking.
The Wine project originally released Wine under the same MIT License as the X Window System, but owing to concern about proprietary versions of Wine not contributing their changes back to the core project, work as of March 2002 has used the LGPL for its licensing.
Wine officially entered beta with version 0.9 on 25 October 2005. Version 1.0 was released on 17 June 2008, after 15 years of development. Version 1.2 was released on 16 July 2010, version 1.4 on 7 March 2012, version 1.6 on 18 July 2013, version 1.8 on 19 December 2015 and version 9.0 on 16 January 2024. Development versions are released roughly every two weeks.
Wine-staging is an independently maintained set of aggressive patches not deemed ready by WineHQ developers for merging into the Wine repository, but still considered useful by the wine-compholio fork. It mainly covers experimental functions and bug fixes. Since January 2017, patches in wine-staging have begun to be actively merged into the WineHQ upstream as wine-compholio transferred the project to Alistair Leslie-Hughes, a key WineHQ developer., WineHQ also provides pre-built versions of wine-staging.
Corporate sponsorship
The main corporate sponsor of Wine is CodeWeavers, which employs Julliard and many other Wine developers to work on Wine and on CrossOver, CodeWeavers' supported version of Wine. CrossOver includes some application-specific tweaks not considered suitable for the upstream version, as well as some additional proprietary components.Canadian software developer Corel for a time assisted the project, chiefly by employing Julliard and others to work on it. Corel had an interest in porting WordPerfect Office, its office suite, to Linux. Corel later cancelled all Linux-related projects after Microsoft made major investments in Corel, stopping their Wine effort.
Other corporate sponsors include Google, which hired CodeWeavers to fix Wine so Picasa ran well enough to be ported directly to Linux using the same binary as on Windows; Google later paid for improvements to Wine's support for Adobe Photoshop CS2. Wine is also a regular beneficiary of Google's Summer of Code program.
Valve works with CodeWeavers to develop Proton, a Wine-based compatibility layer for Microsoft Windows games to run on Linux-based operating systems. Proton includes several patches that upstream Wine does not accept for various reasons, such as Linux-specific implementations of Win32 functions.
Design
The goal of Wine is to implement the Windows APIs fully or partially that are required by programs that the users of Wine wish to run on top of a Unix-like system.Basic architecture
The programming interface of Microsoft Windows consists largely of dynamic-link libraries. These contain a huge number of wrapper sub-routines for the system calls of the kernel, the NTOS kernel-mode program. A typical Windows program calls some Windows DLLs, which in turn calls user-mode gdi/user32 libraries, which in turn uses the kernel32.dll responsible for dealing with the kernel through system calls. The system-call layer is considered private to Microsoft programmers as documentation is not publicly available, and published interfaces all rely on subsystems running on top of the kernel. Besides these, there are a number of programming interfaces implemented as services that run as separate processes. Applications communicate with user-mode services through RPCs.Wine implements the Windows application binary interface entirely in user space, rather than as a kernel module. Wine mostly mirrors the hierarchy, with services normally provided by the kernel in Windows instead provided by a daemon known as the wineserver, whose task is to implement basic Windows functionality, as well as integration with the X Window System, and translation of signals into native Windows exceptions. Although wineserver implements some aspects of the Windows kernel, it is not possible to use native Windows drivers with it, due to Wine's underlying architecture.
Libraries and applications
Wine allows for loading both Windows DLLs and Unix shared objects for its Windows programs. Its built-in implementation of the most basic Windows DLLs, namely NTDLL, KERNEL32, GDI32, and USER32, uses the shared object method because they must use functions in the host operating system as well. Higher-level libraries, such as WineD3D, are free to use the DLL format. In many cases users can choose to load a DLL from Windows instead of the one implemented by Wine. Doing so can provide functionalities not yet implemented by Wine, but may also cause malfunctions if it relies on something else not present in Wine.Wine tracks its state of implementation through automated unit testing done at every git commit.
Graphics and gaming
While most office software does not make use of complex GPU-accelerated graphics APIs, computer games do. To run these games properly, Wine would have to forward the drawing instructions to the host OS, and even translate them to something the host can understand.DirectX is a collection of Microsoft APIs for rendering, audio and input. As of 2019, Wine 4.0 contains a DirectX 12 implementation for Vulkan API, and DirectX 11.2 for OpenGL. Direct2D support has been updated to Direct2D 1.2. Wine 4.0 also allows Wine to run Vulkan applications by handing draw commands to the host OS, or in the case of macOS, by translating them into the Metal API by MoltenVK.
; XAudio
; XInput and Raw Input
Direct3D
Much of Wine's DirectX effort goes into building WineD3D, a translation layer from Direct3D and DirectDraw API calls into OpenGL. As of 2019, this component supports up to DirectX 11. As of 12 December 2016, Wine is good enough to run Overwatch with D3D11. Besides being used in Wine, WineD3D DLLs have also been used on Windows itself, allowing for older GPUs to run games using newer DirectX versions and for old DDraw-based games to render correctly.Some work is ongoing to move the Direct3D backend to Vulkan API. Direct3D 12 support in 4.0 is provided by a "vkd3d" subproject, and WineD3D has in 2019 been experimentally ported to use the Vulkan API. Another implementation, DXVK, translates Direct3D 8, 9, 10, and 11 calls using Vulkan as well and is a separate project.
Wine, when patched, can alternatively run Direct3D 9 API commands directly via a free and open-source Gallium3D State Tracker without translation into OpenGL API calls. In this case, the Gallium3D layer allows a direct pass-through of DX9 drawing commands which results in performance improvements of up to a factor of 2. As of 2020, the project is named Gallium.Nine. It is available now as a separate standalone package and no longer needs a patched Wine version.
User interface
Wine is usually invoked from the command-line interpreter:wine program.exe.winecfg
There is the utilitywinecfg that starts a graphical user interface with controls for adjusting basic options. It is a GUI configuration utility included with Wine. Winecfg makes configuring Wine easier by making it unnecessary to edit the registry directly, although, if needed, this can be done with the included registry editor.Third-party applications
Some applications require more tweaking than simply installing the application in order to work properly, such as manually configuring Wine to use certain Windows DLLs. The Wine project does not integrate such workarounds into the Wine codebase, instead preferring to focus solely on improving Wine's implementation of the Windows API. While this approach focuses Wine development on long-term compatibility, it makes it difficult for users to run applications that require workarounds. Consequently, many third-party applications have been created to ease the use of those applications that do not work out of the box within Wine itself. The Wine wiki maintains a page of current and obsolete third-party applications.- Winetricks is a script to install some basic components and tweak settings required for some applications to run correctly under Wine. It can fully automate the install of a number of applications and games, including applying any needed workarounds. Winetricks has a GUI. The Wine project will accept bug reports for users of Winetricks, unlike most third-party applications. It is maintained by Wine developer Austin English.
- Q4Wine is an open GUI for advanced setup of Wine.
- Wine-Doors is an application management tool for the GNOME desktop which adds functionality to Wine. Wine-Doors is an alternative to WineTools which aims to improve upon WineTools' features and extend on the original idea with a more modern design approach.
- IEs4Linux is a utility to install all versions of Internet Explorer, including versions 4 to 6 and version 7.
- Wineskin is a utility to manage Wine engine versions and create wrappers for macOS.
- PlayOnLinux is an application to ease the installation of Windows applications. There is also a corresponding Macintosh version called PlayOnMac.
- Lutris is an open-source application to install Windows games on Linux.
- Bordeaux is a proprietary Wine GUI configuration manager that runs winelib applications. It also supports installation of third-party utilities, installation of applications and games, and the ability to use custom configurations. Bordeaux currently runs on Linux, FreeBSD, PC-BSD, Solaris, OpenSolaris, OpenIndiana, and macOS computers.
- Bottles is an open-source graphical Wine prefix and runners manager for Wine based on GTK4+Libadwaita. It provides a repository-based dependency installation system and bottle versioning to restore a previous state.
- WineGUI is a free and open-source graphical interface to manage Wine. It allows a user to create Wine bottles and install Windows applications or games.