Tricks and tricks when using Wine

image

Hello!
I read an article about "All the subtleties of Wine settings" , it turned out that there are far from all the subtleties. Therefore, I wrote this post as an addition to that.

In this post, basically a free translation of. documentation, as well as several of their own and others' tricks when working with vine.
Most likely this post will be interesting to beginners and ordinary users of GNU \ Linux. Nevertheless, sound advice from experts will not be superfluous.

What is vine, I think it makes no sense to explain. I just want to show a few tricks when working with him.

Prefixes

With their help, you can install applications exactly where you want to install them, and not in the default .wine. Even if something goes wrong, it is enough to remove the prefix in which the error occurred, while all other applications / prefixes (suppose that they are configured) will not be affected.

That is, each prefix you created can be considered as a separate wine - it is independent of other prefixes. Or, for even greater simplicity, take each created prefix as a separately installed Windows.

Now a little practice:
Now we will create the Gamez folder, in it we will create the lib prefix in which we will install several libraries. These libraries are still useful later, so let them be cached.

mkdir ./Gamez
env WINEPREFIX=$HOME/Gamez/lib wine winecfg
env WINEPREFIX=$HOME/Gamez/lib winetricks directx9 vcrun2005 vcrun2008 vcrun6
env WINEPREFIX=$HOME/Gamez/lib wine winecfg


With the last command, we again called up the wine configurator window. Just go to the Libraries tab and make sure everything is installed. After that, do:

wine winecfg- the wine configurator opens (not from the prefix), check the same tab. You see! There are no libraries here. So he is safe and sound.

How to install several different versions of wine?

To solve this problem, you will have to collect wine from the source. When assembling, we simply use the prefix for the default installation. Something like here:

./configure prefix=/path/to/install/directory && make
sudo make install


Appdb

Be sure to use appdb to find information on installing the application, maybe the staf that you install has already installed and painted all the pitfalls.

Putting order in the home directory

If you like to play, then your / home section is probably full of saves and other game files. You can get rid of this whole thing, without prejudice:

image

Replace the standard path to my documents with the desired place to store saves. For me, for example, this path leads to the game folder.

Using the latest versions of wine

Wine is such a thing, the newer the better! With the following command, you will always have the latest version of wine (for Ubuntu-like distributions): After executing these commands, look for the latest version of wine in synaptic.

sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update




Install winetricks

If for some reason you still do not have winetricks, then you can get it on the farm like this:

wget winetricks.org/winetricks
sudo cp winetricks /usr/bin
sudo chmod +x /usr/bin/winetricks


How to install msi file?

There are two ways to do this: wine msiexec /i whatever.msi

Alternative way:wine start whatever.msi

The file foo.exe is not marked as executable ... - What does this mean?

This error occurs because there is a ban on execution on the exe file. For a file on your file system, this command should fix the situation:

chmod a+x ./patch/you/exe.file

if the file is on disk, then this command should help:

mount -o remount,mode=0777,exec /media/cdrom

How to output debug contents to a separate file?

cd ~/.wine/drive_c/Games/Tron
wine tron.exe &> log.txt


How to disable "crash" dialog?

If you use prefixes, do not forget to specify the path to the prefix in the command - winetricks nocrashdialog

After starting the application \ game, wine swears and does not start anything. What to do?

First, study the logs, usually everything is written in them. Below I will give the most popular errors:

MFC40.DLL: through winetricks, install mfc40 (Microsoft Foundation Classes from Visual C ++ 4).
MFC42.DLL, MSVCP60.DLL: through winetricks install vcrun6 (MS Visual C ++ 6 sp4 libraries: mfc42, msvcp60, msvcrt).
MFC71.DLL, MSVCP71.DLL: install vcrun2003 through winetricks (MS Visual C ++ 2003 libraries: mfc71, msvcp71, msvcr71).
MFC80.DLL, MSVCP80.DLL: through winetricks install vcrun2005 (MS Visual C ++ 2005 libraries: mfc80, msvcp80, msvcr80).
MFC90.DLL, MSVCP90.DLL: through winetricks install vcrun2008 (MS Visual C ++ 2008 libraries: mfc90, msvcp90, msvcr90).
MDAC: install mdac27 through winetricks (MS MDAC 2.7).

My application works, but text fields behave strangely

Analyze the wine debug after starting the application, if you see what swears on RICHED20.DLL , then install the following library through winetricks: riched20

After launch, fixme messages are displayed in the console. What is it?

You can simply ignore them, this is information for developers.

What if an application needs a .NET framework?

Through winntrix, you can install 1 or 2 framework. As an alternative to using mono. If the application requires 3 or 4 frameworks, then most likely it will not work (although 3 and even 3.5 are available in the winetricks menu). We are waiting for this problem to be resolved.

The game that I am trying to install is protected from distribution. Is it possible to install it?

See the list of copy protection that work.

What if the application requires IE?

Wine uses the default Gecko kernel \ engine - this is the same as on Firefox. Therefore, through winetrikcs, you can install gecko (if it is not) and / or fakeie6.

If this does not help, try changing the windows version to win2k and installing through winetricks ie6, ie7 or ie8.

How to enable font smoothing in wine?

If your version is higher than 1.1.12 you can use winetricks and choose one of three smoothing options: fontsmooth-gray , fontsmooth-rgb or fontsmooth-bgr

After exiting the game, the screen resolution is not restored

Should help: xrandr -s 0

How to get into the wine registry?

wine regedit - If prefixes are used, specify the path in the command.

Does wine need a separate driver installation?

Not. Wine is not a computer emulator, it only translates Windows API calls into Linux-understandable commands.

Is it safe to run wine from root?

Never run wine from the root user !!!

If this has already happened, change the owner of the ~. / Wine directory.

cd ~
sudo chown -R $USER:$USER .wine


Safety Precautions While Using wine

Here are some tips to help you improve your security:

  • Never run programs from suspicious sites
  • Never use the root user to run applications!
  • Use an antivirus scanner for running applications, such as ClamAV. Or at least check executables on virustotal
  • Try removing the Z: drive, which points to the root directory by default. As a workaround, run programs from the ~ / .wine / drive_c directory.
  • Use a virtual machine to run and check suspicious applications.


The .xsession-errors file clogs the entire disk space !!! What to do? (recipe from - = XliN = -)

Save the following script: Add it to startup, and install the following package (it is necessary for the script to work).
% cat .scripts/xsessionerrorscleaner.sh
#! /bin/bash
while true ; do
inotifywait -e modify ~/.xsession-errors &> /dev/null
[[ "$(stat -c %s ~/.xsession-errors)" -ge "52428800" ]] && echo > ~/.xsession-errors
done


apt-get install inotify-tools

Making a sandbox for wine (recipe from drBatty)

* 1) create a user
2) change the rights to home directories to 700
* 3) write the command in sudoers (visudo)
first_user computer_name = (second_user) NOPASSWD: / program_s_full_path
4) at the first user we write the xhost + local command in the autoload DE: second_user
5 ) in the shortcut for starting the program, write
sudo -u second_user / program_with_full_path
then the first user will be able to launch programs more or less safely on behalf of the second user.
an asterisk indicates items for which root rights are needed.

Also popular now: