# The Ubuntu Forum Community > Ubuntu Specialised Support > Wine >  Stuff I've learned about Wine

## cogadh

*The currently updated version of this document is now part of the Ubuntu Gamers Arena and can be found* *here**.*

I will continue to monitor this thread for suggestions, but rather than maintain two copies of the info, I'll only be updating the UGA version (unless someone convinces me otherwise).
 :Smile: 


I've been spending a good chunk of the past few weeks working with the latest Wine and Windows games. I've had some pretty good success so far. Along the way, I picked up a few things that might not be so obvious to a new Wine user, but all Wine users should definitely be aware of. These pointers aren't in any particular order, but I did categorize them a bit. If this is useful to anyone, let me know. I'll try to keep the post updated with any new info as I encounter it.

*General stuff*
*Wine is not an emulator* - In fact, the name "WINE" used to be an acronym: "*W*ine *I*s *N*ot an *E*mulator". An emulator is a software program that creates a virtual environment for software to run in. That environment includes virtual representations of the hardware specifically required by the software and the operating system used to run it. That is not what Wine does. Wine is an alternate implementation of the Windows API. It is a compatibility layer that allows Linux to understand Windows executables and allows the Windows executable to understand  Linux.*Use the latest Wine version...* - but be aware that the latest version sometimes includes bugs that were not part of previous working versions. Ubuntu Feisty includes Wine 0.9.33 in the repositories, while the current Wine version is 0.9.40 (as of this writing). Wine 0.9.33 is pretty stable, but later versions of Wine include significant DirectX improvements. I have several games that won't work with 0.9.33, but work great with 0.9.40. However, somewhere between 0.9.37 and 0.9.40, sound in KotOR 2 broke on my system. That is the perfect example of the risk involved in using the latest version.*Don't compile Wine from source* - Unless you absolutely have to or you are doing it for the challenge. Every time a new version is released, an Ubuntu .deb of that version is also released on Wine's own Ubuntu repository. See WineHQ's announcement page for download details. WineHQ also has a download page for previous versions of Wine, in case you need to downgrade your Wine version.*Use the terminal* - If installed correctly, Wine does associate itself with the .exe file type, so in most cases you can double click on an executable to run it. This, however, is not the recommended way to use Wine. It is better to use Wine from the terminal so that the application paths can be set appropriately (see "Always cd to the game's install path" the the "Regular use stuff" below) otherwise applications will often complain that they can't find needed files. Additionally, running the application from the terminal allows any error messages from Wine to be output to the terminal, which is very useful for troubleshooting purposes.*Be prepared to work for it* - Wine is not perfect. Heck, it's not even complete. Not everything will work correctly at first and you may need to spend some time figuring it out on your own. But you're a Linux user now, you should already be prepared to do that on occasion.

*Stuff in "winecfg"*
*Run "winecfg"* - You have to run "winecfg" at least once to set up the base Wine directories and devices. Wine won't really work until you do that.*Emulate Virtual Desktop* - using this option makes installations run so much smoother. I found instances where attempting to run an installation without this option checked caused some dialog boxes, such as CD key entry or disk swap confirmation, to not come to the front when activated. This led me to believe that the install had become "stuck" and I would end up killing the process. This can also help when troubleshooting a problem game as it won't lock up your desktop or alter your screen resolution to an unusable state when the game fails.*Use the Applications Settings* - The Application Settings dialog on the winecfg Applications tab allows you to create some custom configurations for particular executables. At the moment, those configurations are limited to the OS version, some graphics settings and library settings (i.e. DLL overrides). Using the Application Settings allows you to do things like "override this DLL, but only when using blah.exe". This is very useful when a game requires a particular native DLL, but that DLL override is not required by or is bad for other games. I use this for every DLL override I do, just in case an override is potentially bad for Wine. Rather than screw up Wine as a whole, I just screw up that executable's profile. I can just delete that profile without hurting Wine.*Windows version* - Try different Windows versions for different applications. Just because a game was made for Windows XP doesn't mean that Wine's Windows 98 support won't work better for the game. I once had an old Windows 3.1/Windows 95 game run best if I set the Windows version to Windows NT 4.0. When you find a Windows version that works, make sure you add an application entry in winecfg for the executable.*Use the ALSA driver* -  Some games do require OSS to work, but unless absolutely required, always use ALSA. The OSS driver is no longer being developed and Wine's Alsa support is currently under very active development. Each new release of Wine includes significant sound improvements for ALSA.*Don't allow the window manager to control the windows* - Letting the Window manager control the windows will sometimes cause problems with running games in full screen, among other problems. I have found it best to leave it disabled.
NOTE - Current Wine versions (0.9.39+) have corrected the full screen problems for most games and have introduced a new bug that prevents the keyboard from getting focus in the game when the window manager is not controlling the windows. This can be worked around by running the game in its own X session (see example in the "Regular use stuff" section).*Be careful with library overrides* -  winecfg gives you the ability to override Wine's built-in DLL files with Windows native DLL files. There are some DLLs that should never be overridden: kernel32.dll, gdi32.dll, user32.dll, and ntdll.dll. If you override those DLLs, Wine will not work at all. Some other DLLs, especially the DirectX DLLs, will not work with games, but they don't prevent Wine itself from working. Just be careful if you override a DLL and make sure you never over-write a Wine DLL, just in case you need to go back to it.

*Special configuration stuff*
*Create a symbolic link to CD drive* - Wine creates a symbolic link to the mount directory for your CD drive, but it sometimes helps to also create a symbolic link to the actual /dev entry. I found that if I didn't do this, Wine would create its own symbolic device link and would use it for the E: drive, while my mount directory was linked to the D: drive. I believe this caused issues with some CD-based installs, since two different drives in Wine were now showing identical content. Change the /dev entry on the below code to match your system:


```
$ ln -s /dev/hdc ~/.wine/dosdevices/d\:\:
```

*PERFORMANCE TWEAK* *Useful Registry Keys* - Some features and/or configurations aren't accessible through winecfg, but they can be accessed through Wine's registry. The Wine Wiki maintains a list of those keys and updates it with every new Wine update. Two keys I have found very useful are the Alsa Driver "UseDirectHW" option, which can correct some sound stuttering problems; and the Direct3D "VideoMemorySize" key, which allows you to enter your video card's correct memory amount. Without this key, Wine will automatically report a video memory size of 64MB. Check through the other keys to see what you can use.*WINEPREFIXCREATE* - When you first run "winecfg", it runs WINEPREFIXCREATE to create a default .wine directory, but you can use it to create a separate directory for running custom Wine configurations. I have found this useful for running games that require OSS for sound when I prefer to use ALSA. Having a separate directory for those games allows me to run them without having to run "winecfg" first to change my sound settings.


```
wineprefixcreate --prefix .ossgames
```

When running games that are in this directory, I need to modify the launch parameters with the "env WINEPREFIX=" option:


```
env WINEPREFIX="/home/cogadh/.ossgames" wine "C:\Program Files\Game\Game.exe"
```

This environment option needs to be applied when running anything, including "winecfg", on the custom directory.*Install the Wine Gecko IE engine* - Some programs require Internet Explorer to be installed in order to run. However, installing Internet Explorer can severely break Wine. Instead, you should install the Wine Gecko IE engine. To install the Geko engine, do this:
Run the following in the terminal: 


```
wine iexplore http://www.winehq.org
```

Answer yes to the install promptGo to the Useful Registry Keys page and scroll down to the HKEY_LOCAL_MACHINE section.Add all of the Internet Explorer keys by using regedit.

*ALTERNATE INSTRUCTIONS*
Occasionally, the Gecko engine may fail to download or install properly. If this happens, do the following:
Open a terminal and manually download/extract the Gecko package by running the following:
NOTE - You will need to install the cabextract package from the repositories to do this


```
wget http://downloads.sourceforge.net/wine/wine_gecko-0.1.0.cab && cabextract wine_gecko-0.1.0.cab
```

Next, run the following to create the directories needed for Gecko:


```
mkdir -p ~/.wine/drive_c/windows/gecko/0.1.0/
```

Place the extracted Gecko files into the newly created directory:


```
mv wine_gecko ~/.wine/drive_c/windows/gecko/0.1.0/
```

Run regedit in the terminal. Go to HKEY_Current_User/Software/Wine/MSHTML and create a new key labelled "0.1.0"In the new "0.1.0" key, create a new string value labelled "GeckoPath" and set the string value to "c:\windows\gecko\0.1.0\wine_gecko"Go to the Useful Registry Keys page and scroll down to the HKEY_LOCAL_MACHINE section. Add all of the Internet Explorer keys/strings to the registry.

Gecko should now be installed properly. To test the Gecko installation, run the following in the terminal: 


```
wine iexplore http://www.winehq.org
```



*Install stuff*
*Use Windows ini files for info* - Every install CD has an autorun.ini files and will sometimes have a setup.ini file. Checking these files out can help you troubleshoot an installation problem. Sometimes the setup.ini will give you info on what executables are being launched during the install. Knowing this can help you determine where a problem is actually occurring. For example, when trying to install a Windows 95 game, the install kept nearly completing, but would crash before I got the chance to finish. I checked the setup.ini file and found that the setup finished by calling the DirectX install executable and that executable was actually causing the problem. I created a modified setup.ini and removed the DirectX setup entry and the install completed normally (the game ended up not running though).*Never run an install from the CD directory* - Don't change directories to the CD drive in order to launch a setup executable. Doing so can sometimes prevent your CD drive from properly ejecting when you need to swap install CDs. Instead launch the install by running this from your home directory: 


```
wine /media/cdrom0/setup.exe
```

*"wine eject" is your friend* - If an install needs you to switch CDs and the OS complains that you can't eject the CD, then open a new terminal window and run:


```
wine eject d:
```

This will usually eject the current CD and allow the new CD to be automatically mounted. Sometimes the auto mount doesn't work, but the mount can still be performed manually.*Don't install DirectX* - Wine has its own DirectX libraries, installing Microsoft's DX will screw up those libraries and Wine in general. Just don't do it.*Install the InstallShield bugfix* - There is a bugfix for InstallShield that can correct some CD install problems. Use it, it will help you.*Always use the uninstaller* - Use the terminal command "uninstaller" to launch the Wine uninstaller tool when you want to uninstall games. Don't try using the uninstall shortcuts that a game will sometimes place in the menu during the install. Those shortcuts often don't work right, but the Wine uninstaller tool usually will work.*.MSI files can be installed* - Usually Windows applications use an .exe file to install the application. However, occasionally there are applications that use a Windows Installer File with an .msi extension instead (the current version of Steam, for example). There are two ways you can run this type of file in Wine:


```
wine msiexec /i install.msi
```

OR


```
wine start install.msi
```



*Regular use stuff*
*Use the Wine documentation* - By that I don't mean "RTFM". Wine has pretty good Wiki now. It is a very dry and boring read, but it does have plenty of useful info.*Use Wine's* *Application Database (AppDB)* - Thousands of people are testing Wine on a daily basis and many of us add our experiences to the Wine Application Database in the hopes that it will benefit other users and assist with the further development of Wine. Often AppDB entries will include installation and configuration solutions that other users have come up with. Other times, it may help you identify which games are not worth trying (yet).*Always cd to the game's install path* - If you have ever looked at the shortcut properties in Windows, you've probably noticed there are two path fields. One path is the path to actual executable. The other is a path labeled "Run in...". Most Windows executables want to "Run in" the directory they were installed in, changing directories to the executable's install path accomplishes that.*PERFORMANCE TWEAK* *Turn off WINEDEBUG* - When run normally, Wine is constantly producing debug messages (all those "fixme" things). Most of that info is not really needed if you already have a functional game. So to free up those resources, launch the game using the "WINEDEBUG=-all" option. No messages will be generated at all. If you are troubleshooting a game, use the "WINEDEBUG=fixme-all" to remove only the "fixme" messages, which are just developer messages and mean nothing to the normal user.*Get used to cracks* - Without completely functional copy protection support, sometimes the only way to get a game to work in Wine is to use a cracked executable. Either get over any apprehension you may have about using cracks, or dual boot Windows and use it for the games that won't work without a crack. Someday we will hopefully have functional copy protection support in Wine and cracks will no longer be an issue.*NEVER run Wine as root or with sudo* - Wine is still beta software. Allowing it unrestricted access to the system through the use of a root account or the sudo command can and will cause problems. Just don't do it.*Other Wine commands* - Wine has a few commands other than "wine", "winecfg", "wineprefixcreate" and "uninstaller". These commands can prove very useful:
_wineboot_ - Simulates a Windows reboot, useful for when an install requires a reboot before it can be used._wine control_ - Launches the Control Panel. If you install any Windows applications that make use of a Control Panel shortcut, then this is how you access it_wineserver_ - wineserver is automatically launched by the wine command, but it can also be run from a terminal with different switches to different effect:
-d# - Sets the debug level in the terminal output. You might find a use for that, I never have-h - Display the wineserver help file-k - Kill the current wineserver. Useful if an application has locked up and you need to break out of it.-p - Makes the wineserver persistent, meaning it will continue to run even after the application has closed. Useful if you intend to run several consecutive wine apps, as it can decrease wine load time-w - Makes wineserver wait until the currently active wineserver exits. Again, you might find a use for that, I never have.*PERFORMANCE TWEAK* *Wine doesn't always like to play nice* - If you are experiencing slow or choppy performance in a game, it can sometimes be fixed by giving the process a higher scheduling priority. This is done by using the "renice" command after launching a Wine game. The "renice" command allows you to change the priority of a currently running process, i.e. how "nice" a process is to other users on the system (higher priority = less nice, lower priority = more nice). The command has a range of -20 (highest priority) to 19 (lowest priority) and the default priority is 0. In order to use renice, you will need to open a separate terminal and run a command like this, after you have already launched your game/application:


```
sudo renice -10 -n game.exe
```

I don't recommend jumping right to using -20 to run Wine games, start with -10 and if it doesn't improve performance enough, try working up in small increments. You will likely find that most games don't require more than -10 to get the best performance. Also, it goes without saying (I think), that you must be able to ALT-TAB out of the game to run the renice command.

*ALTERNATE INSTRUCTIONS*
For those of you that prefer the GUI method, you can do this instead to renice an app:
Launch the game from a terminal, then ALT-TAB to get back to the desktopLaunch System Monitor (System > Administration > System Monitor) and switch to the Processes tabRight-click on the running executable and select "Change Priority..."Move the slider to your desired prority and click "Change Priority"Enter your user password when promptedClose System Monitor and ALT-TAB back into the game

*Third party stuff*
*Wine-Doors* - Wine-Doors is a graphical application that assists with the installation of many Windows applications, including games. It is currently in alpha development, but does have an initial release available for download. The application itself does look very promising.
NOTE - Since Wine-Doors is alpha software, it should go without saying, use at your own risk.*Cedega* - Cedega is technically a fork of Wine, with a specific focus on gaming. Cedega does include a GUI for running installations and launching games, plus it includes some support for copy protection software (you might not need to use a crack with Cedega). Cedega is not free, however. It has a $5 US monthly fee with a three month minimum. A small discount is offered for purchasing a full year in advance.
NOTE - Cedega was originally called WineX and branched off of the Wine tree when Wine was still under the old MIT license and not the LGPL. Because of this, Cedega does not contribute back to the Wine source tree, as it would if it was covered by the LGPL. It also does not benefit from future updates to Wine. This combined with less than spectacular support leads many people away from Cedega as a Linux gaming solution.*CrossOver* - Technically, CrossOver is not a third party product, as it is the primary financial backer for Wine. CrossOver originally started as a means of running Microsoft Office applications in Linux, but has recently begun adding support for games. CrossOver is based on older, more stable versions of Wine, but as Wine improves and updates, so does CrossOver. It costs $39.95 US to purchase the standard edition.*ReactOS* - Also a Wine backer like CrossOver, ReactOS is an attempt to create a fully Windows compatible operating system based on much of the work already done in Wine. The ReactOS system, when complete, will be able to use the same drivers and applications that Windows uses, completely natively. The project is currently in alpha stages of development, but there are install CDs, live CDs, QEMU and VMware virtual machine images available for download.
NOTE - Again, since ReactOS is alpha software, it goes without saying, use at your own risk

*Advanced stuff*
*PERFORMANCE TWEAK* *Use launch scripts* - Wine games will often perform their best when they are launched in a separate X server. Wine doesn't require a window manager (Gnome or KDE) to run properly, so if you launch a game in a separate X server, you can get a significant performance boost. You can get an even bigger boost by stopping the GDM/KDM before you launch the game (only to be done from the console).
First you need to create the script. From the terminal, do the following:


```
nano launcher.sh
```

Copy the text below and paste it into the terminal with either the middle mouse button or by clicking on Edit->Paste. Take out the nVidia settings portion if you don't have an nVidia card and modify the application paths to match your game.


```
#!/bin/sh
#uncomment if launching from console session
#sudo /etc/init.d/gdm stop
#KDE use this instead
#sudo /etc/init.d/kdm stop

# Launches a new X session on display 3. If you don't have an Nvidia card
# take out the "& nvidia-settings --load-config-only" part
X :3 -ac & nvidia-settings --load-config-only

# Goto game dir (modify as needed)
cd "$HOME/.wine/drive_c/Program Files/Game/Directory/"

# Forces the system to have a break for 2 seconds, X doesn't launch instantly 
sleep 2

# Launches game (modify as needed)
DISPLAY=:3 WINEDEBUG=-all wine "C:/Program Files/Game/Directory/game.exe"
```

Save the file in your home directory by pressing CTRL-O, hit enter then CTRL-X to exit.Next, make your script executable with this command:


```
chmod +x ~/launcher.sh
```

Launch the game by doing this from a terminal:


```
sh launcher.sh
```

OR


```
./ launcher.sh
```

When you are done playing, do a CTRL-ALT-BACKSPACE to get back to the desktop.

*ALTERNATE INSTRUCTIONS*
If your game doesn't work, or if you want to try and squeeze some additional performance out of the game, follows these additional steps to try running it without your default X session still running:
Uncomment the "sudo /etc/init.d/gdm stop" line (remove the "#") in the script and save it. If you use KDE, uncomment the "sudo /etc/init.d/kdm stop" and save the script.Close all open applications and switch to the console by pressing CTRL-ALT-F1.Log into the console and run the script:


```
sh launcher.sh
```

OR


```
./ launcher.sh
```

You will be prompted for your password and your game will launch in its own X session, without the Gnome or KDE window manager getting in the way.If the script complains that you don't have permission to start the X session do this:


```
nano launcher.sh
```

Then modify the X server launch line of the script to read:


```
sudo X :3 -ac & nvidia-settings --load-config-only
```

NOTE - You can avoid having to modify the script by editing the Xwrapper.config file to allow normal users X access. Open the /etc/X11/Xwrapper.config file in a text editor using sudo, then change the "allowed_users=console" entry to "allowed_users=anybody".Once you are finished playing, either reboot or do a CTRL-ALT-BACKSPACE to get back to the console and restart your X server and desktop by doing this:


```
sudo /etc/init.d/gdm start
```

If you use KDE, do this instead:


```
sudo /etc/init.d/kdm start
```

The desktop should come right back up immediately, if it doesn't just type "startx".
NOTES
If you launch a game in it's own X session, make sure that Wine's virtual desktop has been disabled.Running a game in its own X server will often correct the problem with a non-functional keyboard in Wine games.There are additional command line switches that could be applied when launching the new X session see the Xserver manual and Xorg manual for details.

----------


## Doctoxic

thanks for this - some very useful info

cheers

doc

----------


## hikaricore

Stickied.  ^_^

Attention folks, keep replies on topic or they will be hidden.
I don't want to have to lock cogadh's thread as this makes it a pain to update.

Example (This post has no place here):




> all that has never work for me...

----------


## merlyn

> Stickied.  ^_^


^ Legendary move.

----------


## jcankrom

hey, this is great. this is much more helpful than the wine wiki, IMO.

could you add some tips on what to do if your game runs too slow?
i'm running Starcraft, in case you're wondering, and have seen all kinds of tips from "wine starcraft.exe -gl" to "wine nice -n 20 starcraft.exe" or editing the registry to use opengl instead of direct 3d or using winecfg to emulate hardware acceleration for audio and using winecfg to run it in a virtual desktop. i haven't got a clue what these things do, so i'll just try them all to find out which one works for me. some explanation of the options would be really helpful.
Thanks!

----------


## cogadh

Those kinds of tweaks are specific to Starcraft only and would not be useful for other games. They are beyond the intended scope of this doc. I wanted this to be a general Wine usage doc, which is why I put the "Use Wine's Application Database (AppDB)" statement in it. The info on AppDB covers most of the game-specific stuff you would need. 

However, I am not opposed to adding a game-specific section, if there is a demand for it. My only concern is that I would just be duplicating information that is already presented in a better fashion somewhere else. Perhaps adding links to good Wine How-Tos instead? Of course, AI has already done that with his "Looking for a game howto?" sticky post.

As for performance tweaks, I did post a few mixed in there, such as turning off debug channels, running in a seperate X server, the useful registry keys. I have flagged those now and as I encounter more, I will add them. If you have any suggestions that aren't game-specific, I'd be happy to add them.

----------


## hikaricore

If you havn't already (didn't have a chance to recheck) you may want to add a note about the info you discovered here for launching new X sessions without root to the part about launcher scripts.  ^_^

----------


## cogadh

Good call, just added it to the NOTES under the script section.

----------


## Cappy

I have to use wineprefixcreate to make Ventrilo work properly for me.

----------


## dorath

I'd love to get some of those launch scripts working, but I can never remember the command to make a script executable.   :Sad:   Any chance you could add a couple extra steps along the lines of:
-This KotOR launch script is saved as wine.kotor (or whatever)
-[command that makes wine.kotor (or whatever) executable]

I'm sure that I'm not the only one who'd appriciate it!  :Smile: 

Great work , cogadh  :Smile:

----------


## mongoose_za

wow nice post. Bookmarked for sure. Followed pretty much everything that i can understand and got my warcraft running. it's just that it runs so slow still  :Sad:  like 6fps.

----------


## akurashy

alright I got to be sure I'm doing this right

http://img112.imageshack.us/img112/1950/usermt4.png

Is it creating the folder or adding the strings ?

I'm doing the regedit since I found it interesting... need to be sure I'm implementing it right

----------


## negerbarn

Thansk  :Very Happy:

----------


## sonofabics

wow thanks for this. It is really great!!!
 :Guitar:

----------


## SoliDphantoM

nI was trying launch a new x session with the script and the session was working, but the game was not launching....

I found in another thread why.

Since I didn't see this when I skimmed the thread and it wasn't revised in the OP, I thought I'd share this:



```
# Launches a new X session on display 3. If you don't have an Nvidia card
# take out the "& nvidia-settings --load-config-only" part
X :3 -ac & nvidia-settings --load-config-only
```

If you don't have a Nvidia card do NOT take out the "&", if you do the game does not launch in the new session.
So the edited script without the Nvidia settings should look like this:



```
X :3 -ac &
```

----------


## eggbloke

thanks!
steam is now working!
although a lot of the words are missing so i have to guess what to press :S

----------


## vexorian

> sudo renice -10 -n game.exe


Did you know this doesn't work?

renice needs a pid.

I am currently looking for a way to use pgrep so this works.

Edit:



```
sudo renice -10 $(pgrep game.exe)
```

Edit: And now that I use the correct renice syntax, GTA:SA's performance has been improved significantly.

----------


## KBA3AP

"Wine supports using native DLLs when the built-in versions don't function properly. In many cases, it's possible to use native DLL versions to gain access to 100% of the functions an application requires." (taken from here http://wiki.winehq.org/Debunking_Wine_Myths)
I assume this means one could simply copy-paste all DLLs(except wine-critical ones like DirectX) from the owned Wndows version, where the software works 100% and that would ensure on-wine functionality(that is, excluding programs that use wine-critical DLLs). And, while this is unusable for wine development, it could be used to fix programs, that don't work with simple tweaks.
I.e. say i need to be able to run 10-15 windows-specific programs, and am not willing to tweak wine for each of those, but have access to DLLs of the windows version where they do work.

----------


## cogadh

You can actually override any Wine DLL _except_ kernel32.dll, gdi32.dll, user32.dll, and ntdll.dll (you can override the DirectX DLLs if you want, but in many cases, the Wine versions are going to work better anyway). If you were to override any of those 4 DLLs, Wine would no longer work.

The process is not as simple as just copy/past the Windows DLLs, you also have to run winecfg and apply a library override for each DLL you copy/paste. No matter what, you will have to do some tweaking.

You should only apply a DLL override if the application you are trying to run returns a specific error related to a specific DLL. You can then try to override that particular DLL to see if that corrects the issue. You will probably find that using the new DLL will eliminate the original error, but you will then get different errors that may require additional DLL overrides to fix. 

Automatically overriding all Wine DLLs with Windows native DLLs is a really bad idea. There is absolutely no guarantee that using a Windows native DLL will make any difference whatsoever in how your program runs. Sometimes, the Windows native DLLs are actually worse than the Wine ones and you will end up with a Wine installation that is incapable of running anything.

----------


## KBA3AP

Well, applying a specific DLL override would require knowing what exactly you need, and if it's not the case(i.e. program crashes/doesn't start for no apparent reason), you cannot do it.

Hm, I'm probably missing something, since wine is not an emulator, all it does is provide windows-specific resourses to the windows-specific software and visa verse, am I right? So, in case of a wrong/old DLL, resources required <>  provided, which = program failure, and in case of a right DLL, resources required == provided, which = program successful functionality.
Obviously it isn't always about the DLLs but I'd say most of the time for the older programs.

----------


## vexorian

WINE is most likely to provide all the windows' dll functionality, but a couple of functions that are instead replace with stubs.

If your program requires a non-windows third party dll, you can just place the dll in the same folder you got the .exe in (just like in windows)

----------


## cogadh

> Well, applying a specific DLL override would require knowing what exactly you need, and if it's not the case(i.e. program crashes/doesn't start for no apparent reason), you cannot do it.
> 
> Hm, I'm probably missing something, since wine is not an emulator, all it does is provide windows-specific resourses to the windows-specific software and visa verse, am I right? So, in case of a wrong/old DLL, resources required <>  provided, which = program failure, and in case of a right DLL, resources required == provided, which = program successful functionality.
> Obviously it isn't always about the DLLs but I'd say most of the time for the older programs.


It is actually relatively easy to figure out what DLLs you might need to override. If the application itself doesn't give you an error saying something like "foo.dll caused an error", then the terminal messages that Wine produces will tell you exactly what went wrong. Of course, that assumes that you are using Wine from the terminal (which you should).

If the DLL you are having a problem with is not a MS DLL, then like vexorian said, you can usually just drop it into the install directory (or system32) and it will work fine. You shouldn't even need to apply an override in winecfg for most third-party DLLs. You usually don't have to worry too much about third party DLLs, since any app that requires them will usually install them as required already.

----------


## dabski

I was stuffing around today and found out about the -terminate switch. I haven't seen anyone else do this so I thought I'd be the first to share it with the community  :Smile: 
If you changing this line:


```
sudo X :3 -ac & nvidia-settings --load-config-only
```

to


```
sudo X :3 -ac -terminate & nvidia-settings --load-config-only
```

then you don't need to do CTRL+ALT+BACKSPACE after exiting your game. Works really well on XFCE with no login manager since I'm automatically dumped back into my original X session.

----------


## cogadh

Ha, learn something new every day!

Thanks! I'll mess around with it some in KDE and Gnome then add it to the doc (as long as it doesn't have any problems).

----------


## gsmanners

How to run Wine without the network:

- add user "highwire" (because this user works without a net):



```
sudo adduser highwire
```

- give password, other info then set up iptables:



```
sudo iptables -I OUTPUT -m owner --uid-owner highwire -j REJECT --reject-with icmp-net-unreachable
```

- log out, log back in as "highwire"
- load up Firefox (or some other web browser) and make sure that the net is unreachable
- open a terminal and type:



```
winecfg
```

- now you should be ready to use Wine without having to worry about network interference

(The line for iptables was taken from this entry in Wine-Wiki.)

----------


## cogadh

Just curious, but is there any reason to run Wine without the network?

----------


## gsmanners

I worry more about security issues with Windows programs since I don't do a good job of keeping them up to date, so this is to assure myself that I'm not making my computer more vulnerable somehow.

----------


## cogadh

That's reasonable, but as long as you aren't running Wine with root permissions (which you shouldn't do anyway), malicious Windows programs can't really do much more than possibly damage your .wine directory. That is easily fixed by just creating a new one.

----------


## victor.zamanian

This was worth its weight in gold for me. (I had troubles getting gecko installing on Ubuntu 8.04, for wine.) Thanks a lot!

----------


## Joshgo

I'm stuck here, I don't know how to do the following:

NOTE - You can avoid having to modify the script by editing the Xwrapper.config file to allow normal users X access. Open the /etc/X11/Xwrapper.config file in a text editor using sudo, then change the "allowed_users=console" entry to "allowed_users=anybody".

How do I open it using sudo? What is the command? Help is greatly appreciated.

----------


## cogadh

```
sudo nano /etc/X11/Xwrapper.config
```

Or if you prefer a graphical text edotr:


```
gksudo gedit /etc/X11/Xwrapper.config
```

----------


## OmniCloud

> That's reasonable, but as long as you aren't running Wine with root permissions (which you shouldn't do anyway), malicious Windows programs can't really do much more than possibly damage your .wine directory. That is easily fixed by just creating a new one.


Good post...

I just erased my drive completely with all the partitions I had on it and now just run Xubuntu completely. 

I'm having a bit of trouble getting my watchtower application to work under Wine though. TBH--after installation, a double-click of the desktop Icon ran the program automatically so I never really played around with Wine in the terminal too much. Since that's the only Windows app I need to run. A few questions for you my fried.

My wine application ran automatically after installation on my Gnome Hardy setup, but I can't get a response in Xfce? Same version of wine, same OS, is this a desktop difference issue here?

Second question, when I click the desktop icon, there isn't an error message, it's just no response. Same with going into my /.wine folder and trying to run the .exe or any other command. In fact, the only thing I get a response from is to installing or removing the application? 

Third, how do you actually run wine in the terminal? copy and paste the command from the desktop icon file?

----------


## cogadh

I'm really not familiar with XFCE, I've only really used Gnome and KDE regularly. I supposed XFCE could make a difference, but I can't really say how exactly.

You often won't get error messages from application run with Wine, they usually tend to fail silently, unless...

...you run the app from the terminal, where Wine can output its own error messages. To run an application in Wine from the terminal, simly open the terminal, change directories to where the app is installed, then "wine" the executable:


```
cd ~/.wine/drive_c/Program\ Files/<install directory>
wine <executable name>.exe
```

----------


## OmniCloud

> I'm really not familiar with XFCE, I've only really used Gnome and KDE regularly. I supposed XFCE could make a difference, but I can't really say how exactly.
> 
> You often won't get error messages from application run with Wine, they usually tend to fail silently, unless...
> 
> ...you run the app from the terminal, where Wine can output its own error messages. To run an application in Wine from the terminal, simly open the terminal, change directories to where the app is installed, then "wine" the executable:
> 
> 
> ```
> cd ~/.wine/drive_c/Program\ Files/<install directory>
> ...


cool cool...I was reading some info on the data base and a user said I can't run Watchtower without MS core fonts installed. 

So after getting that i'll try it in the terminal. Tks for the reply!

Btw--I used to play a lot of Starcraft when I was little, I think I downloaded from Kazaa or something back in the 90's? You know where I could find an old game like that--frostwire maybe? Game was crazy fun--and I don't really like the new online-only Strategy games that's coming out now...

----------


## cogadh

Discussion of pirated software is frowned upon in these forums. If you want to play Starcraft, just buy it, it's still available as part of the "Starcraft Battle Chest" with all expansion packs in most stores. Last time I saw it, it was only about $20.

----------


## OmniCloud

> Discussion of pirated software is frowned upon in these forums. If you want to play Starcraft, just buy it, it's still available as part of the "Starcraft Battle Chest" with all expansion packs in most stores. Last time I saw it, it was only about $20.


I feel you..I'll probably just partition XP back on my system as well...

don't feel like going through the hassle of all the configuration just to play an old game. 

Then again, it might be years before I ever get around to having time to play PC games again. I'm happy with my Playstation/Wii for now lol...

----------


## OmniCloud

> I'm really not familiar with XFCE, I've only really used Gnome and KDE regularly. I supposed XFCE could make a difference, but I can't really say how exactly.
> 
> You often won't get error messages from application run with Wine, they usually tend to fail silently, unless...
> 
> ...you run the app from the terminal, where Wine can output its own error messages. To run an application in Wine from the terminal, simly open the terminal, change directories to where the app is installed, then "wine" the executable:
> 
> 
> ```
> cd ~/.wine/drive_c/Program\ Files/<install directory>
> ...


ok, here's a screenshot to help a bit...

1) I can't cd to Program files in a terminal which is where Watchtower app is installed. 



2) When trying to browse the Wine c:: drive I get an error--which maybe the cause of all this nonsense--it says "c: drive is not supported"

3) Should I try to install it to a different directory when doing the installation?

----------


## cogadh

Did you use "sudo" to run Wine at all?

BTW - Where's the screenshot?

----------


## OmniCloud

> Did you use "sudo" to run Wine at all?
> 
> BTW - Where's the screenshot?


trying now...reload its up I don't really know what I need to sudo...

I'm just trying to cd into the place where the app is and can't reach it...

----------


## OmniCloud

btw I"m using the latest version of Wine...don't have any other apps installed besides Watchtower 07. Run a Dell Pen4 with Intel card with about a gig of memory...

Xfce manager Xubntu hardy :Wink:

----------


## cogadh

That was a question, not a suggestion. You should never use sudo to run Wine, it screws up the permissions on the .wine directory and allows Windows applications, including malware, full access to the Linux system. I was only asking because it might explain why you are having problems accessing the .wine directory. If you have gone and used sudo, you now need to delete the .wine directory and start fresh with a new one:


```
sudo rm -r ~/.wine
winecfg
```

----------


## logos34

Every time I try to launch Exact Audio Copy I get this message:




> Unhandled exception
> 
> at WndProcs.741 ->INDEX-RANGE


EAC never even appears.  How can I get rid of it/fix it?

EAC on wine has worked perfectly until now (Hardy).

----------


## cogadh

Okay, I am already breaking my own rules about this thread. I never meant for it to be used for supporting individual problems, just suggestions for future additions to the original topic. I think we should take any future issues into their own threads for now.

logos34, unfortunately, I had already looked at your original post with this problem, and I have absolutely no idea why you are getting that error. It might help if you were to run the application from the terminal and post any output from Wine itself on the issue (in your original thread, of course).

----------


## logos34

Thanks for the reply.  Normally I wouldn't ask, but I'm kind of desperate.

I ran

winedebug .wine/drive_c/Program\ Files/Exact\ Audio\ Copy/EAC.exe 

but no output exept for same error popup.

I've tried just about everything I can think of.  Actually, I don't think Wine is at fault here, I just wanted to know if there was a way to clear the error message in the hopes that would unblock EAC and allow it to launch.

Is, there a winedebug (verbose) command?

thanks

----------


## cogadh

Don't bother with the debug channels, start with just running the app normally in Wine through the terminal. If that doesn't produce any informative errors (it will definitely give you something), _then_ use the debug channels. Information on how to use the debug channels can be found here:
http://wiki.winehq.org/DebugChannels

----------


## logos34

ok, I'll check it out

----------


## RealG187

> _Get used to cracks_ - Without completely functional copy protection support, sometimes the only way to get a game to work in Wine is to use a cracked executable. Either get over any apprehension you may have about using cracks, or dual boot Windows and use it for the games that won't work without a crack. Someday we will hopefully have functional copy protection support in Wine and cracks will no longer be an issue.


I never thought I would hear something like that here! Can you say that?

About the copy protection support, I oppose DRM entirely, compatibility being one, another being violating user's rights.

Ubisoft stole a scene crack and used it as a fix for one of their games. That's how good they are!

----------


## Aravindvs

Thanks Man! Your Are Awesome!

----------


## kidux

> nI was trying launch a new x session with the script and the session was working, but the game was not launching....
> 
> I found in another thread why.
> 
> Since I didn't see this when I skimmed the thread and it wasn't revised in the OP, I thought I'd share this:
> 
> 
> 
> ```
> ...


Thanks for this man, it works great now!!!

----------


## riggity_ryan

> ```
> #!/bin/sh
> #uncomment if launching from console session
> #sudo /etc/init.d/gdm stop
> #KDE use this instead
> #sudo /etc/init.d/kdm stop
> 
> # Launches a new X session on display 3. If you don't have an Nvidia card
> # take out the "& nvidia-settings --load-config-only" part
> ...


Thanks, this script is really handy.

I was wondering if anyone knew if it's possible to also specify the resolution of the new X screen.  This would be useful for older application that are meant to run full screen but are on a fixed resolution (like 640x480).  I didn't have much luck searching any forums or google on this topic.  If it's possible it would make a good addition to this documentation.

----------


## riggity_ryan

Well, I finally found a way to adjust the resolution of a second X window (sort of, it's really zooming).  Thanks to sdimhoff off of this forum: http://www.linuxforums.org/forum/win...tml#post554231

You can use [crtl] + [alt] [+/-] to zoom an X screen (needs to be the number pad + and -).

The nice thing is it doesn't effect any other screens, so you can have your wine application zoomed in on screen 3 and your regular X screen normal on screen 0.

The down side is that because it's a zoom you will scroll around on the screen if you move to the edges.

Don't know if you think it's worth adding to your document, but I'm finding it pretty useful for some of my wine applications.

----------


## dfreer

> Well, I finally found a way to adjust the resolution of a second X window (sort of, it's really zooming).  Thanks to sdimhoff off of this forum: http://www.linuxforums.org/forum/win...tml#post554231
> 
> You can use [crtl] + [alt] [+/-] to zoom an X screen (needs to be the number pad + and -).


I'm pretty positive that's actually changing the resolution of the X screen, it's been in X for quite some time (I think I remember flipping between resolutions in SuSE 7.0).

EDIT: Also, I do believe you can run nvidia-settings specifying a certain resolution, and then save the configuration file and load that in your script.

----------


## Eisenwinter

Thanks to the OP for sharing this valuable information, I have learned a lot.

----------


## simam

Stuff I've learned about Wine
If you're like me, you were probably frustrated by the state of Wine documentation when you first tried to use Wine. Sure, there are plenty of How-to documents out there that explain how to use it for a particular application or game, but I couldn't find any comprehensive beginner's guide to Wine that could give me the basic knowledge needed to begin really working with and understanding Wine. I didn't want a document that showed me how to make Half-Life 2 work, I wanted something that actually showed me how to use Wine. To that end, I began collecting all of the stuff I gathered from numerous Wikis, guides, forum posts and how-tos into a single general document. While this document does have a strong focus on running games in Wine, nearly all of the info included can be applied to running any application with Wine. Enjoy, its good stuff!  :Cool: 
-Cogadh

    *
      General stuff
    *
      Stuff in "winecfg"
    *
      Special configuration stuff
    *
      Install stuff
    *
      Regular use stuff
    *
      Third party stuff
    *
      Advanced stuff

----------


## Garratt

> ALTERNATE INSTRUCTIONS
> Occasionally, the Gecko engine may fail to download or install properly. If this happens, do the following:
> 
>    1. Open a terminal and manually download/extract the Gecko package by running the following:
>       NOTE - You will need to install the cabextract package from the repositories to do this
>       Code:
> 
>       wget http://downloads.sourceforge.net/win...ecko-0.1.0.cab && cabextract wine_gecko-0.1.0.cab
> 
> ...


if people have to be told how to mkdir etc, then they usually need to be told how to do step 4, 5, 6....

or linked to a tutorial that explains. 

cause personally i understand what you mean by those steps... but i got NFI how to do them.

g.

----------


## thinhhoangdinh95

Wow, that was great. But if Wine can run programs which was written in .NET and can play media files (such as AVI) without any supports from another programs (Just like Windows), everyone will use Ubuntu!  :LOL:

----------


## RealG187

> if people have to be told how to mkdir etc, then they usually need to be told how to do step 4, 5, 6....
> 
> or linked to a tutorial that explains. 
> 
> cause personally i understand what you mean by those steps... but i got NFI how to do them.
> 
> g.


I could Upload the Gecko files in a tar.gz, zip, rar or whatever format if anyone wants...

----------


## YokoZar

I am unsticking this thread as it has a lot of old cruft that is scaring new users.  For example, double clicking should work for just about everything these days, so terminal use is a bad thing to recommend to first-time users.

I'm completely open to posting an updated small version though, or merging it into one of the other threads.

----------


## Thelasko

> I am unsticking this thread as it has a lot of old cruft that is scaring new users.  For example, double clicking should work for just about everything these days, so terminal use is a bad thing to recommend to first-time users.
> 
> I'm completely open to posting an updated small version though, or merging it into one of the other threads.


Aww, I reference this thread all of the time.  Now it's going to be harder to find.

----------


## cogadh

Actually, I completely agree with YokoZar's decision to unsticky this. This was originally written well before the Wine 1.0 release and while much of the info included can still apply to Wine usage in rare cases, most of it is no longer necessary. I also have not had the time or inclination to keep the document up-to-date for a while now (I haven't actually been using Wine or Ubuntu for some time), so it will likely just get more and more irrelevant as time goes by.

----------


## aftertaf

Hi.
First: you've just been bookmarked.... far too useful for it's own good  :Smile:  thanks!!!
 :Popcorn: 
2nd: Concerning Wine, do you have any 'business' experience ?
I'm looking to migrate work PCs from XP to Kubuntu, and we use database stuff and homemade Borland C++ exes...
Before we can begin porting to linux, I want to show them that it's viable as a system, and without dev costs make things run with Wine;
I'm currently stuck with the ODBC. I can't conenct a wine-run app to a SQL server via the ODBC I configured with odbcad32.exe
I wondered if you have any tips or experience on this, or maybe a way to override the odbc to use the linux implementation unixodbc directly.??

Also, is there a way to capture or debug why a certain program is crashing at a certain point? 

Thanks again and serious bravo. If I finf in the meantime any things useful in my tests, i'll let you know, for the record  :Smile: 
David

----------


## Thelasko

> ...we use database stuff and homemade Borland C++ exes...


If you have the source code for the homemade stuff, you should theoretically be able to port it to Linux by compiling it with Winelib.

You should also start a new thread on this topic.

----------


## made_of_spoons

I'm trying to run a game by BigFish Games and almost everything seems to be working BUT the graphics. When I enter the game, audio is ok but I can see nothing but white squares floating. Even the pointer is a little white square. ._. What do I do? Is there something I can do in the Wine Configuration? I have wine1.2.

----------


## lisati

Thread closed so that it may rest in pieces.

----------

