How to set up smartphones and PCs. Informational portal
  • home
  • In contact with
  • How to install windows programs on linux. The idea of ​​a Linux distribution with (almost) full support for Windows applications

How to install windows programs on linux. The idea of ​​a Linux distribution with (almost) full support for Windows applications

If you switched to Linux, but did not find suitable analogs of Windows programs, do not despair. In this case, you can use the special software - WINE. Wine is not an emulator and therefore does not take time to emulate - Wine runs applications the way Windows does. You will be able to run almost all the applications you use on Windows and customize them to your liking, i.e. load your own fonts, etc. But first, let's take a look at the basics of Wine.

Wine is free software that allows users to UNIX-like systems run 16 and 32-bit Microsoft Windows applications.

Installing Wine:
Let's use the superuser terminal (ONLY for installation):

Sudo -s

Add a list of key repositories and install Wine:

RELEASE = `lsb_release -cs`
elif [[$ RELEASE = "lucid" || $ RELEASE = "karmic" || $ RELEASE = "jaunty" || $ RELEASE = "intrepid" || $ RELEASE = "hardy"]]; then
wget -q http://wine.budgetdedicated.com/apt/sources.list.d/$RELEASE.list -O /etc/apt/sources.list.d/winehq.list
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | apt-key add -
apt-get update && apt-get install -y wine cabextract

Note: if you are not using Ubuntu, but, for example, Linux Mint 9, then the expression

Http://wine.budgetdedicated.com/apt/sources.list.d/$RELEASE.list

change to

Http://wine.budgetdedicated.com/apt/sources.list.d/lucid.list

otherwise, the command will substitute "isadora" instead of "lucid" and the installation will fail.

Then we create in home directory~ / .wine / folder by running Wine configurator:

Winecfg

For now, we don’t need to do anything there, we will close it.

Installing and uninstalling applications:
To install the Windows application, we will use the winefile file browser:

Winefile

Then go to the required directory of our Linux file system or virtual drive C: / and double-click to launch the required executable file. Many applications require a system restart after installation, but we are working in virtual environment and therefore the computer should not be restarted. You just need to restart Wine (and terminate other running applications before rebooting):

Wineboot

If the installation is performed from a file with the * .msi extension, then we will use the command:

Msiexec / i example.msi

where example.msi is the name of your file.

To uninstall a Windows application, do the following:
Go to "Applications" → "Wine" → "Programs" → "" → "Uninstall".

If, after installing the application, its folder does not appear in "Applications" → "Wine" → "Programs", then we will use the terminal. For example, to run example.exe located on the virtual drive C: / in the Program Files / Random directory, go to the appropriate directory and run it:

cd ~ / .wine / drive_c / "Program Files" / Random
example.exe

General settings:

Applications:
Windows XP is installed by default, which can be changed to another version. Moreover, you can configure so that each application is launched with the parameter of a specific system.

Libraries:
By default, all libraries in Wine use their own.

Graphics:
For some applications, you may need to enable or disable vertex and pixel shaders, you may need to emulate a virtual desktop. Try changing the parameters of this section yourself.

Appearance and integration:
In the "Graphics" tab, by default the checkboxes "allow the window manager to manage the Wine windows" and "allow the window manager to decorate windows" are checked, the design of win-windows will be the same as for any other applications. system fonts and the color of the desktop.

Disks:
Here you can add disks using any directory in your file system.

Audio:
It is not recommended to change anything when the sound is working.

Remember!
When starting Wine, it is advisable to terminate all running applications and disable Compiz (effects).

The use can be dictated by a variety of reasons - from a banal habit of some programs to the impossibility of launching a separate machine with Linux. Someone wants to use native versions of software for debugging, while someone hopes that in this way it is possible to force users to smoothly migrate to a full-fledged distribution kit.

Linux programs - there is everything

Before starting a garden with emulators, it is better to look for ported versions or analogs of your favorite programs. The same and many other utilities have native assemblies not only for Windows, but also for. To obtain any specific functionality, a full-fledged analogue of software from Linux is often not required. For example, you get used to Tab autocompletion in the shell very quickly, but in command line Windows does not have this at all. The clink utility will help fix this and other annoying omissions.

Standard console utilities, for example from the GNU Coreutils package, have long been ported to Windows. There are both fairly old sets of GNUWin II and UnxUtils, as well as the constantly updated UWIN and Gnuwin32. For the latter, after completing the installation of the basic installer, you need to sequentially run the download.bat and install.bat files, and then copy the gnuwin32 folder to any convenient location and run the update-links.bat file from it. After running the last script in the StartMenu subdirectory there will be links to starting the command line with the GNU environment and documentation for the utilities.

Microsoft Windows for UNIX

Owners in maximum and corporate versions, as well as server versions of Microsoft OS may not bother at all. A Subsystem for UNIX-based Applications or Microsoft Windows Services for UNIX are available for them. This set basic utilities is present directly in the system components. Finally, the last on the list and the first most popular solution for running UNIX programs is. This package is easy to install and contains far from a small set of applications ported to Windows. It is recommended to use it.

KDE on Windows

Now we can talk about a strange thing - starting a system that is not native to Windows. In fact, the KDE on Windows project has existed for several years, and at first it was simply impossible to use it due to regular crashes, which perhaps did not drive the unfortunate system into BSOD. However, the developers did not sit idly by, and in the current reincarnation of the project it can be safely installed - errors are quite rare, and even those are not critical. It probably doesn't make sense to put everything at once, but some applications may appeal to you.

Linux in a virtual machine

Unfortunately, ported applications do not always behave the same as in their native environment, or they may conflict with other programs. Therefore, the only way out, besides installing a penguin OS on bare metal, is to emulate Linux. For one-time use, you can use a shell for QEMU called MobaLiveCD, which, without unnecessary gestures, will help you run LiveCD / USB with various distributions. For permanent use it is better to install Linux in a virtual machine: in or VMWare Player... Just remember to install Guest Additions for more comfortable work... An alternative option is the use of VDI solutions with the ability seamless integration in Windows Linux applications running on a separate host, which can also be virtualized.

CoLinux emulator

The best option for running Linux applications is to use. She, relatively speaking, runs the Linux kernel at the level Windows kernel and has access to all the hardware resources of the machine, due to which there are practically no performance losses. At the same time, it maintains full compatibility with Linux applications, allowing you to directly run them. CoLinux has ready-made systems for fast Launcher Portable Ubuntu Remix, Topologilinux, SpeedLinux and andLinux. The only annoying limitation of coLinux and all packages based on it is the need to use a 32-bit version of Windows 2k / XP / 2k3 / Vista / 7. As an example, let's analyze minimum setting... The first step is to install a fresh version of coLinux, refusing to download ready-made images and installing WinPcap along the way.

Installing coLinux on Windows

Now you need to download the archive of the Debian disk image and unpack it into the folder where you installed coLinux. The size of the rootfs_2gb.img disk can be increased if desired. The squeeze.conf file will have to be tweaked a bit. Minimum changes - increase the amount of allocated RAM, allow access to the C: drive via COFS and add the TAP network interface. Note that when using COFS, it is best not to access the same folder files from Linux and Windows at the same time.

Kernel = vmlinux cobd0 = "rootfs_2gb.img" cobd1 = "swap_128mb.img" root = / dev / cobd0 ro cofs0 = "C: \" initrd = initrd.gz mem = 512 eth0 = slirp eth1 = tuntap

After launching squeeze.bat, you will be taken to the Debian console. The default login is root and there is no password. Use nano to edit the parameters network interfaces in the file / etc / network / interfaces. Let's add a section for eth1. We use any IP address, so long as there is no intersection with other local subnets. In Windows, in the IPv4 settings network adapter For TAP-Win32 Adapter V8, you must specify an address from the same subnet.

Auto eth1 iface eth1 inet static address 192.168.100.2 netmask 255.255.255.0

We exit nano with saving changes - F2, Y, Enter. Now let's create a folder where the C: drive will be mounted ...

Mkdir / mnt / windrvc

... add one line to the end of the / etc / fstab file and save it:

/ dev / cofs0 / mnt / windrvc cofs defaults 0 0

Now we are going to install the X server, but for now, for the sake of simplicity, we will register the export of the DISPLAY variable to the ~ / .profile file. Use the one specified for the TAP adapter in Windows as the IP address. After that, you can reboot with the reboot command.

Export DISPLAY = 192.168.100.1: 0

It would be useful to install, including Cyrillic ones. Optionally, you can browse through the font directories, including C: \ Windows \ Fonts, the mkfontdir and mkfontscale utilities from Cygwin. You are now ready to install the Xming X server. Immediately after this procedure, add the IP address of the TAP interface in Debian to the X0.hosts file.

We would like to thank Windows for being vigilant and in the standard firewall we will change all the rules concerning Xming from prohibiting to permissive, otherwise the programs will simply not reach the X server. Now we launch the XLaunch utility, in which you can select the display mode for X-windows and set Extra options... It is important for us to configure support for Russian and English layouts with Alt + Shift switching and optionally set DPI. At the end, the settings file should be saved as name.xlaunch. In the future, by double-clicking on this file, the X-server will be launched with the parameters we specified.

Xkblayout us, ru -xkbvariant basic, winkeys -xkboptions grp: alt_shift_toggle –dpi 96

In order not to be so boring, we will install the synaptic graphical package manager for more convenient software installation and some lightweight panel with an application menu, for example lxpanel. For the sake of simplicity, we will prescribe the latter to autorun at login by adding the lxpanel & command to the end of ~ / .profile.

Apt-get update apt-get upgrade apt-get install synaptic lxpanel

For completeness, let's add audio support. Download the Pulseadio archive from here and unpack it into some directory where we create text file default.pa. We fill this file with the following lines. Here 192.168.100.0/24 is our TAP subnet.

Load-module module-native-protocol-tcp auth-ip-acl = 127.0.0.1; 192.168.100.0/24 load-module module-esound-protocol-tcp auth-ip-acl = 127.0.0.1; 192.168.100.0/24 load-module module-detect add-autoload-sink output module-waveout sink_name = output set-default-sink output

Run pulseaudio.exe and once again go to edit the permissions in Windows firewall... In the Debian console, install necessary utilities and libraries.

Apt-get install libpulse0 libasound2-plugins alsa-utils

In the /etc/pulse/client.conf file, add the IP address of the host machine with running server Pulseaudio - default-server = 192.168.100.1 and /etc/asound.conf has the following parameters:

Pcm.! Default (type pulse) ctl.! Default (type pulse) pcm.pulse (type pulse) ctl.pulse (type pulse)

To test the functionality, you can try to play one of the test files.

Aplay /usr/share/sounds/alsa/Front_Center.wav

Pulseaudio automatically starts when Debian starts up by adding this command to the end of the squeeze.conf configuration file.

Exec0 = "X: \ path \ to \ folder \ pulseaudio \ pulseaudio.exe"

Xorg on Windows

For an X server, this is not a trick. In principle, what has already been done is enough for the job. However, it would be nice to add to Linux new non-root user, set up autologin for him with mingetty, install coLinux as windows services and set Xming to autorun. For convenience, you can put the Desktops utility, which creates several virtual desktops in Windows, and run the X server in full screen mode on the second desktop.

As a result, we got a fast environment for almost native launch of Linux applications on Windows. It can be used for writing and debugging web applications, cross-compiling drivers, and other tasks. But there is still no sane graphics acceleration for heavy applications, and the 64-bit version began to be developed only a few months ago. However, coLinux is quite suitable for everyday use... To further explore the capabilities and settings of this system, refer to the project wiki. Well, with this, for now, we will close the topic of the symbiotic relationship between Windows and Linux through different places. Good luck!

For operating systems on Linux based a huge number of programs have been written. Despite this, sometimes it becomes necessary to run Windows programs under Linux. Basically, this applies to games and some specialized programs, which have no analogues in Linux. In addition, some users, moving from Windows to Linux, are already accustomed to a certain set of software and want to use it in the future. In this case, it is still preferable to find similar programs for Linux and master them, since programs usually work better and more stable in the native operating system. Therefore, we recommend that you run Windows programs under Linux only after you have made sure that there are no analogues of the required programs under Linux, or they do not suit you.

There are several ways to run a program written for Windows on Linux: using Wine and products based on it, using virtual machines and emulators: VirtualBox, VMware, Parallels Workstation, QEMU. Theoretically, it is still possible to port programs from Windows to Linux if you have the source code and programming skills, but we will not consider this option here.

Wine programs usually run faster than virtual machines. This is especially true for modern 3D games. Wine does not require an operating system to be installed and allows you to quickly change the version of the system, libraries, and other parameters. You can run programs directly in the Linux environment. On the other hand, configuring Wine will still take some time and possibly more than once when launching individual programs and games. The virtual machines run the original versions of Windows and other operating systems that must be installed and configured beforehand. The system is allocated certain computer resources, emulated standard equipment... Before executing the program, you must first start the emulator and load the operating system, which requires additional time. It should be noted that some programs are protected from running under virtual machines.

Installing Wine

Open the terminal with a key combination Ctrl + Alt + T... Add a repository with Wine command:

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

Enter the administrator password. During the installation process, you will need to press the " Enter».

If you are upgrading the system, for example, upgrading Ubuntu 13.10 to Ubuntu 14.04, then you will have to repeat the above operation after the upgrade, since the non-standard repositories are deleted during the upgrade.

After adding the repository, we update the information about the packages:

sudo apt-get update

Now you can install Wine with the command:

sudo apt-get install wine1.7

The latest, at the time of this writing, test version of the program will be installed. To install an older, but more stable version, you need to run the command:

sudo apt-get install wine1.6

Perhaps, when you read this article, newer versions will already appear, then instead of wine1.6 or wine1.7, you will need to install wine1.8 or wine1.9. Number current version listed on the official Wine website: http://www.winehq.org

Although it is possible not to specify the version during installation, the Wine version in this case will depend on the version of the operating system:

sudo apt-get install wine

You can check which version is installed using the command:

wine --version

Wine setup

After installation, you need to configure the program with the command:

winecfg

Rice. 1. Winecfg settings window

This command will create a .wine directory in the user's home directory, which will contain system files with settings - an analogue of the Windows registry and drive_c - a directory for Windows applications. With winecfg, you can select the default Windows versions and for individual applications, library versions, set up graphics and sound, integration with the desktop, select disks from which Windows programs are allowed to run.

And you can edit the registry using the familiar command:


Rice. 2. The regedit window under Wine

After such initial setup, it will already be possible to install and run programs using Wine. But many programs will not be able to work, since they require certain libraries, fonts, etc., which will have to be installed separately. To do this, we will use the winetricks program, which is included in standard package Wine programs. In addition to fonts and libraries, Winetricks also allows you to install popular programs and games and customize Wine.

Let's try to install Internet Explorer 7 using winetricks, for this we type in the terminal:

winetricks ie7

Let's wait a while while they download required files and the installer will start, press the Next button and wait for the installation to complete. For the subsequent launch of Internet Explorer, you will need to run the command:

wine "C: \ Program Files \ Internet Explorer \ iexplore"

But it's better to run programs from the home directory. Go to the directory (if there is a space in the file name, then you need to put a backslash "\" in front of it):

cd ~ / .wine / drive_c / Program \ Files / Internet \ Explorer /

And run the program:

wine iexplore.exe

In order not to type these commands every time, you can create simplest script... Go to your home directory:

Create ie.sh file using nano editor:

nano ie.sh

Insert the lines into the file:

cd ~ / .wine / drive_c / Program \ Files / Internet \ Explorer / wine iexplore.exe

Save the file - Ctrl + O and exit the editor - Ctrl + X... We make the file executable:

chmod + x ie.sh

Now, to start ie, just type:

~ / ie.sh

Or you can copy the file to the desktop and run it with the mouse:

cp ie.sh ~ / Desktop /

Installing the program from CD or DVD can be done with the following command:

wine start "D: \ setup.exe"

You can install other programs and libraries in the same way. You can also use the program's graphical interface by typing winetricks no parameters. Then select "Select the default wineprefix".

Rice. 4. Choosing the winetricks action

And we mark the libraries that need to be installed. You can do the same with the command line, for example:

winetricks d3dx9 dotnet20

Thus, we will install two components at once: d3dx9 and dotnet20. So that the programs display correctly popular fonts, install them:

winetricks allfonts

Libraries are a little more complicated. Different programs may require separate settings, defined Windows versions and libraries. To do this, you can create several Wine configurations, specifying the directory with the settings using the environment variable WINEPREFIX... By default WINEPREFIX = ~ / .wine To create new settings in the ~ / .wine2 directory, type:

WINEPREFIX = ~ / .wine2 winecfg

Thus, any number of configurations can be created. To configure and install fonts and libraries, type:

WINEPREFIX = ~ / .wine2 winetricks

To run the installed program:

WINEPREFIX = ~ / .wine2 "C: /path/to/program/program.exe"

You can terminate the execution of the program using the command:

killall -9 program.exe

And to terminate the work of all programs running under Wine, you need to type:

wineserver -k

To remove settings and all programs in the ~ / .wine2 prefix, you just need to delete the directory:

rm -r ~ / .wine2

You can delete the main Wine directory in the same way:

rm -r ~ / .wine

Be careful, this will also remove all Windows applications that are installed in this directory!

winefile- launching the file manager, with which you can launch Windows applications, copy and delete files, etc. Find out what applications and games run under Wine and how to make settings under specific applications it is possible on the website: http://appdb.winehq.org/ The site is in English. To search for applications, select “Browse Apps” in the menu and enter the name of the program in the “Name” field. Versions of programs that start and run without errors or with minor problems are rated Platinum or Gold. If the program does not work at all, then it is assigned a "Garbage" rating.

PlayOnLinux

PlayOnLinux is a program that greatly simplifies the installation and configuration of Windows applications to run under Wine. It automatically downloads from the Internet and installs all the necessary components to run specific programs, as well as the programs themselves, if they are distributed free of charge via the Internet. Otherwise, you will need installation disc with the program. Install the program in any way, for example, in Ubuntu with the command:

sudo apt-get install playonlinux

and run it:

playonlinux

Using the program is extremely simple. Press the "Install" button.

Rice. 5. Main window of PlayOnLinux

We select the program to be installed. If you have not found the required program in the selection window, you can try to click "Install a program that is not in the list" at the bottom of the window.

Rice. 6. Window for selecting the PlayOnLinux program

All that remains is to click the Next button several times, and in some cases select the program configuration. After installation, program shortcuts will appear in the main PlayOnLinux window, from where they can be launched double click, or by clicking on the "Start" button. You can also create shortcuts to Windows programs on the desktop using the Shortcut button.

Rice. 7. The main PlayOnLinux window with installed Windows program Firefox

Other Wine based programs

There are also paid software products based on Wine. CrossOver allows you to run various versions of Microsoft Office under Linux, Adobe photoshop and many other programs and games. [email protected] aimed mainly at support popular programs for business: 1C: Enterprise, ConsultantPlus, GARANT and others. You can get acquainted with these programs on the official sites: http://www.codeweavers.com/products/ http://etersoft.ru/products/wine

Virtualbox

Virtualbox is one of the most popular virtualization programs that allows you to run various operating systems at the same time on one computer. Installing VirtualBox in Ubuntu it can be done in the standard way by typing in the terminal:

sudo apt-get update

sudo apt-get install dkms

sudo apt-get install virtualbox

You can download VirtualBox for various operating systems here: https://www.virtualbox.org/wiki/Downloads. After the installation is complete, add the user to the vboxusers group, instead of username, you must specify the correct username under which VirtualBox will work:

sudo usermod -a -G vboxusers username

Now you can run the program through the menu, or by typing in the terminal:

virtualbox

Rice. 8. VirtualBox manager with already installed operating systems

Now we will install the operating system, for this you need to have an installation disk or its image. Press the button "Create", the wizard for creating a new virtual machine will start:

Rice. 9. New virtual machine wizard

Press the "Next" button, enter the name of the virtual machine, for example, "Windows XP", and below we select the appropriate type and version of the operating system:

Rice. 10. Choosing the version of the operating system

We chose Windows XP because it is less demanding on computer resources, takes up less space, and boots faster. But support for this system has already been officially discontinued. Naturally, you can install other versions of Windows that VirtualBox supports: Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7, Windows 8, Windows Server 2012. Next, select the amount of RAM that will be allocated to the virtual machine:

Rice. 11. Choice of memory size

The choice depends on the OS version, volume physical memory, scheduled tasks, the number of simultaneously running guest systems. Depending on the version of the operating system, VirtualBox will offer different default parameters, but they are usually minimal, it is advisable to increase them. Anyway, for normal work modern operating systems need at least 1-2 Gigabytes of RAM (for Windows XP, 512 MB is enough) and it is also necessary to leave memory to the main host system. Next, we create a new virtual HDD or select the ones already created earlier.

Rice. 12. Virtual hard disk

On the next screen, select the type of disk, by default the standard VDI.

Rice. 14. Selecting the attributes of the virtual disk

We indicate the size of the disk, leave the location by default (the disk will be located in the folder ~ / VirtualBox VMs / System Name.

Rice. 15. Choosing the location and size of the virtual disk

It remains to click the "Create" button.

Rice. 16. The last stage of creating a new virtual machine

The virtual machine is created. Select it in the VirtualBox manager and click the "Properties" button.

Rice. 17. System selection

Here you can configure the created virtual machine in detail. First of all, you need to specify the disk from which we will install the system. To do this, click on the "Media" on the left, select an empty disk, on the right, click on the disk icon and specify the image of the distribution kit, or check the "Live CD / DVD" box and insert a physical disk.

Rice. 18. Selecting the installation disk

Rice. 19. System settings

If the speed of working with graphics is important, go to the "Display" tab, increase the amount of video memory and enable acceleration.

Rice. 20. Configuring Display Settings

Go back to VirtualBox Manager and press the Start button. Next, we install the system as usual. After installing the guest system, load it and select "Install Guest OS Add-ons" in the "Devices" menu. Alternatively, you can press the key combination right Ctrl + D... After installing the add-ons, the system will be ready to work.

Rice. 21. Installed and ready to work Windows XP system in VirtualBox

The guest operating system is loaded after starting VirtualBox by pressing the "Start" button. Switching the mouse pointer between the main and the guest system is carried out automatically, but you can switch forcibly using the button right Ctrl(Host key - can be changed in settings) and right Ctrl + I... This same button, in combination with various keys, serves a number of functions:

Host key + F- switching to full screen mode and back.

Host key + Del- replaces the combination Ctrl + Alt + Del.

Host key + I- disable mouse integration.

Host key + С- switching to the scaling mode, in which you can set an arbitrary window size, return to standard mode happens using the same key combination.

Host key + D- installation of additions to the guest operating system.

Host key + T- take a picture, save the OS state. It will be possible to restore the system from the saved state in the main window of the VirtualBox manager by clicking on the "Snapshots" button. Very convenient function to fight viruses, test and debug programs that can damage the system. You can always roll back the system to a stable state.

Host key + S- open the settings window.

Host key + R- reboot the system.

Host key + Q- close the virtual machine (log out).

Getting used to new system and customizing it for themselves, every newbie is faced with the problem of choosing applications, and habits and ignorance of alternatives slow down the process of switching to Ubuntu.

As a rule, for any custom Microsoft Windows application, you can find a replacement in the form of a "native" application under Ubuntu, in the previous article (see the release " Open source"# 035, published on 11/21/2008) I tried to mention a variety of applications for full work. And this approach (using "native" Linux counterparts) in most cases will be preferable, since it creates less problems, they are solved faster, and in general it is more pleasant when all applications look and work approximately the same.

If, for one reason or another, it is difficult or impossible to find a replacement for a Windows application (for example, for games), or the existing analogues do not suit you, you can use the capabilities of running Windows applications in the GNU / Linux environment. This can be achieved in several ways.


Virtual machines

One of the popular ways to work with Windows applications on Linux is to use. Like everyone else, it has its own merits and demerits. The first, in addition to simplicity, can be attributed to the ability to run applications in their "native" environment, it is worth making a reservation here. Microsoft Windows in this case will work as a normal application - in a separate window and will be called "guest OS", while the main OS is called "host system" or "host OS", this approach increases the stability of the application itself. Applications running in this case in the guest OS will be isolated from the main OS, and if the guest OS is suddenly infected with a network worm or an unrecoverable failure occurs, this will not affect the host OS in any way. The pluses include the ability to work with "snapshots" of the system, that is, to record current state OS and, if necessary (infected the entire system), restore previous state, and also, the image of the guest operating system created by the wizard can be transferred to any computer and more. The main disadvantages are the need to run an entire operating system, which causes a decrease in the performance of the main OS (since the virtual machine uses a lot of system resources), for a long time launching the application itself (from starting the emulator to the moment the application is opened) and, as contradictory as it may sound, the isolation of the system, which limits the ability to exchange data with the host system.

The essence of the method boils down to the fact that in the emulator program in windowed mode, one of the versions of the operating Windows systems... In this window, you work with the guest OS as with a normal one, install required programs and run them. It turns out that in one window the operating system is running in which the desired application is running.

There are several programs for creating and running virtual machines - including those with a graphical interface, which will be discussed. Consider two applications: VMware Server and VirtualBox. The choice fell on them not by chance - they are similar in many respects: the user interface is made about the same, both are distributed free of charge and have a set of tools for guest operating systems. The chances to play in this case are small, since support for 3D acceleration in guest operating systems is at the initial level.

Virtualbox

It comes in two flavors: open source (Open Source Edition, OSE) and containing proprietary components. In the latter, the functionality is somewhat expanded (for example, the ability to connect a USB device to the guest OS is available only in this version). It can be installed by downloading the deb package for your version of the distribution from the project site (http://download.virtualbox.org/virtualbox/vboxdownload.html#linux). Open Source Edition (OSE) is installed from the repositories as follows (for Ubuntu Linux):

Sudo apt-get install virtualbox-ose

The application allows you to virtualize most versions of Windows, there should be no incompatibility problems.

VMware Server

Closed, but free development of the well-known company VMware, which specializes in software for virtualization. In addition to Server, there are other products, including paid ones (http://www.vmware.com/products/product_index.html). All details about them and download links are available on the company's website.

Despite the similarity of the principles of operation and the capabilities provided, there are differences between VirtualBox and Vmware Server, which are also noticeable to an ordinary user: if the virtual machine window in VirtualBox is separate from the main program window, in VMware Server this is implemented using tabs; setup wizards (working with disks and drives) for VirtualBox are also performed in separate windows; binary packages for Server are usually twice the size, and so on. I advise you to try both options, compare and choose the one you like.

WINE

Unlike virtual machines, WINE does not virtualize anything; it only partially implements the WinAPI functionality, allowing Microsoft Windows applications to run on GNU / Linux. And this software solution has its pros and cons. The disadvantages are quite significant: the guarantee of the launch and operation of the application is lower than when using virtual machines; when WINE moves from version to version, the application may stop working, mainly it concerns applications using third-party dll files, there is no support for 64-bit applications. Among the pluses it is worth mentioning about less loss in performance, system requirements, compared to virtual machines is lower, and integration with the main OS is higher.

Six months ago, after fifteen years of development, WINE was released under the number 1.0.0, the exit criterion for which was stable work Photoshop CS2 and Mircosoft file readers. Over the past time, the program has grown even more and at the moment is the only (apart from virtual machines) link between Microsoft Windows and other operating systems.

Installing WINE on Ubuntu:

Sudo apt-get install wine

After executing this command, all the necessary packages will be downloaded, installed and configured, but it should be borne in mind that the official Ubuntu repositories, as a rule, contain an old version of WINE. To access the latest releases, you need to connect the third-party WINE repository. How to do this is described at http://www.winehq.org/download/deb. Then run the command "sudo apt-get update" and install WINE using the command above. You can configure WINE by running the winecfg command (or from the “Wine” menu in the “Applications” run “Configure Wine”).

There are two ways to launch Microsoft applications Windows: from the console, which is a more flexible way, since it will be possible to specify additional parameters for launch in the line; across graphical interface user. In the first case, you need to do something like this on the command line:

Wine -keys /home/user/program.exe

  • wine is the WINE execution command,
  • -keys - keys that you want to pass to the program for execution,
  • / home / user / - the directory where the program is located,
  • program.exe is a Windows executable file.

After WINE installations Windows executable files can be launched into the system by clicking right key mouse and selecting the menu item "open with" WINE ". If you have installed a Windows program in WINE, it will appear in the newly created special menu"Wine" in "Applications" as shown in the picture.

On the official WINE website there is a special database that displays the performance of a popular Windows application, thanks to which you can find out in advance whether your beloved will work or required program... The web interface to the database is located at http://appdb.winehq.org/

Other developments based on WINE

WINE, like many open projects, has undergone processing and additions on the side. In particular, on its basis, applications were developed that specialize in a particular area.

[email protected]

Paid Russian development aimed primarily at enterprises. The peculiarity lies in the ability to run on Linux systems domestic programs like "1C: Enterprise", which are widely used in the Russian corporate sector. In addition, it is possible to launch client-bank systems and legal systems, as well as some familiar to the average user 2GIS, FineReader, ABBYY Lingvo.

CrossOver

An application designed to provide users with a seamless experience with Microsoft Office. In addition, the launch of some specialized programs is provided: Adobe Dreamweaver MX, Quicken and others. CrossOver includes a friendly configuration utility, application patches. In addition, it offers a paid technical support... Its manufacturer, CodeWeavers, also has a specialized product, CrossOver Linux Games, aimed at launching some popular games (a list of them can be found at http://www.codeweavers.com/compatibility/browse/group/?app_parent=4100). This program is also proprietary and paid, but most of the work is returned to WINE under the terms of the GPL license.

PlayOnLinux

PlayOnLinux (POL) is a fairly young free project aimed at launching Microsoft games Windows in Linux environment. Anyone can participate in its development by writing a plugin or a game installation module. The essence of the project is to create a database of the parameters required to install and run games. You can install the program in Ubuntu like this:

Sudo wget http://playonlinux.botux.net/playonlinux.list -O /etc/apt/sources.list.d/playonlinux.list
sudo apt-get update
sudo apt-get install playonlinux

Cedega

Cedega is originally a commercial but more mature project focused on games. It has been in development for a long time, and in the middle of last December, 7.0 was released. To get it, you need a subscription costing 25 USD for six months. To attract third party developers Cedega lays out a part source texts in SVN, which allows you to get basic functionality is free.

Conclusion

This is the final article in the Ubuntu for Beginners series, and brings you an end to your introduction to the GNU / Linux world. It covers the last aspect of working in Ubuntu that is important in my opinion - running Microsoft Windows applications. I want to reiterate that in most cases the functionality of “native” applications for GNU / Linux is sufficient and this option is preferable. Use WINE as a last resort, trying to eliminate the use of virtual machines altogether.

Leave your comment!

Sooner or later, you may need to run Windows programs on Linux. A huge number of programs have been written for the Linux operating system, to solve one a specific task maybe even several dozen programs. But this trend is observed only for widespread tasks, as for specialized programs and games, then the situation is completely different. There are simply no programs for solving highly specialized tasks, for example, in the same area of ​​SEO for Linux, and games have begun to appear only in the last few years.

There were simple open-source games before, but popular AAA-class games began to appear only when Valve became interested in this platform. But so far, the situation with the games is not as we would like. Therefore, it becomes necessary to install Windows programs in Linux.

Windows programs cannot be launched by simply double clicking on an executable file. Executable format Linux files very different from Windows. Therefore, to run them, you need to use special software - wine. The name Wine is formed with the help of a method popular for some reason in the world of free software - a recursive acronym, and stands for Wine is not emultor. And it's true, wine is not an emulator.

It is a shell program that converts the system calls of Windows programs to function calls of the Linux operating system. Thus, wine is a layer between a Windows program and the Linux operating system, along with its kernel and libraries.

To understand how Wine works, you first need to say a few words about the Windows kernel. Windows, like Linux, has a kernel. As you know, the Linux kernel consists of one file and is located in the boot folder. The Windows kernel is completely different, in fact it is dll set libraries that are located in the C: \ windows \ system32 folder. Therefore, in order to make Windows programs work in Linux, it is enough for us to implement dll libraries that the program needs, so that they call the functions we need from linux systems which is exactly what Wine does. But the project is developing very slowly and the developers do not have time to implement all the functions from system libraries Windows, so not all programs work, especially new ones.

Popular programs in Wine run easily, and without additional settings... But the fact is that there are enough alternatives to solve popular and demanded tasks in Linux, and we will have to run specialized programs and games that require serious components that have not yet been written in Wine. This is where the incompleteness of this program emerges. But there is a way out, and we will consider it further.

Wine basics

All wine program files, installed programs, libraries, registry files, configuration files are located in the home directory, or rather, in ~ / .wine.

Since for different programs, you will need a different architecture of the libraries and you will need to replace it with the original libraries from windows are different files was invented such a possibility as prefixes.

The ~ / .wine folder is a prefix, but we can create for each new program its own prefix and it will only work with it. To set the prefix with which wine needs to work, use the WINEPREFIX environment variable, for example:

export WINEPREFIX = ~ / program

Different programs may require a different system architecture, wine can run 64-bit programs, but many for correct work x86 architecture is needed.

Use the WINEARCH variable to specify the architecture. For example, for x86:

export WINEARCH = win32

Also, do not create a folder for the new prefix using mkdir or the file manager, let the program create this folder by itself on its first launch.

Installing Windows programs in Wine

If you need to run a program that is fully supported by Wine, such as explorer or notepad, just run:

wine address / file / program.exe

But as I said, we will have to run a few such programs, most of them will require functionality that has not yet been implemented in wine. Then we will have to replace the Wine libraries with the original ones. windows libraries... Of course, there are Wine wrappers that automate this process, such as Crossover, PlayOnLinux, WineWizard, etc. But we will consider the manual option.

There is a special tool for installing Windows components in wine - winetricks. It is better to install it from the program website, so the version will be newer:

wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
$ chmod + x winetricks

To install the required component, it is enough to pass the name of this component:

winetricks vcrun2008

It is more or less clear with the installation of the components, but how do you know which components are needed? Most likely, your program has already been tried to install and other users have found a solution to the problem. So use google search in order to find ways to install the program. The appdb.winehq.org site is also very useful. It contains a database of all applications supported in Wine, it contains installation instructions, describes possible problems and gives an overall assessment of the program's work, although everything is in English.

Let's take an example. Type Advego Plagiatus in the appdb search, let me remind you that this is a program for checking the uniqueness of texts, often used by copywriters:

She was immediately found in the database:

On the program page, we see, in addition to a screenshot and an evaluation of the work, yellow means gold, very good, and instructions for installing it, in our case we need a set of riched30 libraries, which can be installed with the command:

winetriks riched30

After installing this package, the program will start and will work.

But the question remains, what to do if there are no instructions, there is a minimum of information, but the program needs to work. We can parse the Wine output when the program starts. Moreover, we will not be interested in all messages from the program log, but only in the last ones, exactly what caused the error.

Consider the example of the same Advego Plagiatus. First, let's create a new prefix so as not to spoil what has already been installed:

export WINEPREFIX = ~ / advego

We don't need to change the architecture, but if you want, you can explicitly indicate that you need to use win64:

fixme: richedit: ITextRange_fnEndOf (0xa04410) -> (6 0 (nil)): stub
fixme: richedit: ITextRange_fnEndOf (0xa04410) -> (6 0 (nil)): stub
fixme: richedit: ITextRange_fnEndOf (0xa04410) -> (6 0 (nil)): stub

It remains to understand what richedit is, and Microsoft TechNet kindly informs us that this is their API and it consists of Riched32.dll, this is the latest version, but before it was riched20.dll, do you already understand what libraries are needed?

We know how to install them using winetricks, but this is optional, you can also manually. Download libraries, it won't be difficult to find them with using google... Just look for the Windows XP version.

Copy the library to our prefix, to the syswow64 folder:

cp ~ / Downloads / riched32.dll ~ / advego / drive_c / windows / syswow64 /

cp ~ / Downloads / riched20.dll ~ / advego / drive_c / windows / syswow64 /

For 32-bit libraries, the system32 folder is used, and since we indicated the 64-bit architecture, you need to use the appropriate libraries as well. Then run winecfg and on the library tab, in the new replacement for the library type * riched32, then add and * riched20 and add again:

That's it, now you can try to run the program:

wine ~ / advego / drive_c / Program \ Files \ \ (x86 \) / Advego \ Plagiatus / plagiatus.exe

Now the program works and no longer crashes. This way you can replace many Wine libraries. You can run almost any program that was written several years ago and does not require super new technologies. You just need to replace the required libraries. You can not only use winetricks or copy libraries from the Internet, but also take them directly from Windows. It is definitely not worth replacing gdi32.dll, kernel32.dll, and user32.dll - these libraries implement the functions of the Windows kernel at the lowest level, and if you replace them, it will only break Wine. There are probably other libraries that cannot be replaced, but this is calculated only through experimentation. Experiment and let your programs run without errors!

Top related articles