Ask some Windows users why they aren’t using Linux and chances are you will hear “because [program] doesn’t have a Linux version.” Although cross-platform software is popping up all over the place, there are still a number of applications that are restricted to a single platform – and for a lot of software, that platform is Microsoft Windows.
However, all is not lost. Although Linux has its own executable format and set of system libraries, a tool exists that will allows us to run a good portion of our Windows applications directly in Linux. This tool is of course, Wine. Wine initially began as a small project that was designed to run simple 16-bit Windows applications. As time went on, the target shifted to 32-bit applications and the long and hard process of rewriting Windows’ user-mode libraries began.
A Windows application consists of binary machine code contained within a PE (Portable Executable) file. More than likely, the application makes use of one or more of Windows’ user-mode libraries for things like accessing files, creating graphical interfaces, and network communication. When Windows loads the application and begins running the code contained inside, it needs to know what user-mode libraries the application needs in order to run. This information is stored inside the executable file. Whenever the application needs to access a file or have the operating system perform some other task, it invokes the appropriate function in the user-mode library.
How does all of this relate to Wine? Well, Wine contains its own versions of most common Windows user-mode libraries and when it runs a Windows application, it simply directs the program to use its version of the libraries. Under those circumstances, the Windows application doesn’t really need to even be modified since it is performing the same instructions as it would on Windows – the only difference being that the user-mode libraries (and the appropriate code inside them) is designed to run on Linux.
How to Install Wine
The easiest way to install Wine on Linux is to check your system’s package manager to see if it already contains a pre-compiled binary that you can install. In Ubuntu, you can easily do this by visiting the Software Center and searching for ‘wine.’ If you prefer to install packages from the command line, use the following on a recent version of Ubuntu to install Wine:
Compiling Wine from scratch is slightly more difficult but provides you with access to the latest development versions. In order to go this route, you will need to determine what packages Wine requires for building. First off, you will need to make sure that you have a working C++ compiler (ideally g++ from the GNU Compiler Collection). The next step is to determine what packages provide the development files that Wine uses. Determining this can be tricky – a great place to find this information is the source package build dependencies page for a common distro like Ubuntu, for example, lists all of the packages that the wine1.3 package needs to build on Ubuntu. Thankfully, if you are using Ubuntu, there is a very easy way to install all of them – run this command:
Once you have all of the build dependencies installed, it’s simply a matter of getting the Wine source and compiling it. You can download one of the prepackaged source archives or you can checkout the latest development code from the Git repository using:
This will create a ‘wine1.3′ folder in the current directory with the Wine source code. Once you have the source code, you can run the following command to compile and install Wine:
However, all is not lost. Although Linux has its own executable format and set of system libraries, a tool exists that will allows us to run a good portion of our Windows applications directly in Linux. This tool is of course, Wine. Wine initially began as a small project that was designed to run simple 16-bit Windows applications. As time went on, the target shifted to 32-bit applications and the long and hard process of rewriting Windows’ user-mode libraries began.
How Wine Works
Learning how to use Wine is easier if you understand exactly what Wine does. In order to explain things further, we need to take a look at how Windows applications work. This explanation might get a bit technical so feel free to skip this section if you have trouble understanding it.A Windows application consists of binary machine code contained within a PE (Portable Executable) file. More than likely, the application makes use of one or more of Windows’ user-mode libraries for things like accessing files, creating graphical interfaces, and network communication. When Windows loads the application and begins running the code contained inside, it needs to know what user-mode libraries the application needs in order to run. This information is stored inside the executable file. Whenever the application needs to access a file or have the operating system perform some other task, it invokes the appropriate function in the user-mode library.
How does all of this relate to Wine? Well, Wine contains its own versions of most common Windows user-mode libraries and when it runs a Windows application, it simply directs the program to use its version of the libraries. Under those circumstances, the Windows application doesn’t really need to even be modified since it is performing the same instructions as it would on Windows – the only difference being that the user-mode libraries (and the appropriate code inside them) is designed to run on Linux.
How to Install Wine
sudo apt-get install wine1.3
sudo apt-get build-dep wine1.3
git clone git://source.winehq.org/git/wine.git wine1.3
This will create a ‘wine1.3′ folder in the current directory with the Wine source code. Once you have the source code, you can run the following command to compile and install Wine:
./configure ; make ; sudo make install
Comments
Post a Comment