Wine basics for beginners. Basic Wine setup Screen resolution is not restored after exiting the game

So, the drivers are installed, the video card is configured - it's time to unleash its potential with the help of 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 teams window manager using 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 -> Center Ubuntu applications , 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 of available packages and check the box. Currently this is a package Wine1.3, when selected, it pulls additional packages with it: 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 a 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

1. Introduction

Many programs work under WINE without any additional settings at all. Unfortunately, this is not always the case. In addition, programs are constantly updated and the list of running applications is constantly changing. Therefore, it would be a good idea to configure WINE to work with potentially problematic programs.

There are two main utilities for configuration - winecfg and winetricks. In this guide we will look at the first of them. In most cases, however, winecfg's capabilities are quite enough to make the program work.

winecfg is a graphical utility. Different distributions and desktop environments handle WINE and WINE applications differently, so the easiest way to run winecfg on any distribution is in a terminal.

After launching the program, you will see a simple window with seven or eight tabs, depending on the version of WINE. The eighth tab "Staging" appears only when using intermediate versions of WINE.

2. Libraries

The "Libraries" tab is probably the most important in winecfg. It allows you to control how WINE works with Windows libraries. This is especially important because some applications are incompatible with certain versions of libraries, or require certain non-standard libraries. The WINE code has also been modified to address these issues. Since WINE is not Windows, it may not always use the same native version of the Windows library before that library is adapted to work with WINE.

The first element in the contribution is the "New override" drop-down list. It allows you to select a Windows library from an incredibly long list, or enter your own. After that, you click the "Add" button to add to the list.

After clicking "Add", the library will appear in the field below called "Existing overrides.". This field contains a list of overridden libraries added to WINE. By default, the new override (native, builtin) will be as follows. This means that WINE will first try to use the native Windows version of the library. If the attempt fails, WINE will revert to its built-in version. These options can be changed. To do this, highlight the override you need, then click "Edit" next to the "Existing overrides" field.

By clicking the "Edit" button, we will see a window that allows you to edit the override. Here you can choose from five available options, most of which are various combinations of "Native" and "Builtin." The last available option is "Disable". Which option you choose depends on the type of errors you are encountering. Finding the right combination of options can be quite difficult, especially if the program is not documented in the WINE Appdb (https://appdb.winehq.org). You can try running the program in WINE from command line to view the output, which contains a lot of useful information.

If you need to remove an override, simply highlight it in the "Existing overrides" field and click the "Remove" button. From time to time you have to do this when updating the program.

3. Graphics

You probably won't use the "Graphics" tab very often. If you have problems with screen resolution, you can adjust the dpi, and if your window manager is misbehaving, you can disable its control over WINE windows.

More often you will use the "Emulate a virtual desktop" option in the "Graphics" tab. This option allows you to force the WINE application to launch in a window that behaves like a virtual desktop. Remember that this is not virtual machine. It simply forces applications to run in WINE in a window.

This option probably seems rather strange, but there are at least a couple of cases where it may become necessary.

Very often, programs in WINE refuse to run in windowed mode. This problem usually occurs in games where some strange bug only appears in windowed mode. A workaround for running such games in windowed mode is to use the "Emulate virtual desktop" option.

The other case is more problematic. Sometimes an app tries to change the screen resolution and crashes in the process. Again, this happens most often with games, especially older ones. A crash could ultimately result in a black screen, the wrong resolution being set, or the X server hanging. Either way it's a problem. To prevent this, run the program with the "Emulate a virtual desktop" option. It may not prevent the program from crashing, but it should prevent problems with the rest of the system. This is a useful debugging methodology.

4. Desktop integration

You've probably never used this tab. The "Desktop Integration" tab allows you to change appearance applications running in WINE. However, most graphical shells and window managers already cope with this task perfectly, as a result of which there is almost never a need to change the theme. The worst thing that can await you if you don't use this tab is design in Windows style 98.

5. Discs

WINE usually does a good job of detecting drives. If the drive is not detected, or you need to add a physical or virtual drive to the system, use the “Drives” tab for this.

When adding a physical drive, you can use the "Autodetect" button to have WINE try to detect the new drive. If this doesn't work, or you are adding a virtual drive, you can click "Add..." and set a letter for the new drive. Next, select the drive in the "Drive configuration" window and change the path to the device in the "Path" field.

This tab is very useful when running games that span multiple discs, or games that require a disc in the drive to run. It can also help if you have a designated Windows drive or partition that contains games or other programs.

6. Audio

7. Staging

You will only have the "Staging" tab if you are installing intermediate releases or patches. It is simply a set of checkboxes that allow you to enable or disable various features provided by patches. The main feature is the ability to activate support for CSMT or Gallium Nine, depending on the installed patches. CSMT is available for all video cards and drivers, and can significantly increase performance in many programs and games. Gallium Nine is only available to Mesa users and can potentially see huge performance gains. However, these two options cannot be used simultaneously. Other options may also provide some performance gains.

8. Settings for specific programs

Since most WINE settings are used to troubleshoot problems associated with various applications, it makes sense to create specific configurations for different programs. The "Application" tab allows you to create configurations that are selected when certain applications are launched in WINE, as well as select the emulated Windows version to ensure compatibility.

To create a specified set of settings, click "Add application...". You will see a window that allows you to select executable files Windows.

winecfg will change settings depending on which application is selected in the tab. By default, the default settings are selected. These are general settings that will apply to all applications, with the exception of a specific set of settings intended for a specific application. By selecting an application in the "" tab, you will see the settings of this application in all tabs. Changes you make in other tabs apply only to the selected application.

9. Conclusion

winecfg is a small but powerful utility that allows you to customize WINE to suit your needs. Once you become familiar with it and learn how to use it correctly, you will be able to create working configurations with many applications that run using WINE. Additionally, using winecfg with winetricks, you can achieve near-native performance levels for many programs.

All people love to play games. This activity helps to take your mind off the real world with its real problems and, at least for a short time, immerse yourself in the virtual world.

This is exactly how an article about games for Windows should have started. But today the conversation is not entirely about them. Today we will talk about games on Linux. Most people don't like this operating system just because it doesn't have "normal" games, no matter that it works great.

But those who want can play the same games on Linux as on Windows. Ask how? And it's very simple. Today we’ll talk about how Wine is installed and configured.

Those people who have been using Linux for a long time and have chosen it as the head of the OS probably do not need to define this software, but for others it is still worth explaining.

Wine is a program that makes it possible to run Windows programs and games. In other words, you can use it to play those games that are not intended for Linux and are, so to speak, exclusive to Windows.

It is noteworthy that the program is constantly evolving. So, a couple of years ago it was impossible to launch a game based on DiretX11 using it, but now everything has changed. Patches are constantly being released, and everything is quickly repaired if something is broken. If you prefer stability, then you can easily install the standard version of Wine and it will not surprise you unpleasantly.

The only downside is the relatively complex setup of Wine. But after reading this article, you will understand everything in a matter of minutes and do everything yourself.

Installation methods

Before telling how to set up Wine for games, it is necessary to first explain how it is installed.

Linux users know that the same action in their operating system can be produced in different ways, and with

Let's consider initially the simplest option, using the Package Manager or, as it is also called, the Program Manager. In principle, it doesn’t matter what it’s called, the main thing is that it works the same.

Initially, you need to open it. Next, in the search bar you need to enter the name of the program - Wine. The search begins. At the end of it, several options may appear in front of you. Simply select Wine without any extra characters and click “Install”. Wait while the program downloads and installs.

The second way is to use the terminal. Once you open it, enter:

sudo apt-get install wine

The download will begin followed by installation. However, there is a high probability that the download will not be the “fresh” version, this is due to the fact that the program is developing by leaps and bounds. Therefore we enter:

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

sudo apt-get update

Now enter:

sudo apt-get install wine1.6

That's all, the software has just been installed via the Console. Now we’ll tell you how to configure Wine.

What you need to know about setting up Wine?

For Wine (Linux), the setup may not always go smoothly, but don’t worry if something doesn’t work out for you, you can return everything to its original position at any time. The easiest way would be to remove the program and reinstall it, but this is only in extreme cases.

The main thing is not to rush. In this matter, it is important to carefully read what needs to be done and when. But if you succeed, you will remember it for the rest of your life. Now let's get started.

First thing

There are two development options here, the differences in them are small, but still there. If you have 64-bit Linux distribution, then you and Wine have 64-bit installed, but this is not necessary. Therefore, enter this command into the terminal:

WINEARCH=win32 winecfg

After this, you should have the Wine settings open. Move it to the background and don't come back to it for now. If you have a 32-bit system, you can skip this step.

Now you need to download and install Winetricks. To do this, write in the terminal:

winetricks

If you do not have this program, you will be offered to download it. Download and install. Then launch it.

Winetricks allows you to quickly set up Wine itself. Having launched it in the first window, you need to select Select the default wineprefix. Click OK.

Setting up DLLs and fonts

We continue to talk about how the Wine setup proceeds. By clicking “OK”, we will see that a second window will open. It is necessary to highlight Install a font- this is to customize fonts. Click OK.

A window will open in front of you with all possible fonts for Wine. In order not to delay for a long time and not waste time, select everything at once and click OK. After this, the download and installation window will open. During this, do not move far from the computer, as it is likely that you will receive requests to confirm the operations being carried out. Agree with all of them.

It is likely that after selecting all the fonts and pressing the button, you will be shown an error and everything will be lost. In this case, you won’t be able to install everything at once and will have to do it separately. If after selecting an item you get an error, skip it.

Now let's move on to setting up the DLL. This is a very important point, and you cannot skip it, since without the installed DLLs it is unlikely that you will run at least any game.

Click on Install a Windows DLL or component. A window similar to what was with the fonts will open in front of you. Not all components can be installed here, but some are required. In general, it would be better to do the same manipulations as with fonts. Try to install each of them one by one, ignoring those that give an error.

By the way, after trying to install some DLLs like dotnet30, you may get an error and open Explorer with the browser. In this case, on the browser page you need to download the proposed component and place it in the folder that was opened, and then perform the installation procedures again.

Registry settings

By the way, following these instructions, setting up Wine in Linux Mint works fine, although there should be no problems with other distributions either.

Let's move on to debugging the registry. To do this, in the second window, this time select Change setting. You can’t take any liberties here, and you won’t be able to install everything at once. Therefore, we follow the presented list of necessary settings:

    ddr-opengl

    multisampling - enabled

    orm - f bo

    psm - enabled

    rtlm - auto

    glsl - enabled- this is according to the standard, but if you have an Nvidia video card, then it is better to choose disabled. This will improve gaming performance.

    vsm - hardware

    videomemory size 1024(select the amount of video card memory)

    mwo - enabled (force)

That's basically all about Wine. Setting up Mint and other OS versions is no longer a problem for you, because these instructions are perfect for most distributions.

Remember one more thing: when installing Windows games, you cannot choose to install additional software. Uncheck the boxes. Also, once the installation is complete, uncheck the “Run now” checkbox. Launch via a shortcut on the desktop.

Wine– an application that is a compatibility layer with Windows API, using libraries Windows to ensure the functionality of applications developed for the OS family Microsoft Windows in another environment, for example, in Ubuntu. Using Wine, you can install and run various programs as if you were using Windows.
Wine is actively developing. Not all applications yet work stably enough in Wine, however Wine already used by several million users around the world.
The name of the program Wine (waɪn- between " Wayne" And " vine", rus. Wine) is a recursive acronym for the phrase " W ine I s N ot an E mulator" - Russian. "Wine is not an emulator."

Installing Wine

Installation from PPA

Due to the fact that Wine is actively developed, the Ubuntu repositories usually contain a very old version. Therefore, it is recommended to install the latest version from the official Wine repository.

For latest versions of wine and ubuntu 64 bit

Sudo dpkg --add-architecture i386 sudo add-apt-repository ppa:wine/ wine-builds && sudo apt-get update sudo apt-get install --install-recommends winehq-devel

In general, it is not recommended to fill out and configure wine yourself. Working with wine is not very convenient. To install this or that program, you will have to crawl through a bunch of forums and blogs to understand which packages need to be installed and which libraries to add. Then there is a long process of solving problems, installing packages through winetricks and manual settings registry and so on. This is all very difficult even for experienced users, not to mention newbies. Therefore, it is recommended to download the configured wine prefix from here: http://forum.ubuntu.ru/index.php?topic=199897.0

Settings

Before using Wine to run applications, you need to run the setup program, which will create a directory in your home directory ~/.wine with the files necessary for work. To do this, either select the main menu item Applications→Wine→Configure Wine, or run the command in the terminal:

winecfg

Associating files with wine programs

To transparently launch files using wine programs, let's write a small script. Let's say we need to open CAD files with Compass and zwcad.

#!/bin/bash # Determine the file extension dd = $1 ; razr =` echo $(dd:(-3)) ;` ff =` echo $(dd/\"/\"Z:) ` ; ff =` echo " \"Z:"$ff \" ` ; # Depending on the extension, launch the desired program case $razr in frw) env WINEPREFIX ="/home/" $USER "/.wine" wine start ` echo $ff ` & ;; cdw) env WINEPREFIX ="/home/" $USER "/.wine" wine start "C:\\Program Files\\ASCON\\KOMPAS-3D Viewer V9\\Bin\\kViewer.Exe"` echo $ff ` & ;; dwg) env WINEPREFIX ="/home/" $USER "/.wine" wine start ` echo $ff ` & ;; dxf) env WINEPREFIX ="/home/" $USER "/.wine" wine start "C:\\Program Files\\ZWCAD 2009 Eng\\ZWCAD.exe"` echo $ff ` & ;; # Here you can add more extensions and programs esac

Let's not forget to make our script executable

chmod +x wine_cad.sh

and associate the drawings with the script in the file manager.

Launching Windows applications

In order to launch the application you need to open a terminal and write in it:

wine path/ to application/ program.exe

If your application does not start or does not work correctly There is a list of applications with descriptions on the wine website, I recommend checking it first. http://appdb.winehq.org/ - The site has a search field. If your English is bad, then use the translator http://translate.google.com/.

You can also open the folder containing the application you need to launch using file manager, then right-click on the application and select the program to launch - Wine.

Applications running via Wine that interact with Web pages require Gecko

Gecko is a free web page rendering engine for the browser when working on the Internet wine. If wine does not work with the Internet and you do not run a windows exe browser, then you do not need Gecko. Typically, when starting a web application, Wine automatically looks for Gecko first in /usr/share/wine/gecko. If Wine doesn't find the Gecko archive there, it will automatically download it from the Internet, but some applications don't like to wait for Gecko to load and freeze or crash. Gecko can be installed by running the command:

sudo apt-get install wine-gecko< версия>

Where<версия>must be replaced with the version of the installed Wine.

Running via discrete video card

To run via a discrete video card, you need to register in the terminal on free drivers (or write a script)

Vblank_mode=0 DRI_PRIME=1 wine file_name.exe

vblank_mode=0 means vertical synchronization (Vsync). If there is no VSync in the game settings, then you need to erase vblank_mode=0

Save. Place in the game folder. Make it executable in properties. Place a link to the script on your desktop. Run a link instead of a game file. For even greater performance, you need to install a closed proprietary driver.

Winetricks

Winetricks is a script for installing various components from Microsoft®, and some others. To get Winetricks in the terminal, enter:

sudo apt-get install winetricks

Winetricks contains several dozen packages of various libraries for wine. For example, to install DirectX™, enter:

Winetricks d3dx9

To view a list of all packages, enter:

Winetricks?

Also, Winetricks has a simple GUI. To run it, enter.

The previous manual is outdated and does not cover many features of wine. Here I will describe the initial setup of 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 you to install additional Windows components in Wine in a few simple steps.

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 filling with wine 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

mob_info