Can I run Windows software on UNIX?As strange as it sounds, yes. You can run SOME Windows software on UNIX systems using WINE.
WINE is a recursive acronym that means "WINE Is Not an Emulator", but it could easily mean "Windows Is Nearly Exinct".
🙂 It runs on Linux, FreeBSD, and Solaris, and possibly some other *NIX variants too. It is a free implementation of the Win32 API that, among other things, lets you run Windows software on *NIX.
There are several independantly maintained "forks" of WINE, in addition to the "official" tree maintained by
WINE Headquarters. The most popular fork, even more popular than the official tree, is
WineX, a gaming-centric fork maintained by
Transgaming Technologies. This fork has the distinct advantage of DirectX 8.0 support, allowing you to play many recent Windows games. I use WineX, so the instructions in this FAQ will be based on it, but most, if not all, of it should work just fine with the official tree, which will be referred to throughout this FAQ as
WineHQ.
Before you can use WINE, you need to install it. Binary releases (RPMs, apt-gettable packages, ports, etc) are available, but are often outdated. If your distro comes with a WINE package, don't install it, or if you already did, remove it. By following this FAQ, you will be getting the WINE source code from a CVS server, and compiling it yourself.
You must now decide if you want the WineHQ or WineX version.
NOTE: In the commands below, wherever it says : pserver: below, remove the space between the colon
🙂 ) and pserver. I had to add the space to keep the forum from screwing it up.
To get the
WineHQ source:
1. Open a shell window.
2.
cvs -d : pserver:cvs@cvs.winehq.com:/home/wine login
3. You will be asked for the password. It is
cvs
4.
cvs -z3 -d : pserver:cvs@cvs.winehq.com:/home/wine co wine
Or, to get the
WineX source:
1. Go to
Transgaming's Site and read the licence.
2. Open a shell window.
3.
cvs -d : pserver:anonymous@cvs.winex.sourceforge.net:/cvsroot/winex login
4. You will be asked for the password. Just hit enter.
5.
cvs -z3 -d : pserver:anonymous@cvs.winex.sourceforge.net:/cvsroot/winex co -r winex-2-0-branch wine
Either way, the last command will begin the download. It will take a few minutes. When it is done, you will have the source code in the
wine subdirectory of wherever you were when you ran the above commands. You will need to compile and install it next.
While still in the shell window:
1. Become root.
su and enter your root password when asked.
2.
cd wine
3.
tools/wineinstall
4. It will take a long time for WINE to compile, so go do something productive.
5. When it is done compiling, it will ask a few questions. If I recall correctly, they are all yes/no questions, and you should answer 'yes' to all of them. If the setup program asks for a "fake windows root" directory, it will offer a default setting of
/c. Accept that.
6. Open
/etc/ld.so.conf in a text editor. If there is a
/usr/local/lib line in it, no changes need to be made. If there isn't, add it.
7.
ldconfig
8.
chmod -R 777 /c
8.5. Optional for better performance, but a very serious security risk:
chmod 777 /dev/mem
9.
exit
10.
cd ~
11.
su and enter root password when asked.
12.
chown -R (your username) .wine
13.
exit
14.
which wine
If it says
/usr/local/bin/wine you're all set. If it says
No wine found in {big list of directories} then do
export PATH=$PATH:/usr/local/bin
Now WINE is installed, but you still have to do some additional configuration before you can run all of your favorite Windows apps.
1. Open
~/.wine/config in a text editor.
2. The first few stanzas define the drive letters that your Windows software will see. Make sure the Floppy and CD-ROM sections point to the proper locations.
3. Now scroll down to the x11drv section. Here you will find options that control the appearance of Windows apps. The following settings are good to know:
PerfectGraphics: The performance hit isn't that bad, and has no effect on games. Set this to
Y.
Managed: This makes Windows apps behave more like proper X client apps. I set this to
N, and run WINE with the --managed switch when starting an app I want to use like this.
Desktop: When this is uncommented, Windows apps will be confined to a window whose demensions are specified here. Some games won't work if this is enabled, some won't work if it isn't enabled. This is one of the many things to play with if a program doesn't work at first. Put a semicolon (; ) in front of this line to disable it, and remove the semicolon to enable it.
DesktopDoubleBuffered: Set this to
Y.
4. Save the file and exit the editor.
It is now time to give things a little test.
1. Find a simple Windows app, such as Notepad, or SkiFree, or something like that.
2. Put it in the
/c directory.
3.
cd /c
4.
wine ./appname.exe
5. If all has gone well, you will see some font-related stuff scroll by for awhile, and then the app will appear. If it doesn't, chances are you got some bad source code. Uninstall WINE and try again...
If all went well with that test, it's time to put WINE to some serious use. Try installing Microsoft Office, or your favorite Windows game. Keep in mind that very few games work perfectly, and most don't work at all.
WINE must be run from a command line. The basic structure of the command is:
wine --wine --switches -- ./appname.exe -app -switches
The final -- before the ./appname.exe tells WINE that the switches that follow are for the Windows app, not WINE. For example:
wine --debugmsg -all -- ./MaxPayne.exe -developer
The above will tell WINE not to show any debugging messages, and to pass the -developer switch to the app (Max Payne in this case. It enables the console, allowing entry of cheat commands!
😀)
Omitting the --, however, will have fatal consequences:
wine --debugmsg -all ./MaxPayne.exe -developer
The above would produce an error, since WINE doesn't understand the -developer switch.
Congratulations, you have now successfully run a Windows app on UNIX! The only thing worse for Microsoft would be another barrage of pies in Bill Gates' face.
😉
If you want to uninstall WINE:
1. Open a shell window.
2. Become root.
su and enter root password when asked.
3.
cd to the directory containing the WINE source code.
4.
make uninstall