How to use wine

How to use wine

Основы работы с Wine для начинающих

Введение

Статья посвящена Wine и всем аспектам его использования. В сети находится очень
много информации, есть различные руководства по настройке и многое другое. Я
постараюсь объединить все для того чтобы любой человек смог достичь
максимального успеха, в пределах своих способностей и конечно возможности
программы. Итак — начнем.

Wine — это отдельная реализация Windows API, а не эмулятор, как большинство
думают. Не единожды повторялось, но и здесь будет уместно. Это и делает проект
уникальным и интересным для пользователей различных систем, открывает различные
пути для реализации своих идей. Уникальность заключается в том, что с помощью
этой программы можно запускать Windows приложения в Ubuntu и в других
Linux системах, а также во FreeBSD и в Mac OS X. Правда и тут есть
свои «подводные камни». Некоторые думают что будет легко перейти с одной
системы на другую, в данном случае мы рассматриваем Windows и Linux.

Заблуждение заключается в том что люди думают что у них получиться запустить из
под Wine различный софт, к которому они привыкли и им удобно в нем работать.
Как не крути просто так ничего не бывает. Чтобы заработал наш любимый софт под
Wine нужно попотеть, перечитать кучу руководств и взвесить этот объём
информация. Конечно не совсем софтом придется «пыжиться», но готовым надо быть ко всему. Проект Wine развивается очень быстро, но до стабильной работы ему
очень далеко. Но думаю что в скором будущем весь основной софт, а также игры
будут работать на нем стабильно.

Установка Wine

Первый вопрос человека который только что перешёл на Linux (в нашем случае
Ubuntu): «Как я буду запускать программы из Windows?». Он начинает поиск на эту
тему и естественно натыкается на Wine.
Второй вопрос: «Как его поставить?». Есть два способа: Поставить из
официальных репозиториев или скомпилировать самому из исходников. Мы рассмотрим
оба варианта.

Вариант 1: Установка из репозитория.

Тут все очень просто. Идем в Приложения // Стандартные // Терминал:

sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.3

Ждем завершения установки…
Всё! Wine установлен и можно пробовать устанавливать игры и программы.

Вариант 2: Компилирование из исходников.

1.Скачиваем исходники с официального сайта, там они присутствуют. В моё случае
это Wine 1.3.11 (http://sourceforge.net/projects/wine/files/Source/wine-1.3.11.tar.bz2/download).

2. Распаковываем исходники.
Дальше вводим в терминале следующие команды:

переходим в директорию, в которую был распакован архив с исходными текстами:

Перед компиляцией надо включить поддержку OpenGL. Если мы этого не сделаем
приложения которым нужен OpenGL работать не будут. В терминале:

Находим строку, начинающуюся с CONFARGS=, и после вписываем в нее нужные
параметры сборки. В нашем случае строка будет выглядеть так:

Устанавливаем через создание пакета, вместо make install

Всё. Ждем окончания установки.

Есть ещё промежуточный вариант, для джедаев на debian-based дистрибутивов. Кратко:

apt-get source wine1.3
sudo apt-get build-dep

Теперь самое интересное: скачиваем нужную версию wine с официального сайта, распаковываем, и копируем туда директорию debian из директории с исходниками оригинального пакета wine1.3. Делаем

и у нас появляется *.deb пакет для убунты/дебиана со всеми нужными патчами для дистрибутива, почти как из официального репозитория, но только новая версия. К тому же её ещё потом можно спокойно удалить так же через apt-get.
Рассмотрим плюсы и минусы каждого из вариантов.

Вариант 1.
Плюсы:
1. За нас уже все собрано и пыжиться не надо, все уже готово к употреблению.

Минусы:
1. Мы не сможем применить патч, например для улучшения работы какой нибудь игрушки.
2. Не стабильная работа на некоторых видеокартах.

Вариант 2.
Плюсы:
1. Возможность применить патчи для улучшения работы
2. Стабильная работа с не стабильными драйверами видеокарт.

Минусы:
1. Нет меню в Приложениях, что не удобно. Приходиться все делать из консоли,
выходить в настройки Wine например.
2. Процесс установки слишком долгий, зависит от мощности вашего компьютера.
1. Нет меню в Приложениях, что не удобно. Приходиться все делать из консоли, выходить в настройки Wine например.»

Можно самому добавить через Система — Параметры — Главное меню

Я отдаю предпочтение второму варианту. Wine установленный таким образом работает
лучше, чем установленный из репозиториев. Но это лишь мое маленькое ИМХО.

Установка программ и игр

Сперва мы идем на appdb.winehq.org Сверху, в поисковике вбиваем
название игры или программы и смотрим что там написано. Обычно там описаны
тесты на различных системах, рекомендации для стабильной работы и многое другое.

Если программа работает без проблем, значит с чистой душой её устанавливаем
простым кликом. Если это какая нибудь серьёзная игра или программа и без
шаманства с бубном не обойтись — значит надо создавать отдельный префикс* для
наших танцев. * Все файлы вайна хранятся в префиксе, или ещё называемом бутылкой (по анологии с вином/wine). Там внутри этой бутылки имеются все файлы диска C, реестр, индивидуальные настройки и так далее.

Таких бутылок может быть сколько угодно.

Просто может быть какой-то софт, который ведёт себя очень капризно под вайном и для него нужны какие-то костыли, которые будут мешать нормальной работе других приложений вайна. Тогда просто этот софт ставим в отдельную бутылку (префикс) и любые настройки не будут влиять на другие программы.

Когда вайн запускается в первый раз без указанного префикса, используется

Всё. Отдельный префикс создан. Там хранятся различные конфигурации реестра и сами программы.
Установку программы также производим через консоль.

WINEPREFIX=»/home/username/.wine2/» wine /media/DVD/setup.exe

Идет процесс установки и самое главное в отдельный префикс.
Потом мы запускаем уже установленную программу, также из консоли и смотрим вывод.

В выводе могут быть ошибки, о том что нет нужных компонентов и библиотек. В
установке недостающих компонентов нам поможет winetricks (см. ниже)

Что это дает? Это дает стабильную работу приложений в своем префиксе, если
масса программ будет работать в одной префиксе, он рано или поздно засориться
что приведет к сбою других программ. Поэтому нужно использовать отдельные
префиксы, если не хотите все настраивать по много раз.

Winetricks

В правильной настройке префикса нам поможет winetricks.
Winetricks — это скрипт, который устанавливает различные компоненты, которые
требуются для работы приложения, например DirectX, Vcredist и многое другое.
Как это скрипт работает? Он скачивает библиотеки и компоненты с
Microsoft-овских ресурсов. Именно так, и не как по другому. Зачем этот скрипт
нужен? Это очень упрощает работу с Wine-ом. Без скрипта мы бы сами лазили и
искали нужные компоненты, а тут уже все сделано, надо только поставить галочку
и нажать «Установить» Также этот скрипт помогает редактировать реестр,
вписывать туда различные ключи. И помимо этого в winetricks есть много настроек
и функций.

Для ознакомления с ним просто введите в терминале winetricks

Редактирование реестра

В терминале вводим:

Мы в реестре. Редактировать нам ничего не надо, мы будет только добавлять.

Идем в HKEY_CURRENT_USER/Software/Wine/Direct3D.

Если каталога Direct3D нет, то не отчаиваемся. Я это пишу чтобы читатель понял
где-то надо редактировать или добавлять.

winetricks ddr=opengl orm=fbo glsl=disabled videomemorysize=1024
(1024 меняете на свое)

Все эти параметры появиться в реестре. Это можно посмотреть в папке указанной выше.

Что это дает? Это улучшает производительность в играх, скорость и вообще игры
работают от этого лучше, но это только для игр.

PlayOnLinux

Также существует PlayOnLinux. Это отдельная программа, которая использует Wine,
но там более все автоматизированно и настроено. Программа сама скачает нужный
Wine, установит компоненты и создаст отдельный префикс. Но это не значит что
все будет идеально работать. Может вообще не работать. Так что я отдаю свое
предпочтение обычному Wine, ручной настройке и работе собственного мозга, а не
автоматизированной программе.

Плюсы:
Все автоматизированно и нам по сути делать ничего не надо.
Можно держать несколько версий Wine и применять их для различных префиксов.
Программа сама создает префиксы.

Минусы:
Все что делает программа, устанавливает и скачивает предугадать невозможно.
Все что делает программа можно сделать самому, ручками, это + к знаниям человека.
Программа «Робот» никогда не сравнится с человеческим мозгом.

Монтирование образов CD/DVD-дисков

В Windows есть для этого утилита под названием Daemon-Tools. Это очень удобная
и не заменимая утилита. У человека возникает вопрос: Есть ли аналог этой
чудо-утилиты? Ответ: Есть и на много лучше Windows утилиты. Называется она
Cdemu. Для её установки нам требуется ввести всего лишь три команды:

sudo add-apt-repository ppa:cdemu/ppa
sudo apt-get update
sudo apt-get install cdemu-daemon cdemu-client gcdemu

Добавляем аплет на панель, указываем путь к образу и радуемся жизни. Не каких
проблем не будет и Wine будет отлично определять образ. Если аплета не находим не торопитесь перезагружаться.
В терминале вводим команды:

sudo service cdemu-daemon start

Если сервис не стартует при старте системы («The daemon is configured not to start at system startup»), можно исправить так:

sudo update-rc.d cdemu-daemon enable

Запуск игр в отдельном Х-сервере

Этому можно посветить целую книгу, но я остановился на одном способе, которым всегда пользуюсь:

Переходим в виртуальный терминал:

Ctrl + Alt + F1
login: ******
password: ******

Запускаем вручную новую копию X-сервера:

Прирост от этого не большой, но лично мне этого хватает. Ещё раз повторю:
способов запуска в отдельном х-сервере много и каждый человек волен сам выбирать.

Заключение

Все эти советы, азы, которые должен знать каждый человек который хочет
использовать Wine для достижения своих целей. Все остальное в ваших руках. Если
вы хотите достичь цели не смотря ни на что, а надежда уже уходит, не
отчаивайтесь никогда, ибо решение может находиться у вас «перед носом». Усидеть
на двух стульях возможно, но для этого нужно желание и стальные нервы. Желание
— тысяча возможностей, не желание — тысяча причин.

How To Run Windows Applications On Linux [Beginners Guide]

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

As you’re here, I’m going to assume that you’re a Linux user. And every once in a while, you find yourself asking: can I run windows applications on Linux?.

Answer to that question is yes. Yes, you can run Windows applications in Linux. Here are some of the ways for running Windows programs with Linux :

Both of them works just fine. But they are somewhat resource hungry.

If you only need to use a small Windows application, installing Windows on a separate HDD partition or as a Virtual Machine is not efficient. Moreover, Virtual Machine can’t utilize the total power of your machine. So, what is the solution?

No worries, there is another way to use Windows software on Linux. It’s called Wine. If you aren’t yet familiar with it or you are a beginner in the world of Linux, this article is for you.

In this beginner’s guide, I’ll show you what is Wine and how to use it to run Windows software on Linux. I have used Ubuntu here as Ubuntu is one of the best Linux distros for beginners, but any other Linux distribution will have more or less same steps (except for the commands in Arch or Fedora based distros).

Using Wine to run Windows programs in Linux

Wine stands for Wine Is Not an Emulator. And WINE is actually an acronym for that. And as previously stated, it’s not even a virtual machine.

Rather it is a compatibility layer for running Windows applications on UNIX-like or POSIX-compliant operating systems (e.g. Linux, Mac, BSD). While a virtual machine or emulator simulates internal Windows logic, Wine translates those Windows logic to native UNIX/POSIX-complaint logic.

In simple and non-technical words, Wine converts internal Windows commands to commands your Linux system can natively understand.

[irp posts = “9653”]

Installing Wine

There are various ways to install Wine on your system. As this is a beginners’ guide, I’ll describe the most straightforward one here.

Almost all the Linux distros come with Wine in their package repository. Most of the time the latest stable version of Wine is available via package repository. Installing Wine on Ubuntu is as easy as firing up a terminal and running these commands:

However, if you are using an 64bit installation of Ubuntu, you will need to run these additional commands:

This will add 32bit architecture support on your distro which will benefit you in installing specific software. If you don’t know whether you have a 32bit installation or 64bit, check this article: 32bit or 64bit Ubuntu?

What Windows applications are Supported by Wine?

There is a large number of Windows applications that are currently fully supported by Wine. They will run without any hassle.

However, new Windows applications are being developed every day. Many of them wouldn’t function as we want on Wine. But the development pace of Wine is also rapid, support for new applications is being added all the time.

And there is a dedicated database for keeping track of just that.

Wine Application Database has almost 24,000 applications rated with different status depending upon how well that applications run in Wine. If you want to quickly check the rating of the application you want to use in Wine, you can take a look there. Here are the meaning of those ratings:

Reviews, Installation Procedure, which Wine version it was tested against and various useful data are also available for each application here.

Of course, Wine Application Database is mostly user-generated data, so you are always welcome to try running an application with a different version of Wine and share your result with rest of the community.

Finding an Application in Wine Application Database

Let’s see how we can find an application in Wine Application Database.

Go to Wine Application Database. Click Browse Apps from the left sidebar.

Finding an App in Wine AppDB

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-1-300×144.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-1.png» src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-1.jpg» alt=»Finding an App in Wine AppDB» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-1.jpg?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Finding an App in Wine AppDB

Write the name of the application you want to find in the Name field.

Wine AppDB name filter

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-2-300×113.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-2.png» width=»900″ height=»340″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-2.png» alt=»Wine AppDB name filter» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-2.png 900w, https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-2-300×113.png 300w, https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-2-768×290.png 768w» data-lazy-sizes=»(max-width: 900px) 100vw, 900px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-2.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Wine AppDB name filter

Click on the link to the application from the search result.

You’ll see a description of the application. There will be a list of various versions with their compatibility rating with a specific Wine version.

Wine AppDB Application page

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-3-300×145.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-3-1024×493.png» width=»1024″ height=»493″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-3-1024×493.png» alt=»Wine AppDB Application page» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-3-1024×493.png 1024w, https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-3-300×145.png 300w, https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-3-768×370.png 768w, https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-3.png 1102w» data-lazy-sizes=»(max-width: 1024px) 100vw, 1024px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-3-1024×493.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Wine AppDB Application page

Let’s click on the latest version link.

This is the main page you need to check. There will be detailed information about that specific version.

Detailed Information about Application

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-4-300×213.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-4-1024×725.png» width=»1024″ height=»725″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-4-1024×725.png» alt=»Detailed Information about Application» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-4-1024×725.png 1024w, https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-4-300×213.png 300w, https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-4-768×544.png 768w, https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-4.png 1111w» data-lazy-sizes=»(max-width: 1024px) 100vw, 1024px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-appdb-4-1024×725.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Detailed Information about Application

You’ll get an idea of what will work and what will not. Also, the installation procedure will be included here if any additional tasks are needed for installation.

Getting Started with Wine

Before we go on installing and running applications in Wine, we should have clear idea about a few things and about how to configure Wine for usage:

WinePrefix

Windows applications need a C: drive. Wine uses a virtual C: drive for this purpose. The directory of this virtual C: drive is called wineprefix. First of all, we need to create a wineprefix. For doing that, fire up a terminal and enter this command:

This will create a wineprefix and open the configuration window for Wine. You can change the configuration options if you want or let it be as is for time being and close it. Now, you can locate the virtual C: drive at

WinePrefix C: Drive

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine_drive_c-300×207.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine_drive_c.png» width=»800″ height=»552″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine_drive_c.png» alt=»WinePrefix C: Drive» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine_drive_c.png 800w, https://itsfoss.com/wp-content/uploads/2016/08/wine_drive_c-300×207.png 300w, https://itsfoss.com/wp-content/uploads/2016/08/wine_drive_c-768×530.png 768w» data-lazy-sizes=»(max-width: 800px) 100vw, 800px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine_drive_c.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> WinePrefix C: Drive

The general rule is to install each new application into a fresh wineprefix. We can create and maintain multiple wineprefix manually. But that task would seem rather tedious for the beginners. So, we will skip that part for now. But, later I’m going to show the way for doing that part with ease.

Installing an Application with Wine

Installing a supported application in Wine is generally as easy as double-clicking on the installation file. However, we are now going to see a step-by-step guide for installing 7-zip on Wine.

First of all, check for 7-zip rating on Wine Application Database. It has Platinum rating, so we are good to go. Open Wine configuration ( winecfg ) and set the Windows Version to Windows 7.

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/winecfg-win7-260×300.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/winecfg-win7.png» width=»412″ height=»475″ src=»https://itsfoss.com/wp-content/uploads/2016/08/winecfg-win7.png» alt=»Wine Windows 7″ data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/winecfg-win7.png 412w, https://itsfoss.com/wp-content/uploads/2016/08/winecfg-win7-260×300.png 260w, https://itsfoss.com/wp-content/uploads/2016/08/winecfg-win7-300×346.png 300w» data-lazy-sizes=»(max-width: 412px) 100vw, 412px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/winecfg-win7.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Wine Windows 7

Right-click on the 7-zip installation file and select Open With Wine Windows Program Loader.

7-zip Installation File

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-1-300×207.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-1.png» src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-1.jpg» alt=»7-zip Installation File» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-1.jpg?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> 7-zip Installation File

See that destination folder path? 7-zip installation has recognized the virtual C: drive from wineprefix.

7zip Setup Directory on Wine

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-2-300×210.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-2.png» width=»302″ height=»211″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-2.png» alt=»7zip Setup Directory on Wine» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-2.png 302w, https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-2-300×210.png 300w» data-lazy-sizes=»(max-width: 302px) 100vw, 302px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-2.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> 7-zip Setup Directory on Wine

Finish the installation and go to the installation directory [ $HOME/.wine/drive_c/Program Files/7-zip/ ] from the file browser.

Right-click on 7zFM.exe and go to Properties > Open With.

Select Wine Windows Program Loader and close the window. Double-click on 7zFM.exe.

» data-image-caption data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-4-300×198.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-4.png» width=»594″ height=»392″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-4.png» alt=»7-zip running with Wine» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-4.png 594w, https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-4-300×198.png 300w» data-lazy-sizes=»(max-width: 594px) 100vw, 594px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-4.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> 7-zip running with Wine

And there you go! For creating a shortcut on your desktop, right click on the file.

Creating 7-zip shortcut

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-5-300×207.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-5.png» width=»802″ height=»553″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-5.png» alt=»Creating 7-zip shortcut» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-5.png 802w, https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-5-300×207.png 300w, https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-5-768×530.png 768w» data-lazy-sizes=»(max-width: 802px) 100vw, 802px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-5.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Creating 7-zip shortcut

Now move the Link to Desktop.

Move shortcut to Desktop

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-6-300×236.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-6.png» width=»801″ height=»629″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-6.png» alt=»Move shortcut to Desktop» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-6.png 801w, https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-6-300×236.png 300w, https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-6-768×603.png 768w» data-lazy-sizes=»(max-width: 801px) 100vw, 801px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-6.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Move shortcut to Desktop

Now, you can run 7-zip just from your desktop. All you have to do is double-click on the icon.

Run 7zip from desktop

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-7-300×225.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-7.png» width=»800″ height=»600″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-7.png» alt=»Run 7zip from desktop» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-7.png 800w, https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-7-300×225.png 300w, https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-7-768×576.png 768w» data-lazy-sizes=»(max-width: 800px) 100vw, 800px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-7.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Run 7-zip from desktop

If you want to access your files on Linux, they are generally located in Z: Drive.

Linux directory in Z: drive

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-8-300×198.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-8.png» width=»594″ height=»392″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-8.png» alt=»Linux directory in Z: drive» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-8.png 594w, https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-8-300×198.png 300w» data-lazy-sizes=»(max-width: 594px) 100vw, 594px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-7zip-8.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Linux directory in Z: drive

You can use the 7-zip just as you would use it on Windows – for extracting and creating archives and such.

Let’s make things (a lot) Easier

You might have noticed that, at Wine Application Database, with every version of application review a specific Wine version is mentioned.

It is because of the rapid development rate of Wine. Though an application runs with the current version of Wine, it might not run with a future version, because of the changes made.

Also, I’ve mentioned about installing each application in its own fresh wineprefix. So that, an application has no chance of interfering with another. And doing all these manually, usually from the terminal, is time-consuming, tiresome and at times, confusing.

PlayOnLinux is here to rescue. It provides a nice interface for doing all these things easily. For installing PlayOnLinux on Ubuntu, simply run this command:

» data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-PlayOnLinux-1-300×218.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/wine-PlayOnLinux-1.png» width=»611″ height=»444″ src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-PlayOnLinux-1.png» alt=»PlayOnLinux interface» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/wine-PlayOnLinux-1.png 611w, https://itsfoss.com/wp-content/uploads/2016/08/wine-PlayOnLinux-1-300×218.png 300w» data-lazy-sizes=»(max-width: 611px) 100vw, 611px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/wine-PlayOnLinux-1.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> PlayOnLinux interface

You can easily perform every task related to Wine with PlayOnLinux from a beautiful and intuitive graphical interface:

But still, you will need to check Wine Application Database for reviews, installation procedures and such.

Advantages of using Wine

When it comes to running Windows applications on Linux system, Wine provides many advantages over using emulators or virtual machines.

Wine can be thought of as a Windows emulator in much the same way that Windows Vista can be thought of as a Windows XP emulator: both allow you to run the same applications by translating system calls in much the same way. Setting Wine to mimic Windows XP is not much different from setting Vista to launch an application in XP compatibility mode.

Wine Derivatives

There are quite a number of projects for running Windows applications on other platforms, based on Wine:

Additional Tips on using Wine

Winetricks

This is another important part of using Wine. Winetricks is a helper script to download and install various redistributable runtime libraries needed to run some applications in Wine. These may include replacements for components of Wine using closed source libraries. Winetricks comes with Wine installation on Ubuntu.

For starting winetricks, run this command:

» data-image-caption data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/winetricks-300×269.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/winetricks.png» width=»537″ height=»481″ src=»https://itsfoss.com/wp-content/uploads/2016/08/winetricks.png» alt=»Winetricks» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/winetricks.png 537w, https://itsfoss.com/wp-content/uploads/2016/08/winetricks-300×269.png 300w» data-lazy-sizes=»(max-width: 537px) 100vw, 537px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/winetricks.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Winetricks

There are many options for helping you with various tasks.

Installing an Application with Winetricks

If you Install an app from winetricks, it will be installed in a separate wineprefix. Let’s install VLC:

Winetricks – Install an app

Winetricks – Install VLC

It will then begin to download the VLC installation files. And then guide you through the rest of the process. It’s pretty simple.

Install Windows DLL or components and others

You can select a wineprefix from winetricks and install various libraries and components required by the application you want to run and also perform other operations.

» data-image-caption data-medium-file=»https://itsfoss.com/wp-content/uploads/2016/08/winetricks_scripts-300×267.png» data-large-file=»https://itsfoss.com/wp-content/uploads/2016/08/winetricks_scripts.png» width=»522″ height=»464″ src=»https://itsfoss.com/wp-content/uploads/2016/08/winetricks_scripts.png» alt=»Winetricks Scripts» data-lazy-srcset=»https://itsfoss.com/wp-content/uploads/2016/08/winetricks_scripts.png 522w, https://itsfoss.com/wp-content/uploads/2016/08/winetricks_scripts-300×267.png 300w» data-lazy-sizes=»(max-width: 522px) 100vw, 522px» data-lazy-src=»https://itsfoss.com/wp-content/uploads/2016/08/winetricks_scripts.png?is-pending-load=1″ srcset=»data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7″> Winetricks Scripts

Winetricks Libraries & Components

N.B.: If using winetricks seems complicated to you, it’s perfectly okay. I feel the same way too. I always use PlayOnLinux for this reason. PlayOnLinux can do everything you might need to do from winetricks.

For more information you can check Wine FAQ and Documentation.

I hope you find this complete beginner’s guide to using Wine in Linux helpful. Now you can run Windows programs in Linux without installing a virtual machine or dual booting.

Let us know if you have any questions or opinion in the comment section below.

Munif is studying Electronics & Telecommunication Engineering. He loves Open Source and uses Ubuntu as his primary OS. Technology aside, Munif is a TV Series freak and sometimes tries to do some creative writing.

Classic SysAdmin: How to Install and Use Wine to Run Windows Applications on Linux

This is a classic article written by Jack Wallen from the Linux.com archives. For more great SysAdmin tips and techniques check out our Essentials of Linux System Administration course!

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Back in the mid 90s and early 00s, Linux, being a fledgling operating system, suffered from a severe lack of useful applications. This issue was especially critical in the world of business ─ where Windows desktop applications could make or break productivity. To overcome this weakness, a compatibility layer called WINE was created. The name originally stood for Wine Is Not an Emulator (because everyone mistook the tool for a Windows emulator). The name is now simply Wine.

Effectively, what Wine did was to allow Windows applications to run on the Linux platform. It wasn’t perfect, and the supported apps were limited. If you wanted Notepad, Calculator, or Solitaire…you were good to go.

But then something interesting happened. Over time more and more applications were supported until Wine became a must-have tool for many users and businesses (and especially Linux gamers). To date there are thousands of fully supported applications that now run on Wine (check out the application database for a full list) and that list is ever growing. Granted most of the Wine work is focused on games, but you’ll still find a healthy list of productivity apps available.

You might think, because of the complexity of bringing such a tool to life, that Wine would be complicated to install and use. That assumption would be incorrect. In fact, the developers of Wine have gone out of their way to make the compatibility layer as user-friendly as possible. What exactly does that mean? To make this easier, let’s walk through the process of installing Wine and then installing and running a Windows application with the tool.

I will demonstrate the process on Elementary OS Freya and install the latest version of Wine.

Installation

If you are running an Ubuntu derivative, you’ll find Wine located in the Software Center. Chances are, however, that version is outdated. Because of that, we want to avoid installing the “out of the box” version offered. To do this, we must add the official Wine repository. This can be done one of two ways, via command line or GUI. Since our goal is running Windows applications, let’s use the GUI method.

Click on the Applications menu

Click Software & Updates

Click on the Other Software tab

Enter ppa:ubuntu-wine/ppa in the APT line section (Figure 2)

Click Add Source

Enter your sudo password

When prompted, click Reload

Open the Software Center

Search for Wine

Click the Wine entry and then click Install

Allow the installation to complete.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

That’s it. Wine is now ready to help you install and run Windows applications. Remember, however, that not every application will work. Most will, but if you’re looking to get your in-house, proprietary solution up and running, you might hit a few snags.

Installing and running an app

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Upon first run, the Wine configuration for

/.wine will be updated. This can, depending upon the speed of your machine, take a bit of time. Allow this to finish and then the all-too-familiar Windows installation wizard will start up and walk you through the installation of Notepad++.

Click Next and walk through the installation process. When the second screen pops up (Figure 4), you will notice a rather un-Linux Folder path.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Linux doesn’t contain a C drive as does Windows. Is this wrong? No. If you look in the

/.wine folder, you will notice a folder called drive_c. Within that folder lies three familiar sub-folders:

As you might expect, this is your C drive. All of that is to say, leave the Folder path as-is during installation.

You will eventually come to the Choose Components section of the installation (Figure 5). Here you can select options for the installation. If your particular desktop environment allows desktop icons (and that is your preference for launching apps), you might want to select Create Shortcut on Desktop (to make the launching of the newly installed app easier—more on this in a moment).

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

The installation will complete and present you with the Finish screen. Leave the Run Notepad box checked and click Finish. Notepad++ will run (Figure 1).

What happens, if you didn’t add the app icon to your desktop, when you want to run the software again? This is one issue that can easily trip users up. Remember that Program Files sub-directory? If you venture into that folder, you’ll see a folder for Notepad++ which contains the notepad++.exe file. Guess what? Right-click that file, select Open in Wine Windows Program Loader, and Notepad++ will run.

Notepad++ is a simple example of how Wine works. When you dive into more complicated applications, your results may vary. The best thing to do is to go back to the Wine application database, locate the app you want to install, click on it, and check the current app status. You will find every app lists the version of Wine tested, if it installs, if it runs, and gives it a rating. There are:

Platinum: Applications which run flawlessly out of the box.

Gold: Applications which run with some modifications necessary.

Silver: Applications which run with minor issues that do not affect usage.

You will also find some apps listed as Garbage, which means they won’t install and/or run.

If you have a Windows app that simply doesn’t have a Linux equivalent, never fear ─ Wine is here to assist you. Even though not every Windows app will run under Wine, the collection of apps that do is seriously impressive. And considering most everything we do nowadays is handled within a web browser, with a little help from Wine, you should be covered from every angle.

Ready to continue your Linux journey? Check out our Essentials of Linux System Administration course!

Ethical hacking and penetration testing

InfoSec, IT, Kali Linux, BlackArch

The complete guide to Wine: from installation to advanced usage

Table of contents

Why Wine

This guide will tell you about using Wine. These usage tips apply to both Kali Linux and any other Linux distribution.

With Wine, you can run Windows programs directly on Linux without using virtual machines. If we talk about Kali Linux, then one of the interesting examples is the Router Scan by Stas’M program, which works fine through Wine (finds and hacks routers, but functions related to using a Wi-Fi adapter do not work).

So, Wine is a set of programs and libraries that allow you to run Windows applications on Linux without using virtualization. Of course, Windows programs can be run on Linux using VirtualBox, but this option will require the launch of a full-fledged operating system with the corresponding resource costs, especially RAM – Windows requires several gigabytes of memory to run, as well as disk space for installation – several tens of gigabytes. However, an important requirement for running VirtualBox and similar virtual machines is that your CPU supports virtualization.

Wine allows you to bypass all these limitations – you do not need to install this operating system to run Windows programs, and applications require only a few tens of megabytes of RAM to run.

But Wine also has disadvantages – not all applications work well or work at all. However, a huge number of Windows programs run and work just fine on Linux thanks to Wine.

Before trying to install and run a program through Wine, look for it using your package manager, for example:

Features and limitations of Wine

The program is able to run 64-bit, 32-bit, 16-bit programs and libraries of Windows 9x/NT/2000/XP/Vista/7/8/10/11 and Windows 3.x

Win32 API support:

Allows Windows program to interface with:

As you can see, the list is impressive and allows you to, for example, run games that require DirectX and still output sound. Applications from Wine can work with the network and even have access to some hardware features (printers, scanners).

If the application requires additional libraries, for example, Visual C++ Redistributable for Visual Studio, then it is possible to install them in Wine and run the application in an environment with this library installed.

At the same time, you need to remember such a limitation as the inability to work with devices directly, for example, if a device requires a driver, then it makes no sense to install a Windows driver in Wine – you need to find the Linux version of the driver and install it.

64-bit or 32-bit Wine?

In this guide for installing Wine, we will enable repositories support for 32-bit platforms (i386) in order to download the necessary libraries. The question may arise, is there a 64-bit Wine, and if it exists, why do we need to enable repositories for i386 and download the 32-bit version?

Yes. 64-bit Wine has been available on Linux since version 1.2. WineHQ binary packages are available for 64-bit versions and most major distributions package them for users. Generally, installation should be as simple as installing the Wine package for your distribution through the package manager.

But there are a few very important notes:

The main thing that follows from this is that even when installing 64-bit Wine, you need to activate 32-bit repositories, since many Windows applications are still 32-bit and in any case you need to install 32-bit libraries, otherwise many programs just will not work.

You can explicitly select the wine64 package during installation, but even if you install “wine”, it will be the 64-bit version if you run a 64-bit Linux.

How to install Wine

Installing Wine on Debian, Kali Linux, Linux Mint, Ubuntu, and their derivatives

Run the following commands:

After installation, start Wine – it may offer to download the necessary fonts and other components:

To check the Wine version run the command:

Installing Wine on Arch Linux

Open the /etc/pacman.conf text file:

In it, find and uncomment the lines (be sure to uncomment both lines, otherwise the changes will not take effect):

Update package cache:

How to run a program in Wine

Launch by double clicking on the executable file

To launch Windows applications on Linux, it is usually enough to double-click on them. But it may be that the .exe file will be opened by an archive manager or another application (usually an archive manager).

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

In this case, right-click on the file, select “Open with” and select “Wine”.

If you do not have Wine in the context menu, then do this:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

On Ubuntu (GNOME 3) Wine is missing from the context menu and it is not possible to add a custom command. To fix, do the following:

If you encounter an error that the wine.desktop file is missing, then find it with the following command and edit the above command:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Then select “View All Application”.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Click on “Wine Windows Program Loader” and then click on the “Select” button.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Pay attention to how economically the RAM is used – only 1 megabyte of RAM is needed to run Router Scan by Stas’M in Kali Linux. If we installed Windows in a virtual machine to run this program, it would take several gigabytes for the OS to work. In addition, when using Wine, it is not necessary that the processor supports virtualization – unlike VirtualBox and other similar ways to run virtual computers.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Run on command line

Using wine start

In some cases, you may need to specify the full path to the executable. For example, if you need to install a program from multiple CDs, entering a directory in the terminal will prevent you from ejecting the CD.

You can give Wine a DOS or Windows style path in single quotes, like so:

You can also use double quotes, but you need two backslashes instead of one:

If you prefer to use a Unix-style path, use the /unix option to start, like so:

Passing Windows Command Line Arguments

If you are using a program with arguments on Windows, for example:

Then you can do the same in Wine by running:

That is, the command line is identical except for wine in front of it. Note, however, that you may need to escape some special characters with a backslash due to how they are handled in the Linux shell. For example:

MSI files cannot be run directly; you need to either use the Wine program msiexec or run Wine from a terminal:

Wine Explorer style graphical environment (Wine File Manager)

If you prefer to use a GUI to manage your files, you might want to consider using winefile. This Winelib application comes with Wine and can be found with other Wine programs. This is a useful way to view your disk configuration and find files, and you can also run programs directly from Winefile. Please note that many features are not implemented yet.

How to set up Favorites in Wine File Manager and add folders

Wine File Manager is similar to Windows Explorer. It can be opened with the command

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

There you can see several labels and drives.

Among the labels you will find:

My Computer contains all disks connected to Linux. The “C:” drive is what is located in the

/.wine/drive_c/ folder. The “Z:” drive is the root drive of the Linux file system. Other letters are flash drives and disks plugged to Linux.

The root element of shortcuts is Desktop, that is, the desktop. This refers to the Linux desktop, not Windows.

That is, if you want a new folder to be visible in the Wine File Manager, then create it on your Linux desktop, for example:

You can copy any files to this folder for quick access.

You can also create shortcuts in this folder to files and programs both in the Wine file system and outside it.

Command to create a shortcut:

For example, the following command will create a link to

/.wine/drive_c/windows/notepad.exe in the

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

To add the Downloads, Videos, Music folders next to the Documents folder in the Explorer folder tree, you can create the appropriate links:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

If you want to change drive letters, then run Wine configuration:

And go to the Drives tab to customize the display of drives in the Wine File Manager:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

You can run the .bat file in many ways:

1. Run the command

2. Run the command

And find the file you need in the Explorer window.

to immediately get to the desired folder.

If you are using a path to a file on the Linux file system, you must specify the /unix option.

How to install a program in Wine and create a shortcut

If the program is portable, then you can place it anywhere on the disk – not necessarily in the Wine folder. By the way, the default C: drive in Wine is

As already mentioned, you do not have to put the files with the program there. You can run portable programs in the ways shown above.

If the program is distributed as an installer, then simply run this installer using Wine. In most cases, everything will go as in Windows, the usual installation will be performed on your Linux desktop and a shortcut will appear in the menu to launch the program.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

For a portable program, you can also make a shortcut. To do this, right-click on the desktop and select “Create a new launcher here” (in Cinnamon), “Create Launcher” (in XFCE), or similar.

There is usually an option to set an icon, including icons for programs ever run in Wine.

Even if the “Create launcher” wizard allows you to specify a working directory, it’s best not to rely on it. As a launch command, specify a command of the form:

That is, the command to be executed includes two subcommands – switching to the desired directory and launching the executable file.

For example, if the executable file is located in /home/mial/.wine/drive_c/Program Files (x86)/foobar2000/ and is called foobar2000.exe, then the run command is:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Another example, when the file is not on the Wine drive: you need to create a shortcut to run the file /mnt/disk_d/Share/Conses/ConsFed/cons.exe, then the run command is as follows:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

If the program requires a special version of Wine or additional components, then you can find scripts that simplify their installation, they will be discussed later in the sections on PlayOnLinux and winetricks.

Built-in programs in Wine

Wine has several built-in “standard Windows programs”.

Notebook

Registry Editor

More details about the registry and the registry editor will be below.

File Explorer

To open File Explorer, run the command:

In Explorer, you can open “My Computer” – there will be links to all drives in Linux. The “C:” drive is what is located in the

/.wine/drive_c/ folder. The “Z:” drive is the root drive of the Linux file system. Other drives are Linux-attached flash drives and disks.

Task Manager

To open the Task Manager, run the command:

Minesweeper game

Internet Explorer browser

Actually, it’s not real IE – it’s a browser based on Firefox.

You can install older versions of Internet Explorer if you wish, but even Windows has ditched IE in recent versions and switched to a Chrome-based web browser.

Windows command line

CMD built-in commands are:

for further information on any of the above commands.

MSI Installer

Control Panel

.chm files, also called MS Windows HtmlHelp Data, are usually files with help on using the program with which they are distributed.

After installing Wine, you can open the CHM file by double-clicking. Another way to open a CHM file is to use the command line:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

How to uninstall a program from Wine

To uninstall a program from Wine, go to the “Add/Remove Programs” settings, to do this, run:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Next, select the program to uninstall and click the “Modify/Remove” button. Shortcuts created during installation will be removed automatically.

Wine file system

By default, the files are physically located in the

/.wine folder. That is, if you want to “reinstall Windows”, that is, completely remove all settings and installed programs, you can delete this folder. But remember that the shortcuts made in the menu and on the desktop will remain, because they are located in other places.

When using WINEPREFIX (more on that later), a different folder will be used to store files.

you can open “My Computer” – there will be links to all drives in Linux. The “C:” drive is what is located in the

/.wine/drive_c/ folder. The “Z:” drive is the root drive of the Linux file system. Other drives are Linux-attached flash drives and disks.

You can change this by opening “Wine Settings” and going to the “Disks” tab:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

WINEPREFIX (prefixes)

By default, Wine stores configuration files and installed Windows applications in the

/.wine directory. This directory is called the Wine prefix. It is created and updated automatically as needed when running Windows programs and Wine setup programs such as winecfg. The prefix directory also contains the standard Windows root directory structure, which appears to Windows programs as the C: drive.

You can change the location of the prefix by creating a WINEPREFIX environment variable with a new path. This is useful when you need to use different environments for different Windows applications. When starting a Windows application, a new prefix will be automatically created at the location specified in WINEPREFIX, if it did not exist before.

For example, if you run one application with

and the other with

each program will have its own C: drive, respectively, its own copy of all settings and the registry. Thus, both programs will run in completely isolated environments from each other.

Note: However, Wine prefixes are not sandboxed. Programs running in Wine can also access the rest of the system (eg partition Z: usually corresponds to the root of the file system, i.e. /).

To create a prefix without running any Wine configuration tools or Windows applications, you can use the command:

You can change the prefix that Wine uses by changing the WINEPREFIX environment variable (outside of Wine). To do this, run something like the following in a terminal:

To use the default prefix, use the command

Or just set WINEPREFIX to

Alternatively, you can prefix wine on each command, e.g.

You can rename, move, copy and delete prefixes without affecting others, and each prefix has its own wineserver instance.

How to create a 32-bit Wine prefix on a 64-bit system?

Currently, there are a number of serious bugs that prevent many 32-bit applications from working with the 64-bit Wine prefix. To work around this, you can create a new 32-bit Wine prefix using the WINEARCH environment variable. In terminal enter:

Use the actual path to WINEPREFIX. Don’t use an existing directory for the new wineprefix: Wine has to create it for you.

After creating a 32-bit wineprefix, you no longer need to specify WINEARCH on the command line to use it, as the architecture of an existing wineprefix cannot be changed. Note that if you want to use a wineprefix other than the default one (

/.wine), then you need to specify the WINEPREFIX variable when installing anything (including winetricks):

How to run two programs as if they were on different computers?

Example: you have server and client programs. And one will not work in the presence of the other.

This is where using different wineprefixes will help, as they essentially mimic two Windows machines.

Run the first program as usual:

The second one needs to be run with a different prefix, so we need to change the WINEPREFIX environment variable:

First-program.exe and second-program.exe can be two copies of the same program.

How to make Wine run an application in a virtual desktop

You can do this with winecfg. Add the app in the Applications tab, and then in the Graphics tab, enable Emulate a virtual desktop.

You can also use the following command:

Replace program.exe with the name of your program and change the resolution to the virtual desktop size you need. For example:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Changing the name allows you to open multiple desktops at the same time.

Assistants in installing programs and libraries in Wine

PlayOnLinux

PlayOnLinux is a program with a graphical interface that contains a database of high-quality and up-to-date scripts that help you install Windows programs in just a few clicks. At its core, PlayOnLinux is a wrapper for Wine that facilitates and automates the installation of programs, especially those requiring dependencies.

The PlayOnLinux scripts make heavy use of WINEPREFIX and each application installs its own WINEPREFIX. This means that the work of different programs does not affect each other, and you can easily remove any of them without affecting the others.

PlayOnLinux has a set of native functions that can be called from scripts. These functions allow you to install the necessary libraries, dll files, runtimes, and more.

In its work, the program creates WINEPREFIX from different versions of Wine. That is, if a certain version of Wine is recommended for the program to work, then this version will be used.

Advantages of PlayOnLinux:

The peculiarity of this program is that the Wine version is explicitly specified in the PlayOnLinux scripts. This applies even to problem-free programs that work fine on any version of Wine. But since the Wine version must be specified explicitly, the latest version is specified at the time the script was written. As a result, when installing different programs, PlayOnLinux will load different versions of Wine. Each version of Wine plus the prefix takes up quite a lot of space.

This means that if you want to install some simple application that doesn’t require you to install additional software, install it using Wine without using PlayOnLinux – this will save you several hundred megabytes of disk space.

Installing PlayOnLinux on Debian, Kali Linux, Linux Mint Ubuntu and their derivatives:

Installing PlayOnLinux on Arch Linux, BlackArch and their derivatives:

To install the program in PlayOnLinux, click the “Install” button.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Select the category and the program or game in it that you want to install and click the “Install” button again (at the bottom of the window).

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Next, a window with important recommendations will be displayed:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Information about the selected program to install.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

And here is what was mentioned above – the 7-Zip installation file is less than 2 megabytes in size and the program itself after installation takes about the same amount. But for it, the version of Wine specified in the script is downloaded, which occupies almost 300 megabytes, plus the expanded prefix will also take up space.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

If the program is free, then you can choose to download from the network or specify an installer on your computer if you have downloaded the program beforehand.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

For some programs, it is suggested to install from a disk or from Steam.

The normal installer of the selected program starts.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

After installation, the shortcut of the selected program is added to the menu, to the desktop, and also to PlayOnLinux.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

For each installed program, you can make fine adjustments. For example, choose a different version of Wine.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

You can perform standard actions for a given prefix in the PlayOnLinux GUI.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

If necessary, you can install additional components – all sorts of runtimes, missing DLLs, Windows programs, and much more.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

You can change the display settings – as far as I understand, in Wine this can only be done directly by editing the Windows registry.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Winetricks

Winetricks is an easy way to solve various problems in Wine related to installing programs and games and configuring Wine.

Winetricks is a helper script for downloading and installing various redistributable runtime libraries required to run some programs in Wine. These may include replacing Wine components using closed source libraries.

Winetricks has a graphical menu of supported games/applications for which it can perform sequential actions. It also allows you to install missing DLLs and configure various Wine options. You can choose the prefix where you want to install the application or change the setting.

Installing Winetricks on Debian, Kali Linux, Linux Mint Ubuntu and derivatives:

Installing Winetricks on Arch Linux, BlackArch and their derivatives:

If you don’t have Winetricks in your distribution’s repository, or if you want the latest version, then all you need to do to install and run it is to run the following commands:

The program has a graphical interface. In the window that opens, you can immediately perform actions in the default prefix or create a new prefix:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

An example of actions after choosing a prefix:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Creating a new prefix – just select its version (32-bit or 64-bit) and name.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

A new prefix has been added to the list and now you can select it to install programs and perform other actions:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

An example of the settings you can change for the selected prefix:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Example programs for installation:

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

In Winetricks, the installation steps are called verbs. Each verb installs an application or changes settings.

Executes given verbs. Each verb installs an application or changes a setting.

When run without options, winetricks displays a GUI with a list of available packages. If you know the names of the packages you want to install, you can add them to the winetricks command and the installation process will begin immediately. For example, the command

will install corefonts and vcrun6 packages.

Like all Wine commands, winetricks is aware of the WINEPREFIX environment variable. This is useful for using winetricks with different Wine prefix locations. For example,

installs the mfc40 package in the

Users with more than one version of Wine on their system (for example, an installed package and an uninstalled Wine built from git) can specify which version of Winetricks should be used. For example,

installs the mfc40 package using Wine to the

Which is better, PlayOnLinux or Winetricks?

Some actions of PlayOnLinux and Winetricks intersect, that is, the same program can be installed both through PlayOnLinux and through Winetricks, what should I choose?

First, if it’s an easy-to-install program on Linux that doesn’t require dependencies, like foobar2000 or 7-Zip, then don’t use either of those programs – install it directly, because PlayOnLinux will create a new virtual disk and load the new version of Wine (a lot of disk space), and Winetricks will almost certainly download the old version (although the script is updated almost every day, many links in it have time to become outdated).

Secondly, if you need to install a dependency or a program that requires additional components, then I would recommend PlayOnLinux simply as an easier option. But if you want to install a component not to a new prefix, but to an existing prefix, then it is more convenient to use Winetricks, since it does not have the obligatory stage of creating a new virtual disk.

Using the Registry and Regedit

All settings you change in winecfg, with the exception of disk settings, are eventually stored in the registry. On Windows, this is the central repository for application and operating system configuration. Similarly, Wine implements the registry, and some settings that are not in Winecfg can be changed in it.

Registry structure

The Windows Registry is a complex tree structure, and even most Windows programmers are not fully aware of how the Registry works with its various “hives” and “bushes” and the many relationships between them; a full description is beyond the scope of this document. But here are the main registry keys you might need to know about now:

This master root key (in win9x it is stored in the system.dat hidden file system) contains everything related to the current Windows installation. It is often abbreviated as HKLM.

This master root key (in Win9x it is stored in a hidden user.dat file) contains configuration data for each installation user.

This is a link to HKEY_LOCAL_MACHINE\Software\Classes. It contains data that describes things like file associations, OLE document handlers, and COM classes.

This is a link to HKEY_USERS\your_name, i.e. your personal configuration.

Registry files

Now you are probably wondering how this maps to the Wine structure. The registry layout described above is actually in three different files in each user’s

This file contains HKEY_LOCAL_MACHINE.

This file contains HKEY_CURRENT_USER.

This file contains HKEY_USERS\.Default (i.e. default user settings).

These files are automatically created the first time you use Wine. The set of global settings is stored in the wine.inf file and processed by the rundll32.exe program. The first time you start Wine, the wine.inf file is parsed to populate the original registry. The registry is also updated automatically when wine.inf is modified, such as when upgrading to a newer version of Wine.

It is not recommended to edit these files to change the registry as they are managed internally by Wine. Use regedit.exe, reg.exe, or any program that uses standard registry functions.

Using Regedit

An easy way to access and modify the registry is with the regedit tool.

How to use wine. Смотреть фото How to use wine. Смотреть картинку How to use wine. Картинка про How to use wine. Фото How to use wine

Like the Windows program it replaces, regedit serves to provide a system-level view of the registry containing all the keys. When you run it, you will immediately notice that the cryptic keys displayed in the text file are organized in a hierarchy.

To navigate through the registry, click the items on the left to navigate to sub-items. To delete a key, click it and choose Delete from the Edit menu. To add a key or value, find where you want to put it and choose New from the Edit menu. Similarly, you modify an existing key by selecting it in the right pane of the window and choosing Edit from the Edit menu. Another way to perform the same actions is to right-click on a key or value.

Of particular interest to Wine users are the settings stored in HKEY_CURRENT_USER\Software\Wine. Most of the settings you change in winecfg are written to this area of the registry.

Full list of registry keys

See the wiki for an up-to-date list of useful registry keys and values.

How to use wine

This document, called the Wine User Guide, is both an easy installation guide and an extensive reference guide. This guide is for both the new Wine user and the experienced Wine user, offering full step-by-step installation and configuration instructions, as well as featuring extensive reference material by documenting all configuration features and support areas.

The process of installing and running Wine can be summarised as follows:

To test your installation run Wine notepad clone using the wine notepad command.

The first command you will run will be to install an application. Typically something like wine /media/cdrom/setup.exe or the equivalent path might be used to install an application from CD.

Different software programs are designed for different operating systems, and most won’t work on systems that they weren’t designed for. Windows programs, for example, won’t run in Linux because they contain instructions that the system can’t understand until they’re translated by the Windows environment. Linux programs, likewise, won’t run under the Windows operating system because Windows is unable to interpret all of their instructions.

Wine makes it possible to run Windows programs alongside any Unix-like operating system, particularly Linux. At its heart, Wine is an implementation of the Windows Application Programing Interface (API) library, acting as a bridge between the Windows program and Linux. Think of Wine as a compatibility layer, when a Windows program tries to perform a function that Linux doesn’t normally understand, Wine will translate that program’s instruction into one supported by the system. For example, if a program asks the system to create a Windows pushbutton or text-edit field, Wine will convert that instruction into its Linux equivalent in the form of a command to the window manager using the standard X11 protocol.

If you have access to the Windows program source code, Wine can also be used to recompile a program into a format that Linux can understand more easily. Wine is still needed to launch the program in its recompiled form, however there are many advantages to compiling a Windows program natively within Linux. For more information, see the Winelib User Guide.

Throughout the course of its development, Wine has continually grown in the features it carries and the programs it can run. A partial list of these features follows:

Support for running Win64, Win32 (Win 95/98, NT/2000/XP/2003/Vista/2008/7/2012/10), Win16 (Win 3.1) and DOS programs

Optional use of external vendor DLL files (such as those included with Windows)

X11-based graphics display, allowing remote display to any X terminal, as well as a text mode console

Desktop-in-a-box or mixable windows

DirectX support for games

Good support for various sound drivers including OSS and ALSA

Support for alternative input devices such as graphics tablets.

Printing: PostScript interface driver ( psdrv ) to standard Unix PostScript print services

Modem, serial device support

Winsock TCP/IP networking support

ASPI interface (SCSI) support for scanners, CD writers, and other devices

Advanced Unicode and foreign language support

Full-featured Wine debugger and configurable trace logging messages for easier troubleshooting

There are a number of programs that are derived from the standard Wine codebase in some way or another. Some of these are commercial products from companies that actively contribute to the Wine project.

These products try to stand out or distinguish themselves from the standard version of Wine by offering greater compatibility, easier configuration, and commercial support. If you require such things, it is a good idea to consider purchasing these products.

Table 1-1. Various Wine offerings

ProductDescriptionDistribution Form
CodeWeavers CrossOver OfficeCrossOver Office allows you to install your favorite Windows productivity applications in Linux, without needing a Microsoft Operating System license. CrossOver includes an easy to use, single click interface, which makes installing a Windows application simple and fast.Commercial; 30-day fully-functional demo available.

There are many ways to run software other than through Wine. If you are considering using Wine to run an application you might want to think about the viability of these approaches if you encounter difficulty.

Instead of running a particular Windows application with Wine, one frequently viable alternative is to simply run a different application. Many Windows applications, particularly more commonly used ones such as media players, instant messengers, and filesharing programs have very good open source equivalents. Furthermore, a sizable number of Windows programs have been ported to Linux directly, eliminating the need for Wine (or Windows) entirely. These alternatives should be found through your system package management facilities.

Probably the most obvious method of getting a Windows application to run is to simply run it on Windows. However, security, license cost, backward-compatibility, and machine efficiency issues can make this a difficult proposition, which is why Wine is so useful in the first place.

Rather than installing an entirely new operating system on your machine, you can instead run a virtual machine at the software level and install a different operating system on it. Thus, you could run a Linux system and at the same time run Windows along with your application in a virtual machine simultaneously on the same hardware. Virtual machines allow you to install and run not only different versions of Windows on the same hardware, but also other operating systems, including ReactOS.

There are significant drawbacks to using virtual machines, however. Unlike Wine, such programs are emulators, so there is an inevitable speed decrease which can be quite substantial. Furthermore, running an application inside a virtual machine prevents fully integrating the application within the current environment. You won’t, for example, be able to have windows system tray icons or program shortcuts sitting alongside your desktop Linux ones, since instead the Windows applications must reside completely within the virtual machine.

Once you’ve decided that Wine is right for your needs, the next step is to decide how you want to install it. There are three methods for installing Wine from WineHQ, each with their own advantages and disadvantages.

By far the easiest method for installing Wine is to use a prepackaged version of Wine. These packages contain ready-to-run Wine binary files specifically compiled for your distribution, and they are tested regularly by the packagers for both functionality and completeness.

Sometimes the Wine packages don’t fit your needs exactly. Perhaps they’re not available for your architecture or distribution, or perhaps you want to build Wine using your own compiler optimizations or with some options disabled, or perhaps you need to modify a specific part of the source code before compilation. Being an open source project, you are free to do all of these things with Wine source code, which is provided with every Wine release. This method of installation can be done by downloading a Wine source archive and compiling from the command line. If you are comfortable with such things and have special needs, this option may be for you.

Installing a package on a fresh system is remarkably straightforward. Simply download and install the package using whatever utility your distribution provides. There is usually no need to explicitly remove old packages before installing, as modern Linux distributions should upgrade and replace them automatically. If you installed Wine from source code, however, you should remove it before installing a Wine package. See the section on uninstalling Wine from source for proper instructions.

Wine works on a huge amount of different Linux distributions, as well other Unix-like systems such as Solaris and FreeBSD, each with their own specific way of installing and managing packages. Fortunately, however, the same general ideas apply to all of them, and installing Wine should be no more difficult than installing any other software, no matter what distribution you use. Uninstalling Wine packages is simple as well, and in modern Linux distributions is usually done through the same easy interface as package installation.

Before installing Wine from source, make sure you uninstall any Wine binary packages you may have on your system. Installing from source requires use of the terminal window as well as a full copy of the Wine source code. Once having downloaded the source from Git or extracted it from an archive, navigate to it using the terminal and then follow the remaining steps.

Wine makes use of many open source libraries during its operation. While Wine is not strictly dependent on these libraries and will compile without most of them, much of Wine functionality is improved by having them available at compile time. In the past, many user problems were caused by people not having the necessary development libraries when they built Wine from source; because of this reason and others, we highly recommend installing via binary packages or by building source packages which can automatically satisfy their build dependencies.

If you wish to install build dependencies by hand, there are several ways to see if you’re missing some useful development libraries. The most straightforward approach is to watch the output of configure before you compile Wine and see if anything important is missing; if it is, simply install what’s missing and rerun configure before compiling. You can also check the file configure generates ( include/config.h ) and see what files configure is looking for but not finding.

Once you’ve installed the build dependencies you need, you’re ready to compile the package. In the terminal window, after having navigated to the Wine source tree, run the following commands:

The last command requires root privileges. Although you should never run Wine as root, you will need to install it this way.

To uninstall Wine from source, once again navigate to the same source folder that you used to install Wine using the terminal. Then, run the following command:

This command will require root privileges, and should remove all of the Wine files from your system. It will not, however, remove your Wine configuration and applications located in your user home directory, so you are free to install another version of Wine or delete that configuration by hand.

This chapter will describe all aspects of running Wine, like e.g. basic Wine invocation, command line parameters of various Wine support programs etc.

The standard way to uninstall things is for the application to provide an uninstaller, usually registered with the «Add/Remove Programs» control panel applet. To access the Wine equivalent, run the uninstaller program (it is located in the programs/uninstaller/ directory in a Wine source directory) in a terminal :

Some programs install associated control panel applets, examples of this would be Internet Explorer and QuickTime. You can access the Wine control panel by running in a terminal :

which will open a window with the installed control panel applets in it, as in Windows.

If the application doesn’t install menu or desktop items, you’ll need to run the app from the command line. Remembering where you installed to, something like:

$ wine «C:\Program Files\ appname \ appname.exe «

will probably do the trick. The path isn’t case sensitive, but remember to include the double quotes. Some programs don’t always use obvious naming for their directories and executable files, so you might have to look inside the Program Files directory to see what was put where.

You can simply invoke the wine command to get a small help message:

You could run the file c:\windows\system\foo.exe with:

However, you would have to run the file c:\myapps\foo.exe with this command:

(note the backslash-escaped ‘\’) or:

For details on running text mode (CUI) executables, read the section below.

Shows a small command line help page.

Shows the Wine version string. Useful to verify your installation.

Wine isn’t perfect, and many Windows applications still don’t run without bugs under Wine (but then, a lot of programs don’t run without bugs under native Windows either!). To make it easier for people to track down the causes behind each bug, Wine provides a number of debug channels that you can tap into.

$ WINEDEBUG=warn+heap wine program_name

If you leave off the message class, Wine will display messages from all four classes for that channel:

$ WINEDEBUG=heap wine program_name

If you wanted to see log messages for everything except the relay channel, you might do something like this:

$ WINEDEBUG=+all,-relay wine program_name

It’s not always possible to run an application on builtin DLLs. Sometimes native DLLs simply work better. Although these DLL overrides can be set using winecfg you might want to use the WINEDLLOVERRIDES environment variable to set them.

$ WINEDLLOVERRIDES=»comdlg32,shell32=n,b» wine program_name

Try to load comdlg32 and shell32 as native Windows DLLs first and try the builtin version if the native load fails.

$ WINEDLLOVERRIDES=»comdlg32,shell32=n;c:\\foo\\bar\\baz=b» wine program_name

$ WINEDLLOVERRIDES=»comdlg32=b,n;shell32=b;comctl32=n;oleaut32=» wine program_name

Try to load comdlg32 as builtin first and try the native version if the builtin load fails; load shell32 always as builtin and comctl32 always as native. oleaut32 will be disabled.

For more information about DLL overrides, please refer to the DLL overrides section of this guide.

Specifies the Windows architecture to support. It can be set either to win32 (support only 32-bit applications), or to win64 (support both 64-bit applications and 32-bit ones in WoW64 mode). The architecture supported by a given Wine prefix is set at prefix creation time and cannot be changed afterwards. When running with an existing prefix, Wine will refuse to start if WINEARCH doesn’t match the prefix architecture.

AUDIODEV = audio device

MIXERDEV = mixer device

MIDIDEV = MIDI device

$ AUDIODEV=/dev/dsp4 MIXERDEV=/dev/mixer1 MIDIDEV=/dev/midi3 wine program_name

wineserver usually gets started automatically by Wine whenever the first Wine process gets started. However, wineserver has some useful command line options that you can add if you start it up manually, e.g. via a user login script or so.

Display wineserver command line options help message.

This parameter makes wineserver persistent, optionally for n seconds. It will prevent wineserver from shutting down immediately.

Usually, wineserver quits almost immediately after the last Wine process using this wineserver terminated. However, since wineserver loads a lot of things on startup (such as the whole Windows registry data), its startup might be so slow that it’s very useful to keep it from exiting after the end of all Wine sessions, by making it persistent.

This parameter makes a newly started wineserver wait until the currently active instance terminates.

Your program might require some environment variable to be set properly in order to run successfully. In this case you need to set this environment variable in the Linux shell, since Wine will pass on the entire shell environment variable settings to the Windows environment variable space. Example for the bash shell (other shells may have a different syntax!):

export MYENVIRONMENTVAR = myenvironmentvarsetting

key. Now you can create or modify the values of the variables you need

Text mode programs are program which output is only made out of text (surprise!). In Windows terminology, they are called CUI (Console User Interface) executables, by opposition to GUI (Graphical User Interface) executables. Win32 API provide a complete set of APIs to handle this situation, which goes from basic features like text printing, up to high level functionalities (like full screen editing, color support, cursor motion, mouse support), going through features like line editing or raw/cooked input stream support

Given the wide scope of features above, and the current usage in Un*x world, Wine comes out with three different ways for running a console program (aka a CUI executable):

wineconsole with user backend

wineconsole with curses backend

The names here are a bit obscure. «bare streams» means that no extra support of Wine is provided to map between the Unix console access and Windows console access. The two other ways require the use of a specific Wine program ( wineconsole ) which provide extended facilities. The following table describes what you can do (and cannot do) with those three ways.

Table 3-1. Basic differences in consoles

When wineconsole is used, several configuration options are available. Wine (as Windowses do) stores, on a per application basis, several options in the registry. This let a user, for example, define the default screen-buffer size he would like to have for a given application.

As of today, only the user backend allows you to edit those options (we don’t recommend editing by hand the registry contents). This edition is fired when a user right clicks in the console (this popups a menu), where you can either choose from:

Properties: this will edit the application’s settings. When you’re done, with the edition, you’ll be prompted whether you want to:

Keep these modified settings only for this session (next time you run the application, you will not see the modification you’ve just made).

Use the settings for this session and save them as well, so that next you run your application, you’ll use these new settings again.

Here’s the list of the items you can configure, and their meanings:

Table 3-2. Wineconsole configuration options

When the user enter commands, he or she can choose between several edition modes:

Win32 : these are the standard Windows console key-bindings (mainly using arrows).

In the past, Wine used a special configuration file that could be found in

When the program starts you’ll notice there are tabs along the top of the window for:

Changing settings in the Applications and Libraries tabs will have the most impact on getting an application to run. The other settings focus on getting Wine itself to behave the way you want it to.

Wine has the ability to mimic the behavior of different versions of Windows. In general, the biggest difference is whether Wine behaves as a Win9x version or an NT version. Some applications require a specific behavior in order to function and changing this setting may cause a buggy app to work. Wine default Windows version is Windows XP. Some applications may perform better if you choose Windows 98.

Within the tab you’ll notice there is a Default Settings entry. If you select that you’ll see the current default Windows Version for all applications. A troublesome application is best configured separately from the Default Settings. To do that:

Click on the Add application button.

Browse until you locate the executable.

After it’s been added you can choose the specific Windows version Wine will emulate for that application.

Likewise, some applications require specific libraries in order to run. Wine reproduces the Windows system libraries (so-called native DLLs) with completely custom versions designed to function exactly the same way but without requiring licenses from Microsoft. Wine has many known deficiencies in its built-in versions, but in many instances the functionality is sufficient. Using only builtin DLLs ensures that your system is Microsoft-free. However, Wine has the ability to load native Windows DLLs.

With that in mind, once you’ve copied the DLL you just need to tell Wine to try to use it. You can configure Wine to choose between native and builtin DLLs at two different levels. If you have Default Settings selected in the Applications tab, the changes you make will affect all applications. Or, you can override the global settings on a per-application level by adding and selecting an application in the Applications tab.

DLLs usually get loaded in the following order:

The directory the program was started from.

The current directory.

The Windows system directory.

The Windows directory.

The PATH variable directories.

There are of course DLLs that Wine does not currently implement very well (or at all).

In case Wine complains about a missing DLL, you should check whether this file is a publicly available DLL or a custom DLL belonging to your program. In the latter case, check that you have installed your program correctly.

Most often applications will assume that a required redistributable package has already been installed and subsequently fail to run when the required dependencies are not met. For example:

err:module:import_dll Library MFC42.DLL (which is needed by L»C:\\Program Files\\Foo\\Bar.dll») not found

There are basically five different graphics settings you can configure. For most people the defaults are fine.

The first setting primarily affect games and is somewhat self-explanatory. You can prevent the mouse from leaving the window of a full-screen program (e.g. a game) and the default is to not have that box checked. That is mostly needed when using a virtual desktop.

Windows requires a fairly rigid drive configuration that Wine imitates. Most people are familiar with the standard notation of the A: drive representing the floppy disk, the C: drive representing the primary system disk, etc. Wine uses the same concept and maps those drives to the underlying native filesystem.

winecfg has the ability to automatically detect the drives available on your system. It’s recommended you try this before attempting to configure drives manually. Simply click on the Autodetect button to have Wine search for drives on your system.

To add another drive, for example your CD-ROM, just create a new link pointing to it:

Wine can work with quite a few different audio subsystems. You can see the selected driver that Wine figures out for you under the Audio tab.

You can manually select which device will be used for Output, Input, Voice output and Voice input. For example you can choose the digital output of your sound device instead of the analog one.

Use the Desktop Integration tab of winecfg to install and select the new theme.

Now, the fact that Wine itself uses the registry to store settings has been controversial. Some people argue that it’s too much like Windows. To counter this there are several things to consider. First, it’s impossible to avoid implementing a registry simply because applications expect to be able to store their settings there. In order for Wine to store and access settings in a separate configuration file would require a separate set of code to basically do the same thing as the Win32 APIs Wine already implements.

Okay. with that out of the way, let’s dig into the registry a bit to see how it’s laid out. The Windows registry is an elaborate tree structure, and not even most Windows programmers are fully aware of how the registry is laid out, with its different «hives» and numerous links between them; a full coverage is out of the scope of this document. But here are the basic registry keys you might need to know about for now:

This fundamental root key (in win9x it’s stored in the hidden file user.dat ) contains configuration data for every user of the installation.

Now, what you’re probably wondering is how that translates into Wine structure. The registry layout described above actually lives in three different files within each user’s

This file contains HKEY_USERS\.Default (i.e. the default user settings).

These files are automatically created the first time you use Wine. A set of global settings is stored in the wine.inf file and is processed by the rundll32.exe program. The first time you run Wine the wine.inf file gets processed to populate the initial registry. The registry is also updated automatically if wine.inf changes, for instance when upgrading to a newer Wine version.

Note: Older Wine versions (before 1.0) required you to run the wineprefixcreate command manually to upgrade your settings. This is no longer necessary.

An easy way to access and change the registry is with the regedit tool. Similar to the Windows program it replaces, regedit serves to provide a system level view of the registry containing all of the keys. When you start it, you’ll immediately notice that the cryptic keys displayed in the text file are organized in a hierarchical fashion.

To navigate through the registry, click on the keys on the left to drill down deeper. To delete a key, click on it and choose Delete from the Edit menu. To add a key or value, locate where you want to put it and choose New from the Edit menu. Likewise, you modify an existing key by highlighting it in the right-hand window pane and choosing Modify from the Edit menu. Another way to perform these same actions is to right-click on the key or value.

With the above file structure, it is possible for a system administrator to configure the system so that a system Wine installation (and applications) can be shared by all the users, and still let the users all have their own personalized configuration. An administrator can, after having installed Wine and any Windows application software he wants the users to have access to, copy the resulting system.reg and over to the global registry files (which we assume will reside in /usr/local/etc here), with:

root/.wine cp system.reg /usr/local/etc/wine.systemreg

and perhaps even symlink these back to the administrator’s account, to make it easier to install apps system-wide later:

You might be tempted to do the same for user.reg as well, however that file contains user specific settings. Every user should have their own copy of that file along with the permissions to modify it.

You’ll want to pay attention to drive mappings. If you’re sharing the system.reg file you’ll want to make sure the registry settings are compatible with the drive mappings in

/.wine/dosdevices of each individual user. As a general rule of thumb, the closer you keep your drive mappings to the default configuration, the easier this will be to manage. You may or may not be able to share some or all of the actual c: drive you originally installed the application to. Some applications require the ability to write specific settings to the drive, especially those designed for Windows 95/98/ME.

Note that the tools/wineinstall script used to do some of this if you installed Wine source as root, however it no longer does.

This section is meant to cover the rest of the things you can configure. It also serves as a collection of tips and tricks to get the most out of using Wine.

Windows shares can be mapped into the unc/ directory so anything trying to access \\ myserver \ some \ file will look in

to make it available in Wine (don’t forget to create the unc directory if it doesn’t already exist).

Wine can interact directly with the local CUPS printing system to find the printers available on your system. Configuring printers with Wine is as simple as making sure your CUPS configuration works. Wine still needs the lpr command (from CUPS), when printing a document.

If you do not use CUPS, the old BSD-Printing system is used:

All Printers from /etc/printcap are installed automatically in Wine.

Wine needs a PPD file for every Printer ( generic.ppd comes with Wine).

The lpr command is called when printing a document

In Windows, scanners use the TWAIN API to access the underlying hardware. Wine builtin TWAIN DLL simply forwards those requests to the Linux SANE libraries. So, to utilize your scanner under Wine you’ll first need to make sure you can access it using SANE. After that you’ll need to make sure you have xscanimage available for use. Currently it is shipped with the sane-frontends package but it may not be installed with your distribution. Scanner access is currently known to have problems. If you find it works for you, please consider updating this section of the user guide to provide details on using SANE with Wine.

The next step is to hook the Unix ODBC library to the Wine built-in odbc32 DLL. The built-in odbc32 (currently) looks to the environment variable LIB_ODBC_DRIVER_MANAGER for the name of the ODBC library. For example:

If that environment variable is not set then it looks for a library called libodbc.so and so you can add a symbolic link to equate that to your own library. For example as root you could run the commands:

If you have any problems then you can use WINEDEBUG =+odbc32 command before running Wine to trace what is happening. One word of warning: some programs actually cheat a little and bypass the ODBC library. For example the Crystal Reports engine goes to the registry to check on the DSN. The fix for this is documented at unixODBC site where there is a section on using unixODBC with Wine.

Native ODBC drivers have been reported to work for many types of databases including MSSQL and Oracle. In fact, some like MSSQL can only be accessed on Linux through a Winelib app. Rather than just copying DLL files, most ODBC drivers require a Windows-based installer to run to properly configure things such as registry keys.

Types successfully tested under Wine:

Please report any other successes to the wine-devel mailing list.

There are times when you’ve been trying everything, you even killed a cat at full moon and ate it with rotten garlic and foul fish while doing the Devil’s Dance, yet nothing helped to make some damn program work on some Wine version. Don’t despair, we’re here to help you. (in other words: how much do you want to pay?)

/.wine/dosdevices to make sure your c: points to where you think it should.

The following sometimes helps, too:

wine x :\\ full \\ path \\ to \\ prg.exe

/.wine/drive_c/ full / path / to / prg.exe

/.wine/drive_c/ full / path / to / && wine prg.exe

Instruct Wine via winecfg to use either desktop mode, or normal managed mode. That can make a lot of difference, too.

Maybe your app is using some kind of copy protection? Many copy protections currently don’t work on Wine. Some might work in the future, though. (the CD-ROM layer isn’t really full-featured yet).

Sometimes Wine installation process changes and new versions of Wine account on these changes. This is especially true if your setup was created long time ago. Rename your existing

/.wine directory for backup purposes. Use the setup process that’s recommended for your Wine distribution to create new configuration. Use information in old

/.wine directory as a reference. Later you can remove the new

/.wine directory and rename your old one back.

There is a really good chance that someone has already tried to do the same thing as you. You may find the following resources helpful:

FunctionBare streamsWineconsole with user backendWineconsole with curses backend
How to run (assuming executable is called foo.exe )
serverirc.freenode.net
port6667
channel#winehq

If all else fails, you may wish to investigate commercial versions of Wine to see if your application is supported.

Finding the source of your problem is the next step to take. There is a wide spectrum of possible problems ranging from simple configurations issues to completely unimplemented functionality in Wine. The next section will describe how to file a bug report and how to begin debugging a crash. For more information on using Wine debugging facilities be sure to read the Wine Developers Guide.

A file which is in machine executable, compiled form: hex data (as opposed to a source code file).

A distribution is usually the way in which some «vendor» ships operating system CDs (usually mentioned in the context of Linux). A Linux environment can be shipped in lots of different configurations: e.g. distributions could be built to be suitable for games, scientific applications, server operation, desktop systems, etc.

An editor is usually a program to create or modify text files. There are various graphical and text mode editors available on Linux.

Environment variables are text definitions used in a Shell to store important system settings. In a bash shell (the most commonly used one in Linux), you can view all environment variables by executing:

If you want to change an environment variable, you could run:

export MYVARIABLE = mycontent

For deleting an environment variable, use:

Git is a fast version control system, originally written for use with large repositories, such as the Linux Kernel source. See the Git chapter in the Wine Developers Guide for detailed usage information.

A package is a compressed file in a distribution specific format. It contains the files for a particular program you want to install. Packages are usually installed via the dpkg or rpm package managers.

root is the account name of the system administrator. In order to run programs as root, simply open a Terminal window, then run:

This will prompt you for the password of the root user of your system, and after that you will be able to system administration tasks that require special root privileges. The root account is indicated by the

prompt, whereas ‘$’ indicates a normal user account.

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *