Filling with Wine. Installing Wine, winetricks, DirectX and programs needed for games Filling with wine

The previous manual is outdated and does not cover many features of wine. Here I will describe initial setup wine, so that everyone can understand it. It needs libraries to work correctly, winetricks will help us with this. But first, let's install the latest version of wine:

sudo apt-get install wine

There is also a repository with more frequent updates, but often unstable:

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

Winetricks

Winetricks– a script that allows several simple actions install additional Windows components in Wine.

The version of Winetricks installed from the repositories is often outdated. To update do:

wget http:// www.kegel.com/ wine/ winetricks && chmod a+rwx winetricks && sudo mv winetricks / usr/ local/ bin

If Winetricks gives a hash sum error, try running this command again, or run the program manually using wine ~/.wine/.chache/winetricks/program_folder/program

You can use Winetricks both in GUI mode and in console mode. For the GUI, press Alt + F2 and enter winetricks. For console mode, use winetricks program_name, for example:

Winetricks directx9 dotnet11

But don't rush with the setup! To do this, you need to create a prefix. Prefix – directory containing emulation of the C: drive with all windows programs and libraries. Theoretically, you can install programs even in /mnt, but in practice this most often leads to failures. If you have a 32-bit system, just enter winecfg. If you have a 64-bit system, I strongly recommend creating a 32-bit prefix, to do this, enter:

WINEARCH =win32 WINEPREFIX =~/ .wine winecfg

For example, . NET Framework intended (in winetricks) only for 32-bit systems.

If, when running winecfg, you see a window asking you to install mono and gekko, agree and wait. Dig into the Wine settings and start filling it out.

Filling with wine

On the Internet you will find many guides on populating wine with programs; each of them may require combinations of libraries that are incompatible with the other. But you can create different prefixes for different programs, for this:

WINEARCH =win32 WINEPREFIX =~/ prefix_name winecfg

Launching the program: WINEPREFIX=~/prefix_name C:/path/to/program

In the example above, C:/ is considered to be the root of the folder, i.e. wine C:/notepad.exe is equivalent to ~/.wine/notepad.exe

After you have installed the latest version of the environment for Windows startup WINE programs (it’s written about how to do this) it also needs to be tweaked a little so that programs and games run normally. Sometimes you have to make your own settings for each program, but there are also actions common to all programs. However, the initial setup of WINE is not at all difficult.

Using Winetricks.

Winetricks is a script created so that you can quickly download and install various libraries necessary for running some Windows programs in the wine environment.

Installing it is simple. Launch a terminal emulator and create a folder in your home directory, for example winetricks:

Mkdir wine tricks

then go to this folder and download the winetricks script from the Internet:

Cd winetricks wget http://winetricks.org/winetricks

After the script has been downloaded, make it executable:

Chmod a+rwx winetricks

And finally we launch winetricks:

The points:

  • Install an App - installation different windows applications.
  • Install a benchmark - installation to select several popular programs to evaluate performance.
  • Install a game - allows you to download and install demo versions of some games.
  • Select the Default prefix - allows you to install various libraries and fonts.
  • Enable Silent Install - enables/disables “silent” installation. In mode quiet installation Installation windows are not displayed.
  • Show brolen Apps - turns on/off the display of “bad” applications (DRM-protected, etc.)

Installing fonts and DLLs in Wine

The first step is to install standard fonts necessary for most Windows programs and games. To do this, select the item Select Default prefix

When you first launch this menu item, you will be asked about your consent to the collection of debugging information in order to improve the program:


You can safely answer no if you do not want to help develop the winetricks program.



Without further ado, select the first item allfonts - this will install all available fonts, but you will need to download 132 megabytes of data from the Internet. Therefore, please be patient and have unlimited internet.


If you have not enabled Silent Install, the download and installation process will be displayed in the window:


Installation of libraries occurs in a similar way. Only in the previous step you need to select Install a Windows DLL o component.

Then mark the necessary components and click OK, as in the case of fonts.


For example, this way you can install the “native” dircetx from Microsoft in the Wine environment, which is necessary for many games. You can also find other libraries needed for games and applications here. The need is determined in each individual case.

Setting up sound in Wine

For most games and better performance I switch the sound to use ALSA. This is done in the Wine settings (Applications\Wine\Wine Settings or run winecfg in the terminal). On the Audio tab, check the ALSA checkbox.

In addition, I observed significant problems with sound in applications running under wine with the PulseAudio sound server installed. By default, Ubuntu plays sound using it, so I remove it.

UPD 2016. In the latest distributions, the need to remove Pulseaudio has practically disappeared. All programs and games work correctly.

This completes the initial setup of WINE in Ubuntu. This is just a basic set of settings that I use to start Windows games on Linux OS under Wine. If you have anything to add, welcome in the comments.

It turned out that not all the subtleties are there. Therefore, I wrote this post as an addition to that.

This post is mostly a free translation of. documentation, as well as several of our own and others’ tricks when working with Vine.
Most likely this post will be of interest to beginners and ordinary users GNU\Linux. Nevertheless, good advice from experts will not be superfluous.

I think there is no point in explaining what a vine is. I just want to show you a few tricks when working with it.

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 delete the prefix in which the error occurred, while all other applications\prefixes (assuming they are configured) will not be affected.

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

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

Mkdir ./Gamez

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 this do:

Wine winecfg - the wine configurator will open (not from the prefix), check the same tab. See! There are no libraries here. So he is safe and sound.

How to install multiple different versions wine?
To solve this problem, you will have to build wine from sources. When assembling, we simply use the prefix for the default installation. Something like this:

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

AppDB
Be sure to use appdb to search for information on installing the application; perhaps the staff you are installing has already been installed and all the pitfalls have been described.
Cleaning up your home directory
If you like to game, then your /home partition is probably full of saves and other game files. You can get rid of this whole thing, without any damage, like this:

Replace the standard path to my documents with the desired location for storing saves. For example, this path leads to the game folder.

Using the latest versions of wine
Wine is such a thing than newer than that better! With the following command you will always have latest version wine (for Ubuntu-like distributions):

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

After running these commands, look for the latest version of wine in synaptic.

Installing winetricks
If for some reason you still don’t have winetricks, then you can start one on your farm like this:

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

How to install MSI file?
This can be done in two ways: 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 exe file there is a ban on execution. For a file on your FS, 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 separate file?
cd ~/.wine/drive_c/Games/Tron
wine tron.exe &> log.txt
How to disable the "crash" dialog?
If you use prefixes, do not forget to specify the path to the prefix in the command - winetricks nocrashdialog
After launching the application/game, wine complains and does not launch anything. What to do?
First, study the logs, usually everything is written in them. Below I will list the most popular mistakes:

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

My app is working but the text fields are behaving strangely
Analyze the wine debug after launching the application, if you see something complaining about RICHED20.DLL, then install the following library via winetricks: riched20
After launch, fixme messages are displayed in the console. What is this?
You can simply ignore them, this is information for developers.
What to do if the application requires the .NET framework?
Through Wintrix you can install 1 or 2 frameworks. Alternatively use mono. If the application requires framework 3 or 4, 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 I'm trying to install is protected from distribution, is it possible to install it?
See the list of copy protection that work.
What to do if the application requires IE?
Wine uses the Gecko kernel/engine by default, which is the same as Firefox. Therefore, you can install gecko (if it doesn’t exist) and/or fakeie6 through winetrikcs.

If this doesn't help, try changing windows version on win2k and install via 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 antialiasing options: fontsmooth-gray, fontsmooth-rgb or fontsmooth-bgr
Screen resolution is not restored after exiting the game
This 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 require a separate driver installation?
No. Wine is not a computer emulator, it only translates Windows calls API into Linux-friendly commands.
Is it safe to run wine as root?
Never run wine from root user!!!

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

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

Safety precautions when using wine
Here are some tips to help you improve your security:
  • Never run programs from suspicious sites
  • Never use root user to run applications!
  • Use antivirus scanner for startup applications such as ClamAV. Or at least check the exe files on virustotal
  • Try removing the wine drive Z:, which points to the root directory by default. As a workaround, run programs from the ~/.wine/drive_c directory.
  • Use virtual machine to launch and scan suspicious applications.
The file.xsession-errors clogs up the entire disk space with garbage!!! What to do? (recipe from --=XliN=--)
Save the following script:
% 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

Add it to startup, and install the following package (it is necessary for the script to work).
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_with_full_path
4) for the first user, enter the command xhost +local into DE startup: second_user
5) write in the shortcut to launch the program
sudo -u second_user /program_with_full_path
then the first user will be able to more or less safely run programs on behalf of the second user.
The asterisk marks the items for which root rights are required.

Wine is a free, open source implementation software interface Windows. Wine is not an operating system or computer emulator, how can one characterize, for example, virtualization programs (VirtualBox, VmWare etc.), which is emphasized by the decoding of its name " Wine Is Not Emulator". Wine was created to reduce the degree of dependence on the activities and position of the corporation Microsoft, expanding the scope of application free operating systems due to the possibility launch programs for Windows.

Wine is not an emulator

In fact, Wine is a set of libraries and software tools allowing run Windows programs and similar to what she uses operating system from Microsoft. Part The Wine software distribution also includes programs for configuring it (), a registry editor, and a package of scripts, file manager, Notepad, etc. Quantity programs for Windows, which today already start from using Wine quite large and constantly growing. At http://appdb.winehq.org there is a specialized database with marks on the compatibility of certain programs with Wine. Among the fully compatible Wine programs many office and multimedia programs, programs for enterprises and organizations, "1C" including, programs for graphics processing (including some versions Adobe Photoshop and so on.). The number of supported and natively compatible Wine games.

Since emulation of any devices and when working Wine does not occur, the operating speed is compatible with Wine programs when using it, it is usually no lower than when working directly in Windows (and often higher).

Based on or using components Wine at different times projects such as Cedega(focused on launching games, Firstly), CrossOver(focused on launch application programs ) and so on.

Installing Wine

Wine software package most often included in modern Linux distributions(Ubuntu, Mint, Debian, openSUSE, etc.), and to search for it and installations You most likely need to contact management software your distribution.

Apt-get install wine In order to install WINE, execute in console as administrator, for Debian, Ubuntu, Mint, etc. zipper install wine wine-gecko For SUSE and openSUSE Linux.

Setting up Wine

For start Wine setup programs, call in the console or shortcut dialog, winecfg (use " if necessary) WINEPREFIX"). Winecfg configures appearance Windows programs for example, it makes it possible to change the version of a set of libraries Windows (2000, XP, 2003, Vista, ...) and so on.

Winetricks - additional settings, components and programs

Winetricks is a set of scripts written by developers Wine and the community, to facilitate changes to some hidden Wine settings, installations some additional system libraries ( DirecX etc.) and popular programs for Windows, including Internet Explorer (I.E.), several demo games and so on.. Winetricks is usually included with the Wine distribution. To launch the main dialog box Wintricks run in the console, or the shortcut command dialog (key combination " Alt+F2"), command " winetricks". You can also use commands like winetricks directx9 in the console, where "directx9"- name of the component to be installed. To view a list of component categories offered Winetricks for installation, you can call winetricks list command, and for an overview of the lists of contents of the categories themselves - winetricks apps list , where "apps"- name of the desired category.

Running Windows programs in Wine

Way running programs in Wine typical for working with any file, be it an image, text file or executable exe file in our case: You can simply run executable file Windows (*.exe) from his file manager(by double clicking, for example), or execute command in the console like wine ~/Downloads/program.exe . You also can launch Windows programs through internal paths Wine, if they are in directories mounted as system drives when starting the required profile ("prefix") Wine(be it the standard "~/.wine/drive_c", or any other folders, customized You). In this case, the DOS address format is used programs wine C:\\Program\ Files\\programm.exe .

A backslash "\" is added before special characters, such as the same backslash or space.

Installing Windows programs in Wine

For Windows program installation, You will accordingly need run its installer: wine setup.exe Next you will need to go through the standard procedure installation of programs for Windows, which most often involves clicking the “Next” button multiple times. One of the most interesting functional features Wine lies in the possibility of using profiles, or so-called " prefixes", for installing programs - independent copies of sets of system libraries, programs and Windows settings . Standard prefix Wine, i.e. the folder in which the profile is written by default is ".wine" - hidden folder inside the user's home directory. To use a separate "prefix" You need to create a new folder for it ( to reset a profile - delete its contents) and use global variable export WINEPREFIX(possible as part of a team launching a Windows program, including for installers). For example WINEPREFIX="/home/user/.wine-programm" wine setup.exe . For installed programs Wine creates shortcuts in the local user (~/.local/share/applications/) menu desktop (Gnome, KDE, XFCE etc.), using the necessary prefixes.

So, the drivers are installed, the video card is configured - it’s time to unleash its potential using computer games. Otherwise, what is all this for? :-) Let's start.

Installing Wine

Wine is an implementation of an application programming interface library ( Application Programming Interface, API). Wine intercepts requests windows programs and converts instructions into their Linux equivalents in the form of commands to the window manager using a standard protocol X11. If you have access to source code windows programs, Wine can also be used to recompile a program into a format that Linux understands better. But that’s not why we need it. We need it for games.

There are several installation methods Wine. First, it may already be in your distribution repository. To be honest, there is not enough space or knowledge to consider the process of downloading from the repository of each individual distribution, because you need to know all the distributions and their features. For example Ubuntu- need to go to Applications -> Ubuntu Application Center, enter in the search bar " Wine" - and it is in front of you. Unpleasant news: it may not be in the repository, or it may be there, but not updated to new versions. Therefore, I advise the second way - self-installation.

First you need to add source Wine to the list of sources that Linux looks for new versions of packages.

Here at this address - www.winehq.org/download/- given detailed description adding and installing on all known Linux distributions. Let's look at the process using an example Ubuntu.

In the console you need to type the following lines:

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

The first line we add the download address Wine to the list of addresses for updating our system. The second line - we read all the latest information about new packages so that Linux adds Wine to the list of available programs. Next, we go to System -> Administration -> Synaptic Package Manager, write in the search bar "Wine", find it in the drop-down list available packages and put a tick. On this moment this is the package Wine1.3, when choosing, he pulls with him additional packages: wine1.3-gecko, winetricks, ttf-symbol-replacement-wine1.3 And wisotool. We install all these packages with the button Apply .

All that remains is to configure the newly installed Wine. The first launch (for example, opening settings) will create system registry and a directory tree in the directory ~/.wine.

Script winetricks and installation of necessary programs

Winetricks is a launched script file. When you launch it, a window appears containing a long list of programs that can be installed through this script. We don't need them all - we only need those without which most games won't launch. So, let's launch winetricks and install:

7zip, d3dx9, d3dx9_28, d3dx9_36, d3dx10, d3dxof, dinput8, directmusic, directplay, directx9, dotnet11, dotnet20, dotnet20sp2, dotnet30.

Windows fonts have already been installed with Wine1.3, if you want to expand the range - winetricks offers a large number of fonts to choose from. Although, instead of scripting one font from the Internet, I simply copied it from the one installed in the next section Windows all fonts in Wine(all fonts are placed in the directory ~/.wine/drive_c/Windows/Fonts).

If you have read in any articles on the Internet that after installation DirectX you need to go to Wine settings DLLs and forget about changing their settings. This information is outdated and no longer relevant. Winetricks does all this for you.

Well, that’s basically all we need. The last step remains - verification DirectX for performance. In the Vain catalog Windows/system32 launch dxdiag.exe and run all the tests on all tabs, especially tests DirectDraw And Direct3D. All tests passed, everything works? I congratulate you! Your computer is ready to install games!

Andrey " F1reTu][" Frolov

Internet