Configuring Your System

Please read the chapter Chapter 12 before deciding where to mount Windows partitions and install applications!

If you used packages like described for Debian to install Wine your system is already configured. But before running your first application you should read this chapter to ensure that the installation and configuration have worked the way you wanted.

The configuration files for Wine are wine.conf (normally located in"/etc" if you installed packages, or in "/usr/local/etc" if you compiled your own), and ~/.winerc (in the home directory of the user). Wine utilizes the ~/.winerc file if it finds it, else the wine.conf file. In newest versions of Wine up from Wine 20001202 Wine has a new config file for the user ~/.wine/wine.conf. Wine creates it automatically from ~/.winerc and utilizes this configuration file instead of the old one on next startup. The format changed but is not covered in the HOWTO yet.

If you compiled Wine yourself, you will find a wine.ini in the root of your Wine source tree. Make a copy of it to /usr/local/etc, rename this copy to wine.conf and edit it to fit your system.

WARNING: You have to update your wine.conf or ~/.winerc, if you are using Wine compiled since 990417!

Wine With Windows Partition

Assuming you have a Windows partition, make sure that it is mounted readable and writable by the user trying to run Windows applications. Have a look at /etc/wine.conf (or /usr/local/etc). You also may have a user specified .winerc in your home directory.

The configuration file in this section is commented. This may change in a later version of the HOWTO. For now you will have to read the comments carefully to get all information you need to configure Wine well.

In our example we use four windows drives:

You will have to change in your configuration file all those mappings which do not fit your system. If you want additional drives you have to use this syntax: Name the section [Drive x] where x ist the Drive name within your Wine applications. Put in the "Path=" line to tell Wine which Linux or Unix directory should be mapped to this drive. Tell Wine the Type for Wine applications (hd for hard disks, floppy for floppy drives and cdrom for cdrom drives), filesystem type and Label (name for the drive) to use.

When you have edited your configuration file it should look like this:

Example 5-1. Sections in Wine Configuration File with Windows Partition

[Drive A]
; your floppy drive 
Path=/mnt/fd0 
Type=floppy 
Label=Floppy
Serial=87654321 
Device=/dev/fd0
; Don´t give raw device access to any drive if 
; you do not really need it. Giving device raw 
; device access with the "Device"-entry means
; that a user can format a drive with 
; any windows tool.

[Drive C]
; your Windows/Dos partition 
; please adjust to the path where it is mounted!  
Path=/dos 
Type=hd 
Label=MS-DOS 
Filesystem=msdos 
; if vfat partition: Filesystem=win95
; NO device-Entry here!

[Drive D]
; your cd-rom drive 
; please adjust to the path where it is mounted!
Path=/cdrom 
Type=cdrom 
Label=CD-Rom 
Filesystem=win95
; if you want to write CDs, you need 
; raw device access here

[Drive E]
; normally this should not be changed
; you need write access here, as it will 
; be assigned as temp dir
Path=/tmp 
Type=hd
Label=Tmp Drive 
Filesystem=win95
; WARNING: do not add a device entry!!!!

[Drive F]
Path=${HOME} 
Type=network 
Label=Home 
Filesystem=win95
; Maybe, you store applications here 
; you may add another drive, if you want to install 
; applications on your Linux partition 
; Filesystem should be "msdos" or "win95"
; if you install or run Windows 95 programs
; win95 is recommended
; WARNING: do not add a device entry!!!!

[wine]
Windows=c:\windows 
System=c:\windows\system 
Temp=e:\
Path=c:\windows;c:\windows\system;e:\;f:\ 
GraphicsDriver=x11drv
; GraphicsDriver is new and not for old
; versions of Wine. See section x11drv for it
;printer=on or printer=off
; If you use a windows printer driver this
; should be set to on
;SymbolTableFile=/usr/local/lib/wine.sym
; SymbolTableFile wir normalerweise nicht benötigt
;Profile=c:\windows\Profiles\Administrator
; only for use with Windows NT
; If you have a windows95-System, it would be better, 
; to take a clean directory as windows dir, seems there are
; some problems with the windows registry
; please note: Give all paths in dos/windows notation!
; do not change to or add something like
; "/home/windows" 
; Wine would not accept that!!!
; locate your "wine.sym" file to ensure the path to 
; it (this is to be given in Unix-notation) is
; correct
; wine.sym normally is located in /usr/local/lib or /usr/lib

; The next three sections are only for version of Wine 
; after 990323. You do not need to add them if you 
; are using an older version!
; Wine has reasonable defaults built in, 
; so you are not forced to add them
; for newer versions either.

[DllDefaults]
EXTRA_LD_LIBRARY_PATH=${HOME}/wine/cvs/lib
; This is only needed if you have additional compiled
; dlls; if not, the leave it as is.
DefaultLoadOrder = native, elfdll, so, builtin
; Not used in older Wine versions!
; The default load order for dlls used by Wine, you may
; overwrite it by command line options. Please see "man wine"
; for options

[DllPairs]
; Not used in older Wine versions!
krnl386 = kernel32
gdi     = gdi32
user    = user32
commdlg = comdlg32
commctrl= comctl32
ver     = version
shell   = shell32
lzexpand= lz32
mmsystem= winmm
msvideo = msvfw32
winsock = wsock32
; The dll pairs are needed together with the load order.
; these dlls always have to be loaded together as builtin, 
; native or whatever
; You may not load one dll of a pair as builtin and the other
; native.

[DllOverrides]
; Not used in older Wine versions!
kernel32, gdi32, user32 = builtin
krnl386, gdi, user       = builtin
toolhelp                = builtin
comdlg32, commdlg       = elfdll, builtin, native
version, ver            = elfdll, builtin, native
shell32, shell          = builtin, native
lz32, lzexpand          = builtin, native
commctrl, comctl32      = builtin, native
wsock32, winsock        = builtin
advapi32, crtdll, ntdll = builtin, native
mpr, winspool           = builtin, native
ddraw, dinput, dsound   = builtin, native
winmm, mmsystem         = builtin
msvideo, msvfw32        = builtin, native
w32skrnl                = builtin
wnaspi32, wow32         = builtin
system, display, wprocs = builtin
wineps                  = builtin
; this is the default load order for the dlls
; you may make changes here, but NEVER change the 
; first two lines!!!
; WARNING: The big ones, krnl386, kernel32, gdi, gdi32, 
; user and user32 cannot be native, but MUST be of 
; type "builtin"

[x11drv]
; Number of colors to allocate from the system palette
AllocSystemColors = 100
; Use a private color map
PrivateColorMap = N
; Favor correctness over speed in some graphics operations
PerfectGraphics = N
; Color depth to use on multi-depth screens
;;ScreenDepth = 16
; Name of X11 display to use
;;Display = :0.0
; Allow the window manager to manage created windows
Managed = N
; Use XFree86 DGA extension if present
UseDGA = Y
; Use XShm extension if present
UseXShm = Y
; Enable DirectX mouse grab
DXGrab = N
; Create the desktop window with a double-buffered visual
; (useful to play OpenGL games)
DesktopDoubleBuffered = N
; Code page used for captions in managed mode
; 0 means default ANSI code page (CP_ACP == 0)
TextCP=0
; Use this if you have more than one port for video on your setup 
; (Wine uses for now the first 'input image' it founds).
;; XVideoPort = 43
            

And now other sections for all versions

Example 5-2. Common Sections in Wine configuration File

;[options]
;AllocSystemColors=100
; This section is obsolete for new Wine versions

[fonts] 
; Read documentation/fonts before adding aliases 
Resolution = 96 
; Maybe, it is useful to play a little with this value 
Default = -adobe-times-

[serialports]
Com1=/dev/ttyS0
Com2=/dev/ttyS1
Com3=/dev/modem,38400
Com4=/dev/modem
; on older systems you may have cuax
; instead of ttySx (where x is the number)

[parallelports]
Lpt1=/dev/lp0

[spooler] 
LPT1:=|lpr 
LPT2:=|gs -sDEVICE=bj200 -sOutputFile=/tmp/fred -q - 
LPT3:=/dev/lp3

[ports] 
;read=0x779,0x379,0x280-0x2a0
;write=0x779,0x379,0x280-0x2a0

[spy] 
Exclude=WM_SIZE
;WM_TIMER
;

[registry]
; Paths must be given in /dir/dir/file.reg format.
; Wine will not understand dos file names here...
; alternate registry file name: HKCU
; obsolete for new Wine versions
;AltCurrentUserFile=
; alternate registry file name: HKU
; obsolete for new Wine versions
;AltUserFile=
; alternate registry file name: HKLM
; obsolete for new Wine versions
;AltLocalMachineFile=
; These are all booleans.  
; Y/y/T/t/1 are true, N/n/F/f/0 are false.
; Defaults are read all, write to Home and Alt
; Note: it is pointless to specify alt files 
; and neither load nor writeto them.
; Global registries (stored in /etc)
LoadGlobalRegistryFiles=Y
; Home registries (stored in ~user/.wine/)
LoadHomeRegistryFiles=Y
; Load above registries.
LoadAltRegistryFiles=Y
; TRY to write all changes to home registries
WritetoHomeRegistryFiles=Y
; TRY to write all changes to alt registries
WritetoAltRegistryFiles=Y
; Use new file format
UseNewFormat=N
; Registry periodic save timeout in seconds
; PeriodicSave=600
;
; Do you want origial Windows registry files
; to be loaded? Say yes or no to each file
; Windows registries in windows path
LoadWin311RegistryFiles=Y
LoadWin95RegistryFiles=Y
LoadWinNTRegistryFiles=N
; user the private registry is taken from
; (profiles/<username>/ntuser.dat)
; NTUser=username

[Tweak.Layout]
; WineLook=xxx	(supported styles are 'Win31'(default),
; 'Win95', 'Win98') 
WineLook=Win31

[programs] 
Default=
Startup=
            

Copy the file, for example, to wine.conf.old, before you modify anything. Alternatively you can run wineconfig, but you will have to configure it by hand to match your system.

VERY IMPORTANT NOTES FOR NEW VERSIONS OF WINE: The wine.conf has changed often in the last two years. You always should compare your configuration files with the example configuration file after an update. A simple diff to the default configuration file distributed with Wine would be useful. It is mandatory to update all your local configuration files, if you update to a newer version of Wine. You must manually add three sections to your configuration file from the wine.ini example configuration if you have an existing old configuration files. The sections in question are:

See the man-page and wine.ini for updated information.

Wine Without a Windows Partition

If you do not have a Windows drive, you should make some changes to the configuration file or create one, if there was no configuration file created during installation process. The wineconfig I used does not create a config if it does not find a Windows dir.

If you have no windows directory, you should create one. According to the file system standard this may be either in your home directory ("~/win") if you are the only user to start Windows applications, or system wide "/usr/local/lib/win". To create it do e.g.,
$ sudo mkdir -p /usr/local/lib/win/windows
            
or
$ su -c "mkdir -p /usr/local/lib/win/windows"
            

Then do not forget to:

$ cd /usr/local/lib/win/windows
	    

In addition you have to create some Windows system directories:

$ sudo mkdir system
            
or
$ su -c "mkdir system"
            

Make sure that the directory is accessible for the users who need Wine. Sometimes it is a good idea to set the sticky bit to the directory /usr/local/lib/win/ before creating the subdirectories to set all directories to the correct mask, when creating them. The applications now can be installed to any dir in /usr/local/lib/win. You should touch some files, too, as some applications need to see them in the windows directory:

$ sudo touch win.ini
$ cd system
$ sudo touch shell.dll shell32.dll winsock.dll wsock32.dll
	    

If you want to have a personal Wine installation, create the directories ~/win, ~/win/windows and ~/win/windows/system, as described above. In the "wine.conf" and ".winerc" above, you have to change the Wine section and create a new drive section for Windows. If you do not want to use any application already installed on drive C, you may substitute the drive letter "H" as shown in our next example by "C". In section "wine" you will have to substitite "h" by "c", too. We have chosen "H" for the windows drive as some windows applications write absolute path statements to their ini files including the drive letter. If you take H for your Wine windows drive you may use C for a drive with windows applications.

As a Unix file system is case sensitive, do not use "unix" as a file system setting in the config file!

In the dll-sections mentioned above, you may need to make some changes. Loading native dlls of the windows operating system makes no sense, if you do not have them.

As the changes are really new, I do not have much experience with the dll-sections. But the defaults as above do not work. My dll-sections look like this:

For additional information see the file "config" in the Wine documentation directory and the man page.

User Configuration

If users prefer, they may create a file .winerc in their home directory. It looks the same as the wine.conf in "etc".

The first time Wine is run, it will create a ".wine" directory within the user's home directory. Some programs will write their .ini files there.

Test the Installation

The first test should be to run Wine on its own and ask it for its version. Open an xterm and type

$ wine -version
Wine release 20001026
            

This should give the version of Wine you installed. If you installed from source tree, it is the latest release e.g. "Wine release 20001026".

If you do not get the version like
$wine -version
bash: wine: command not found
            
your Wine is not properly installed. Try again to use the command as root. If it works now, you have no permission to execute Wine or Wine is not in your path. Ensure that Wine is in your path and ensure that you can run it if called with path e.g.:
$ /usr/local/bin/wine -version
            
If you even cannot start Wine now, please refer to the section "Troubleshooting".

Do not start Wine on its own to run applications! You will have to give command line parameters to Wine, and every application to run has to be given to Wine at the command line. For additional command line parameters refer to "man wine".

Running Your First Application

We suggest a simple application for the first one to run. Sol.exe is the Windows solitaire game and works well in nearly all Wine versions. Arachnid.exe is a free solitaire game and works with all Wine versions, too.

To run your first application, first check whether you can find the application to run. Example:
$ ls /dos/windows/sol.exe
            

If it is found you may start it with Wine in two ways: called with path or from the directory it resides in without path. If an application needs files in the directory it resides, you have to change to that directory first.

Here are some examples:

Assuming you have Windows 3.1 (or 16 Bit applications):

$ wine -winver win31 -desktop 640x480 /dos/windows/sol.exe
	    
or
$ cd /dos/windows
$ wine -winver win31 -desktop 640x480 sol.exe 
            
or
$ cd /dos/windows 
$ wine -winver win31 sol
	    

Wine will assume, that sol is the same as sol.exe.

If you do not have a Windows drive, you may fetch Arachnid.zip from Homepage The Witch or Mirror of the same site. To install it, create a directory eg

$ sudo mkdir /usr/local/lib/win/arachnid
	    
or
$ mkdir ~/win/arachnid
	    

Unpack the zip file into it and change to that directory before starting "arachnid".

$ cd ~/win/arachnid
$ wine -winver win31 -managed arachnid.exe
	    

Arachnid will run without "-managed" or "-desktop", but the first time you run an application, it would be better to take either of these commands line parameters as you may see what is going on in your xterm if the application crashes.

If that does not work, check that you did not fall into the trap of case sensitivity of Linux, and have a look on the file permissions, accessing the files and the directory. I tested Arachnid with many versions of Wine and it works!

Now that you have, hopefully, successfully tested and run a simple application, you will want to use Wine for something useful. You may already have some Windows software that you want to run. To find out which applications are reported to run with Wine, have a look to the short list further down and check out the Application Database at http://www.winehq.org to find out what applications are working great/failing horribly.

More about starting applications in Chapter 10.

How to Install and Convert Fonts

If you start applications without changing anything in the default configuration, you may find that the fonts are a little crazy. Some are too large, some are too small and so on. You may play a little with the font translations in the wine.conf.

In the Wine distribution there are included two font related files: "fonts" and "ttfserver". You will find them in the source tree under "documentation" or, if you installed precompiled binaries, wherever your packaging system stores documentation (for Debian in /usr/share/doc/wine).

If you have Windows, you may want to make your Windows fonts available under Wine without installing a font server.

I wrote two little scripts (using perl), to translate the fonts as described in the fonts file, included in the Wine distribution. They may help you. WARNING: Do not distribute any copyrighted fonts afterwards to other people. You may get problems with copyright violation.

To use the scripts, save them under their names given in the comment line, execute them first with all the files to convert as command line parameter and have a look at the output. If the output suits your wishes, you may pipe the command into the shell to execute the statements.

The first one is to convert the fon-files from Windows to bdf-files:

The second one is to convert *.bdf-files to *.pcf-files.

The next script converts true type fonts directly to pcf-files.

You have to restart your Xserver to see if the fonts are available now.

If you want to use True Type fonts directly, you have to install a font server like xfs and a True Type font server like xfstt. Bear Giles wrote a mini-HOWTO about installing both on Debian systems. As the HOWTO covers all you need to get the font server working, you may refer to it. It is available at TrueType Fonts in Debian mini-HOWTO.

Language settings

.