Руководство по wine linux


Загрузить PDF


Загрузить PDF

Из этой статьи вы узнаете, как установить и запустить Wine на компьютере с Linux. Wine — это программа, которая позволяет запускать программы для Windows на компьютере под управлением другой (не Windows) операционной системы.

  1. Изображение с названием Use Wine on Linux Step 1

    1

    Откройте терминал. Выберите «Терминал» в системном меню или в списке установленных программ.

    • В большинстве дистрибутивов Linux можно нажать Ctrl+Alt+T, чтобы открыть терминал.
    • В некоторых дистрибутивах Linux строка терминала находится в верхней части экрана.
  2. Изображение с названием Use Wine on Linux Step 2

    2

    Активируйте 32-разрядную архитектуру. Если на компьютере установлен 64-разрядный процессор, активируйте 32-разрядный режим. Для этого:

    • введите sudo dpkg --add-architecture i386 в терминале и нажмите Enter;
    • введите пароль администратора и нажмите Enter.
  3. Изображение с названием Use Wine on Linux Step 3

    3

    Свяжите загрузчик компьютера с веб-сайтом Wine. Это позволит компьютеру найти правильные файлы для загрузки. Для этого:

    • введите wget -nc https://dl.winehq.org/wine-builds/Release.key и нажмите Enter;
    • введите sudo apt-key add Release.key и нажмите Enter;
    • введите пароль администратора.
  4. Изображение с названием Use Wine on Linux Step 4

    4

  5. Изображение с названием Use Wine on Linux Step 5

    5

    Обновите загруженные пакеты. Введите sudo apt-get update и нажмите Enter.

  6. Изображение с названием Use Wine on Linux Step 6

    6

    Выберите загрузку. По состоянию на март 2018 года стабильную версию Wine можно загрузить, если ввести sudo apt-get install --install-recommends winehq-stable и нажать Enter.[1]

    • Возможно, будущие версии Wine будут поддерживать несколько разных типов стабильной загрузки.
  7. Изображение с названием Use Wine on Linux Step 7

    7

    Подтвердите загрузку. Введите y и нажмите Enter, а затем введите пароль администратора (если будет предложено). Начнется загрузка и установка Wine на компьютере.

  8. Изображение с названием Use Wine on Linux Step 8

    8

    Подождите, пока Wine загрузится и установится. На это уйдет 10 минут.

    Реклама

  1. Изображение с названием Use Wine on Linux Step 9

    1

    Создайте домашний каталог Windows. Введите winecfg, нажмите Enter, а затем найдите подтверждающее сообщение «created the configuration directory ‘home/name/.wine» (создан каталог конфигурации home/name/.wine).

    • Если вам предлагается установить какие-либо недостающие пакеты, нажмите «Установить» и дождитесь, когда пакеты установятся.
  2. Изображение с названием Use Wine on Linux Step 10

    2

    Выберите версию Windows. Откройте меню «Версия Windows» внизу окна «Конфигурация Wine», а затем выберите версию Windows (например, «Windows 7»), которую вы хотите использовать.

    • Если данная опция неактивна, сначала нажмите на вкладку «Приложения» в верхней части окна.
  3. Изображение с названием Use Wine on Linux Step 11

    3

    Нажмите Применить. Эта кнопка находится в нижней части окна. Настройки будут сохранены.

  4. Изображение с названием Use Wine on Linux Step 12

    4

    Щелкните по OK. Эта кнопка находится в нижней части окна. Окно закроется.

  5. Изображение с названием Use Wine on Linux Step 13

    5

    Загрузите программу для Windows в формате EXE. Найдите EXE-файл нужной программы (например, 7-zip) и скачайте его. Теперь можно установить программу.

    • На веб-сайте Wine можно просмотреть полный список программ, совместимых с Wine.

    Реклама

  1. Изображение с названием Use Wine on Linux Step 14

    1

    Откройте папку «Downloads». Вы найдете ее в папке «Home». Также папку «Downloads» можно открыть из меню «Приложения».

  2. Изображение с названием Use Wine on Linux Step 15

    2

    Найдите загруженный EXE-файл. Для этого прокрутите содержимое папки «Downloads».

  3. Изображение с названием Use Wine on Linux Step 16

    3

    Щелкните по файлу правой кнопкой мыши. Откроется выпадающее меню.

  4. Изображение с названием Use Wine on Linux Step 17

    4

    Нажмите Открыть с помощью Wine. Эта опция находится в верхней части меню. Откроется окно установки.

  5. Изображение с названием Use Wine on Linux Step 18

    5

    Щелкните по Установить. Эта опция находится внизу окна установки. Запустится установка программы на компьютер.

    • Чтобы установить некоторые программы, нужно ввести дополнительные данные.
    • Чтобы изменить папку, в которую будет установлена программа, нажмите «⋯» в правой части окна, а затем выберите другую папку на компьютере.
  6. Изображение с названием Use Wine on Linux Step 19

    6

    Щелкните по Закрыть, когда появится запрос. Эта опция станет доступной, когда программа устновится.

  7. Изображение с названием Use Wine on Linux Step 20

    7

    Запустите программу. Сделайте это в разделе «Приложения» системного меню.

    Реклама

Советы

  • Также можно установить пользовательский интерфейс Wine под названием PlayOnLinux, который позволяет устанавливать, удалять и получать доступ к программам Wine. Для этого откройте терминал, когда установите Wine, введите sudo apt install playonlinux, введите пароль и подтвердите загрузку, введя y.
  • Регулярно проверяйте сайт Wine на наличие обновлений.

Реклама

Предупреждения

  • Wine является довольно совершенной программой, но в ней, как правило, нельзя запустить игры и мощные программы с нормальной частотой кадров.

Реклама

Об этой статье

Эту страницу просматривали 72 046 раз.

Была ли эта статья полезной?

��������� ���: ������������� Wine, ��������� �������, ��� ��������� ������������ ���������� �������� ��� Wine �����, � ����� ����������� �������� ������, �� ������, ���� ��� ����� ������.

1.1.4. ������� �����

������� ��������� � ������� Wine ����� ���� ���������� ��������� �������:

  • ��������� �� �������� Wine
    Downloads � ���������� ��������� ��� ������� � ����� ��������� Wine. ��� ���������� ��� ����������� ������������ ���������������� ������� rpm �����.
  • ��������� Wine, ��������� ������� winecfg. � ����������� ������� Wine ������ ����� �������� � ������.
  • ����� ��������� ���� ���������, ��������� �������� �������� Wine, ������� �� �������� �������� Windows 3.1, ��������� ������� wine winefile.
  • ��������� Wine ��� ������ ������� wine filespec/appname.exe
  • ������ �������, ������� �� ���������, ����� ������� ��������� �����-���� ���������. ������ ���-�� �����: wine /media/cdrom/setup.exe, ��� ����� ��������.

1.2. ��� ����� Wine

1.2.1 Windows � ������

��������� ��������� ������� ��� ��������� ������������ ������, � ����������� �� ��� �� ����� �������� �� ��������, ��� ������� ��� �� �������������. ��������� ��� Windows, �������� �� ������ �������� ��� ������, ��� ��� �������� ����������, «�� ��������» �������, ���� ��� �� «����������» ������ Windows. ����� �����, ������ ��������� �� ���������� ��� �� Windows, ������ ��� Windows ���������� ������ � ���������������� ��� �� ����������.

��� ����, ��� ������ ������������ Windows � ������ ����������� ������, ����� �������� ������������ ����� ��������������� ��������. ������ �������� �������� ���������� � Windows � ������ �� ���� � ��� �� ���������, ��� �������� �������� «������� ��������». ����� ����� Windows ���������, ������������ ��������� ��������� � Windows � ��������� ���������; ����� ����� ������ ���������, ������������ ������������� ��������� � ������. ��� �������� ������ �������� — �� ������ ������������ �������� ������� ���������� ������ ������������ ������, �� � ��������� � ������ �������� �� ����� �������� ������������. ����� ����, ������� Windows � ����� ������������ ������ �� ���������� ������� �������������� ���������: ����������� ����������� ������, ��������� ��������� ������ �������� �����, Windows «�� �����» ����������� �������� �������� ������, �������� �������������� ���������� ����� ������������� ���������.

1.2.2. ��� ����� Wine, � ��� �� ��� �������?

Wine ��������� ��������� Windows ��������� �� ����� �����-�������� ������������ ��������, �������� ������.
� ����� ����, Wine ������������ ����� ���������� ����������
���������� ���������������� ���������� (����. Application Programming Interface, API)
Windows, ���������� ������� ����� ����� Windows ���������� � ������. �������� Wine ���������� �������������; ����� Windows ��������� �������� ��������� ����� ��������, ������� � ����� ��������� ��� ������, Wine «���������» ���������� ���� ��������� �� ����, �������� ��� ������� ������. ��������, ���� ��������� ������ ������� ������� �������� ������, ��� ��������� ����, �� Wine ����������� Windows ���������� � �� ������ ���������� � ����� ������� �������� ���������, ��������� ����������� �������� X11.

���� ������� ������ � ��������� ���� Windows ���������, Wine ����� ����� ���� ������������ ��� �������������� ��������� � ������, ������� ������ �������� ������� �����. ��� ������� ����� ������������������� ���������, Wine ��� ����� ���������, ������ � ���������� Windows �������� ����� ������ ������ ���������� ����� �����������. �������� Winelib User Guide ��� ���������� � ���� �����.

1.2.3. �������� Wine

� �������� ������ �������� Wine ��������� ����������� ����� �������� � ����������� ����� ��������, ������� ����� ���������. ��� ��������� ������ ���� �������:

  • ��������� ������� Win32 (Win 95/98, NT/2000/XP), Win16 (Win 3.1) � DOS ��������
  • �������������� ����������� ������������� DLL ������ �� ��������
    ������������ (�����, ����� ������ � ������ Windows)
  • ����������� �������, ������������ �� X11, ����������� ��������� ������ �� ����� � ��������, ��� � �� ��������� �������
  • ������� ���� ������ ����, ���� ����������� ����
  • ��������� DirectX ��� ���
  • �������� ��������� ��� ��������� �������� ���������, ������� OSS � ALSA
  • ��������� �������������� ��������� �����
  • ������: �������� ���������� PostScript (psdrv) ��� ������������ ��������� ������� PostScript ��� �����
  • �����, ��������� ����������������� �����
  • ��������� �������� ��������� Winsock TCP/IP
  • ��������� ��� ��������, ������� CD ��������, � ������ ���������, ������������ ��������� ASPI (SCSI)
  • ����������� ��������� ������� � ����������� ������
  • ������������������� ������� �������, ���������, ������������ ������� ��������� � ���������� ��� �������� ������ ��������������

1.3. ������ Wine

1.3.1. Wine �� Wine HQ

���������� �����������: ��� � ������� ��� «HQ» ������� � ���� HeadQuarters (����-��������).

Wine �������� �������� � ��������� ��������� ������, � � ��� ���� ����������� ������� ����� ��������� ������.
����������� ������ Wine ���������� � ���� ������������� ������� (�������� ������ � �����), � ����� ���� ������� � ���������, ��� � ���� ��������������� ��������� �����, ��� � � ���� ��������� ����, �������� � ����������. ����� ����, �� ������ ���������� ������, ����������� � ����������, ��������� �������� �� �������� ����� � ����������� Git. ��������� � ��������� �����, Getting Wine, ��� ���������� ��������.

1.3.2. ������ ������ Wine

���������� ��������� ��������, ��� ��� ����� ������� ���� ������������� �� ����������� ������� ���� Wine. ��������� �� ��� �������� ������������� ����������, �������������� ����������, ������� ��������������� ������ Wine.

��� �������� �������� ���������� � ���������� �� ����������� ������ Wine, ��������� ������ �������������, ���������� ������������, � ������������ ���������. ���� ��� ��������� �������� ����, ����� ���� ��� ����� ���������� �������� ��������.

��� ���� ����������� ������ ����:

CodeWeavers CrossOver Office

CrossOver Office ��������� ��� ���������� ���� ������� Windows ���������� � ����� ������, ��� ���� �� ��������� �������� ��������� (Microsoft Operating System license).CrossOver ����� ������� � ������������� ���������, ����������� ������������� Windows ���������� ����� � ������.

������ ���������������: ������������; ��������������� ������ ������������������� ������������.

CodeWeavers CrossOver Office Server Edition

CrossOver Office Server Edition ��������� ��� ��������� ���� ������� Windows ���������� � �������������� ������-������������ ������� ��������� ��� ��������, ��� ������������� ����������� �������� ��������� (Microsoft Operating System licenses) ��� ������ ���������� ������. CrossOver Office Server Edition ��������� ��� ������������� ������� ��������� ����� ������������ �������������, � ��� ��� � ������ �������.

1.4. ������ ������� ������� ���� �� ����������

���������� ��������� �������� ��������� ���������, ����� Wine. ���� �� ����������� ������������ Wine ��� ������� �����-���� ���������, �� ����� �������� ���, ����� �������� � ������ ������� � ��������.

1.4.1. ����������� ������������ ����������

������ ������������� ����������� Windows ���������� ��� ������ Wine, �����
������ ����� ������ ���������. ��������� Windows ����������, ����� ��� �����-������, �������� ����������� ������ �����������, ��������� ����������� ������������� ������, ����� ����� ������� ��������� �����������. ������ ����, ������������ ����� Windows �������� ���� ����� ����������� � ������, ��� ������ �������� �� Wine, �� ����� Windows.

1.4.2. ������ ������������ �������

�������� ��������� ������ ��������� Windows ���������� — ��� ��������� ��� ��� Windows. ������ ����������� ������������, ��������� ��������, �������� �������������, ������������� ������������� �����, ����� ��������� ��� �����������. ������ ������� ��� ������� Wine.

����� ����������� ������������ ReactOS, ������� �������� ������ ��������� (� ��������� ������) ������������� Windows. ReactOS �������� ������� ������ � �������� Wine, �, ������ ����, ����� ��������� ���������� Windows ��� ������, ��� ������������ ��������� �� ��� ����� ReactOS. ����� ����, ReactOS ���������� ������������� � ������� ��������� Windows, ��� ��������� ������������ «������» ��� �������������� ������ ���������.

1.4.3. ����������� ������

������ ���� ����� ������������� ����� ������������ ������� �� ���� ������, �����, ������ �����, ��������� ����������� ������ �� ����������� ������, � ���������� ����� ������������ ������� �� ���. ����� �������, �� ������� ������������ �������� ������, � � �� �� �����, � ����������� ������, ������������ Windows �� ����� ��� �����������, ������������ � �� ����� � ��� �� «������». ����������� ������ ��������� ��� ������������� � ��������� �� ������ ��������� ������ Windows, �� ����� � ��� �� ������������, �� ����� ������ ������������ �������, ������� ReactOS.

������������ ��������� ��������� ����� ����������� �����, ��������� ���� ����� ����������� «������» x86 �� ���� ����������. �� ����� �� ���������� ����������� ������� Bochs � QEMU, ��������� ���������� ��������� Windows � ReactOS. ������, ������������ ����������� ������ �������� VMware � ��������������� VirtualPC.

� ������ � ������������ �������� ���� ������������ ����������. � ������� �� Wine, ��� ��������� �������� �����������, ��� ��� ��� ������ � ���� ��������� ������ ��������, ������� ����� ���� ������ �������. ����� ����, ������ ���������� ������ ����������� ������, �� ��������� ��������� ������������� ���������� � ������� ���������. ��������, �� ������ ����� ������ ���������� ���� Windows, ��� ������ ���������� Windows ����� ������� ������, � �� ���� ����������, ��� �������� Windows ����� ������������ ������ ������ ����������� ������.



Время на прочтение
7 мин

Количество просмотров 567K

Введение

Статья посвящена 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. Распаковываем исходники.
Дальше вводим в терминале следующие команды:

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

cd wine-1.3.11/

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

gedit tools/wineinstall

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

CONFARGS="--with-opengl --disable-debug --disable-trace"

Получаем зависимости:

sudo apt-get install auto-apt checkinstall
sudo auto-apt -y run ./configure

Собираем:

make

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

sudo checkinstall

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

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

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

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

debuild

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

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

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

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

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

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

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

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

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

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

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

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

Когда вайн запускается в первый раз без указанного префикса, используется ~/.wine. Если префикс не существует вайн создаст его и наполнит дефолтным содержимым создаст и наполнит файлами каталоги C:windows, C:Program Files, C:users. Плюс будет создан чистый реестр.
Идем в наш домашний каталог и создаем новую директорию. Например .wine2.
Дальше идем в терминал и вводим:

WINEPREFIX="/home/username/.wine2/" winecfg

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

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

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

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

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

Winetricks

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

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

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

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

regedit

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

Идем в 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-сервера:

xinit -- :2
wine путь/папке/c/игрой/game.exe

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

Заключение

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

Данный материал написан для «Первого конкурса русскоязычных статей для ОС
Ubuntu» (konkurs.ubuntu.ru)
Автор статьи Владимир Качармин aka rootboot
Контакты: Skype root.boot2, email verda.info@gmail.com

Wine is a compatibility layer capable of running Microsoft Windows applications on Unix-like operating systems. Programs running in Wine act as native programs would, without the performance/memory penalties of an emulator.

Warning:

  • Wine is not isolated from your system.
  • If you can access a file or resource with your user account, programs running in Wine can too. See #Running Wine under a separate user account and Security#Sandboxing applications for possible precautions.
  • Wine can also run Malware (see Wine FAQ on Malware compatibility)

Installation

Wine can be installed by enabling the multilib repository and installing the wine (development), wine-stableAUR (stable) or wine-staging (testing) package. Wine Staging is a patched version of Wine, which contains bug fixes and features that have not been integrated into the stable or development branch yet.

See also #Graphics drivers and #Sound for additional requirements.

Consider installing wine-gecko and wine-mono for applications that depend on Internet Explorer and .NET, respectively. These packages are not strictly required as Wine will download the relevant files as needed. However, having the files downloaded in advance allows you to work off-line and makes it so Wine does not download the files for each Wine prefix needing them.

Third-party applications

These have their own communities and websites, and are not supported by the main Wine community. See Wine Wiki for more details.

  • CrossOver — Official paid version of Wine which provides a graphical interface and more comprehensive end-user support.
https://www.codeweavers.com || crossoverAUR
  • icoextract — Generates thumbnails for Windows executable files (.exe and .dll).
https://github.com/jlu5/icoextract || icoextractAUR
  • Lutris — Gaming launcher for all types of games, including Wine games (with prefix management), native Linux games and emulators.
https://lutris.net || lutris
  • PlayOnLinux — Graphical prefix manager for Wine. Contains scripts to assist with program installation and configuration.
https://www.playonlinux.com || playonlinuxAUR
  • Proton — Compatibility tool made for Steam based on Wine and additional components. See ProtonDB for compatibility list.
https://github.com/ValveSoftware/Proton || protonAUR
  • PyWinery — Simple graphical prefix manager for Wine.
https://github.com/ergoithz/pywinery || pywineryAUR
  • Q4Wine — Graphical prefix manager for Wine. Can export Qt themes into the Wine configuration for better integration.
https://sourceforge.net/projects/q4wine/ || q4wine-gitAUR
  • Bottles — Graphical prefix and runners manager for Wine based on GTK.
https://usebottles.com/ || bottlesAUR

Configuration

Configuring Wine is typically accomplished using:

  • winecfg is a GUI configuration tool for Wine, which can be started by running winecfg.
  • regedit is Wine’s registry editing tool, which can be started by running regedit. See WineHQ’s article on Useful Registry Keys.
  • control is Wine’s implementation of the Windows Control Panel, which can be started by running wine control.
  • See WineHQ’s List of Commands for the full list.

WINEPREFIX

By default, Wine stores its configuration files and installed Windows programs in ~/.wine. This directory is commonly called a «Wine prefix» or «Wine bottle». It is created/updated automatically whenever you run a Windows program or one of Wine’s bundled programs such as winecfg. The prefix directory also contains a tree which your Windows programs will see as C: (the C-drive).

You can override the location Wine uses for a prefix with the WINEPREFIX environment variable. This is useful if you want to use separate configurations for different Windows programs. The first time a program is run with a new Wine prefix, Wine will automatically create a directory with a bare C-drive and registry.

For example, if you run one program with env WINEPREFIX=~/.win-a wine program-a.exe, and another with env WINEPREFIX=~/.win-b wine program-b.exe, the two programs will each have a separate C-drive and separate registries.

Warning: Wine prefixes are not sandboxes! Programs running under Wine can still access the rest of the system! (for example, Z: is mapped to /, regardless of the Wine prefix).

To create a default prefix without running a Windows program or other GUI tool you can use:

$ env WINEPREFIX=~/.customprefix wineboot -u

WINEARCH

Wine will start a 64-bit environment by default. You can change this behavior using the WINEARCH environment variable. Rename your ~/.wine directory and create a new Wine environment by running $ WINEARCH=win32 winecfg. This will get you a 32-bit Wine environment. Not setting WINEARCH will get you a 64-bit one.

You can combine this with WINEPREFIX to make a separate win32 and win64 environment:

$ WINEARCH=win32 WINEPREFIX=~/win32 winecfg
$ WINEPREFIX=~/win64 winecfg

You can also use WINEARCH in combination with other Wine programs, such as winetricks (using Steam as an example):

WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam

In order to see the architecture of an existing prefix you can check its registry file. The command below reads the system registry of the ~/.wine prefix and returns #arch=win32 or #arch=win64 depending on the architecture type:

$ grep '#arch' ~/.wine/system.reg

Graphics drivers

You need to install the 32-bit version of your graphics driver. Please install the package that is listed in the OpenGL (multilib) column in the table in Xorg#Driver installation.

A good sign that your drivers are inadequate or not properly configured is when Wine reports the following in your terminal window:

Direct rendering is disabled, most likely your OpenGL drivers have not been installed correctly

Note: You might need to restart X after having installed the correct library.

Sound

By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in winecfg.

Install the correct packages for the audio driver you want to use:

  • For ALSA install lib32-alsa-lib and lib32-alsa-plugins
  • For PulseAudio install lib32-libpulse
  • For PipeWire install lib32-pipewire and either:
    • pipewire-pulse and lib32-libpulse to use PulseAudio as a frontend.
    • pipewire-alsa, lib32-alsa-lib, and lib32-alsa-plugins to use ALSA as a frontend.
  • For OSS install lib32-alsa-oss

If winecfg still fails to detect the audio driver (Selected driver: (none)), configure it via the registry. For example, in a case where the microphone was not working in a 32-bit Windows application on a 64-bit stock install of wine-1.9.7, this provided full access to the sound hardware (sound playback and mic): open regedit, look for the key HKEY_CURRENT_USER > Software > Wine > Drivers, and add a string called Audio and give it the value alsa. Also, it may help to recreate the prefix.

MIDI support

MIDI was a quite popular system for video games music in the 90’s. If you are trying out old games, it is not uncommon that the music will not play out of the box.
Wine has excellent MIDI support. However you first need to make it work on your host system, as explained in MIDI. Last but not least you need to make sure Wine will use the correct MIDI output.

Other dependencies

Some applications may require additional packages [1]:

  • For encryption support install lib32-gnutls
  • For media playback in 32-bit programs install lib32-gst-plugins-base, lib32-gst-plugins-good, lib32-gst-plugins-badAUR and lib32-gst-plugins-uglyAUR
  • For NTLM authentication install samba

Fonts

If Wine applications are not showing easily readable fonts, you may not have any fonts installed. To easily link all of the system fonts so they are accessible from wine:

$ cd ${WINEPREFIX:-~/.wine}/drive_c/windows/Fonts && for i in /usr/share/fonts/**/*.{ttf,otf}; do ln -s "$i"; done

Wine uses FreeType to render fonts, and FreeType’s defaults changed a few releases ago. Try using this environment setting for wine programs:

FREETYPE_PROPERTIES="truetype:interpreter-version=35"

Another possibility is to install Microsoft’s TrueType fonts into your wine prefix. If this does not help, try running winetricks corefonts first, then winetricks allfonts as a last resort.

After running such programs, kill all Wine servers and run winecfg. Fonts should be legible now.

If the fonts look somehow smeared, import the following text file into the Wine registry with regedit:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USERSoftwareWineX11 Driver]
"ClientSideWithRender"="N"

For high resolution displays, you can adjust dpi values in winecfg.

See also Font configuration#Applications without fontconfig support.

Enable font smoothing

A good way to improve wine font rendering is to enable cleartype font smoothing.
To enable «Subpixel smoothing (ClearType) RGB»:

/tmp/fontsmoothing.reg
REGEDIT4

[HKEY_CURRENT_USERControl PanelDesktop]
"FontSmoothing"="2"
"FontSmoothingOrientation"=dword:00000001
"FontSmoothingType"=dword:00000002
"FontSmoothingGamma"=dword:00000578
EOF
$ WINE=${WINE:-wine} WINEPREFIX=${WINEPREFIX:-$HOME/.wine} $WINE regedit /tmp/fontsmoothing.reg 2> /dev/null

For more information, check the original answer

When a Windows application installer creates a shortcut Wine creates a .desktop file instead. The default locations for those files in Arch Linux are:

  • Desktop shortcuts are put in ~/Desktop
  • Start menu shortcuts are put in ~/.local/share/applications/wine/Programs/

Note: Wine does not support installing Windows applications for all users, so it will not put .desktop files in /usr/share/applications. See WineHQ bug 11112

Tip: If menu items were not created while installing software or have been lost, wine winemenubuilder may be of some use.

By default, installation of Wine does not create desktop menus/icons for the software which comes with Wine (e.g. for winecfg, winebrowser, etc). This can be achieved by installing wine-installerAUR or wine-installer-gitAUR meta-package (the latter has no additional dependencies), otherwise these instructions will add entries for these applications.

First, install a Windows program using Wine to create the base menu. After the base menu is created, you can create the following files in ~/.local/share/applications/wine/:

wine-browsedrive.desktop
[Desktop Entry]
Name=Browse C: Drive
Comment=Browse your virtual C: drive
Exec=wine winebrowser c:
Terminal=false
Type=Application
Icon=folder-wine
Categories=Wine;
wine-uninstaller.desktop
[Desktop Entry]
Name=Uninstall Wine Software
Comment=Uninstall Windows applications for Wine
Exec=wine uninstaller
Terminal=false
Type=Application
Icon=wine-uninstaller
Categories=Wine;
wine-winecfg.desktop
[Desktop Entry]
Name=Configure Wine
Comment=Change application-specific and general Wine options
Exec=winecfg
Terminal=false
Icon=wine-winecfg
Type=Application
Categories=Wine;

And create the following file in ~/.config/menus/applications-merged/:

wine.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
  <Name>Applications</Name>
  <Menu>
    <Name>wine-wine</Name>
    <Directory>wine-wine.directory</Directory>
    <Include>
      <Category>Wine</Category>
    </Include>
  </Menu>
</Menu>

If these settings produce a ugly/non-existent icon, it means that there are no icons for these launchers in the icon set that you have enabled. You should replace the icon settings with the explicit location of the icon that you want. Clicking the icon in the launcher’s properties menu will have the same effect. A great icon set that supports these shortcuts is gnome-colors-icon-themeAUR.

Menu entries created by Wine are located in ~/.local/share/applications/wine/Programs/. Remove the program’s .desktop entry to remove the application from the menu.

In addition to remove unwanted extensions binding by Wine, execute the following commands: [2]

$ rm ~/.local/share/mime/packages/x-wine*
$ rm ~/.local/share/applications/wine-extension*
$ rm ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*
$ rm ~/.local/share/mime/application/x-wine-extension*

Sometimes you should also remove wine-*.menu files from /.config/menus/ to completely remove items from Wine submenu in KDE.

Appearance

A similar to XP-looking theme can be downloaded. To install it, see this upstream wiki article. Lastly, use winecfg to select it.

Note: The theme linked above can only be installed on 32-bit prefixes with Windows XP as the prefix version. To install it on 64-bit prefixes, you might want to create a temporary 32-bit prefix, install the theme and copy the Zune folder and Zune.theme files from drive_c/Windows/Resources/Themes in that prefix to the same location in your usual prefix.

Wine staging users may instead want to try enabling the option Enable GTK3 Theming under the Staging section of winecfg for a theme that matches the current GTK theme.

Printing

In order to use your installed printers (both local and network) with wine applications in win32 prefixes (e.g. MS Word), install the lib32-libcups package, reboot wine (wineboot) and restart your wine application.

Networking

After installation, the lib32-gnutls package may need to be installed for applications making TLS or HTTPS connections to work.

For ICMP (ping), Wine may need the network access as described in the WineHQ FAQ:

# setcap cap_net_raw+epi /usr/bin/wine-preloader

If issues arise after this (such as an unhandled exception or privileged instruction), remove via:

# setcap -r /usr/bin/wine-preloader

Usage

Warning: Do not run or install Wine applications as root! See Wine FAQ for details.

See Wine User’s Guide for general information on Wine usage.

See Wine Application Database (AppDB) for additional information on specific Windows applications in Wine.

Wayland

Currently Wine does not support Wayland directly, but you can use XWayland instead.

There are some efforts to support Wayland though:

  • Experimental Wayland driver for Wine, which supports using OpenGL- and Windows GDI-applications. See this and this wine-devel maillist entries.
  • wine-wayland: a custom version of Wine, which supports Wayland via Vulkan (so it supports only: DirectX 9, 10 and 11 via #DXVK and Vulkan-compatible applications).

Stop running Wine

Stopping started executables, wine with Ctrl+Z or wineconsole with Ctrl+C, might leave processes running in the background. See for example:

$ ps -xo pid,cmd
    PID CMD
    297 -bash
    933 /usr/bin/wineserver
    939 C:windowssystem32services.exe
    942 C:windowssystem32winedevice.exe
    950 C:windowssystem32explorer.exe /desktop
    954 C:windowssystem32winedevice.exe
    965 C:windowssystem32plugplay.exe
    977 C:windowssystem32svchost.exe -k LocalServiceNetworkRestricted
    984 C:windowssystem32rpcss.exe
    997 mbserver.exe
   1017 start.exe /exec
   1019 C:windowssystem32conhost.exe --unix --width 169 --height 40 --server 0x10
   1021 Z:homewineusermbserver.exe
   1030 ps -xo pid,cmd

All running wine and wineconsole processes are stopped at once using the wineserver -k command. For example:

$ wineserver -k 15

An equivalent command to gracefully finish both executables in the above example is:

$ kill 997 1021

Tips and tricks

Wineconsole

Often you may need to run .exe’s to patch game files, for example a widescreen mod for an old game, and running the .exe normally through Wine might yield nothing happening. In this case, you can open a terminal and run the following command:

$ wineconsole cmd

Then navigate to the directory and run the .exe file from there.

Winetricks

Winetricks is a script to allow one to install base requirements needed to run Windows programs. Installable components include DirectX 9.x, MSXML (required by Microsoft Office 2007 and Internet Explorer), Visual Runtime libraries and many more.

Install the winetricks package (or alternatively winetricks-gitAUR). Then run it with:

$ winetricks

For using GUI you can install either zenity(GTK) or kdialog(Qt).

Performance

CSMT

CSMT is a technology used by Wine to use a separate thread for the OpenGL calls to improve performance noticeably. Since Wine 3.2, CSMT is enabled by default.

Note that CSMT may actually hurt performance for some applications — if this is the case, disable it by runing wine regedit and set the DWORD value for HKEY_CURRENT_USER -> Software > Wine > Direct3D > csmt to 0x00 (disabled).

Further information:

Phoronix Forum discussion with the CSMT developer Stefan Dösinger

Force OpenGL mode in games

Some games might have an OpenGL mode which may perform better than their default DirectX mode. While the steps to enable OpenGL rendering is application specific, many games accept the -opengl parameter.

$ wine /path/to/3d_game.exe -opengl

You should of course refer to your application’s documentation and Wine’s AppDB for such application specific information.

VKD3D-Proton

VKD3D-Proton is a fork of VKD3D which aims to implement the full Direct3D 12 API using Vulkan. The project serves as the development effort for Direct3D 12 support in Proton improving performance and compatibility for DirectX 12 games.

To use it, install vkd3d-proton-mingwAUR or vkd3d-proton-binAUR. Then run the following command to activate it in your Wineprefix (by default ~/.wine):

$ WINEPREFIX=your-prefix setup_vkd3d_proton install

Warning: VKD3D-Proton overrides the DirectX 12 DLL, which may be considered cheating in online multiplayer games, and may get your account banned. Use at your own risk!

DXVK

DXVK is a promising new implementation for DirectX 9, 10 & 11 over Vulkan. This should allow for greater performance, and in some cases, even better compatibility. Battlefield 1 for example, only runs under DXVK. On the other hand, DXVK does not support all Wine games (yet).

To use it, install dxvk-mingwAUR or dxvk-binAUR. Then run the following command to activate it in your Wineprefix (by default ~/.wine):

$ WINEPREFIX=your-prefix setup_dxvk install

Warning: DXVK overrides the DirectX 10 and 11 DLLs, which may be considered cheating in online multiplayer games, and may get your account banned. Use at your own risk!

While using DXVK with a dual graphics setup, Wine prefers the dedicated GPU. On laptops for power saving, this can be overridden:

$ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/your_gpu.json wine executable
HDR support

When paired with Gamescope, DXVK (V2.1+) offers support for HDR10 displays (for AMDGPU users only). See HDR monitor support for details.

Gallium Nine

With the open-source gallium-based drivers (mostly AMD and Intel cards) there is a Gallium Direct3D state tracker that aims to provide nearly-native performance for DirectX 9. In most cases it has less visual glitches than the upstream wine and doubles the performances. It consumes much less CPU time than CSMT.

Install wine-nine to use it. This is a standalone package that can be installed with any Wine version. Use wine ninewinecfg to check if it is enabled.

For older Intel graphics (gen4-7: GMA 3000, GMA 4500, HD 2000-5000; year 2006-2014) Crocus Gallium driver should be used instead of i965 since Mesa 21.2. Export the following environment variable before running Wine:

MESA_LOADER_DRIVER_OVERRIDE=crocus

Unregister existing Wine file associations

By default, Wine takes over as the default application for a lot of formats. Some (e.g. vbs or chm) are Windows-specific, and opening them with Wine can be a convenience. However, having other formats (e.g. gif, jpeg, txt, js) open in Wine’s bare-bones simulations of Internet Explorer and Notepad can be annoying.

Wine’s file associations are set in ~/.local/share/applications/ as wine-extension-extension.desktop files. Delete the files corresponding to the extensions you want to unregister. Or, to remove all wine extensions:

$ rm -f ~/.local/share/applications/wine-extension*.desktop
$ rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*

Next, remove the old cache:

$ rm -f ~/.local/share/applications/mimeinfo.cache
$ rm -f ~/.local/share/mime/packages/x-wine*
$ rm -f ~/.local/share/mime/application/x-wine-extension*

And, update the cache:

$ update-desktop-database ~/.local/share/applications
$ update-mime-database ~/.local/share/mime/

Please note Wine will still create new file associations and even recreate the file associations if the application sets the file associations again.

Prevent Wine from creating filetype associations

Note: This has to be done for each WINEPREFIX which should not update file associations unless you opt to change /usr/share/wine/wine.inf .

This method prevents the creation of filetype associations but retains the creation of XDG .desktop files (that you might see e.g. in menus).

If you want to stop wine from creating filetype associations via winecfg you have to uncheck the «Manage File Associations» checkbox under the Desktop Integration tab. See Wine FAQ

To make the same change via registry add the string Enable with value N under:

HKEY_CURRENT_USERSoftwareWineFileOpenAssociations

You might have to create the key FileOpenAssociations first!

To make this change via the command-line, run the following command:

$ wine reg add "HKEY_CURRENT_USERSoftwareWineFileOpenAssociations" /v Enable /d N

If you want to apply this by default for new WINEPREFIXES, edit /usr/share/wine/wine.inf and add this line for example under the [Services] section:

HKCU,"SoftwareWineFileOpenAssociations","Enable",2,"N"

To prevent a package upgrade from overriding the modified file, create a pacman hook to make the change automatically:

/etc/pacman.d/hooks/stop-wine-associations.hook
[Trigger]
Operation = Install
Operation = Upgrade
Type = Path
Target = usr/share/wine/wine.inf

[Action]
Description = Stopping Wine from hijacking file associations...
When = PostTransaction
Exec = /bin/sh -c '/usr/bin/grep -q "HKCU,"Software\Wine\FileOpenAssociations","Enable",2,"N"" /usr/share/wine/wine.inf || /usr/bin/sed -i "s/[Services]/[Services]nHKCU,"Software\Wine\FileOpenAssociations","Enable",2,"N"/g" /usr/share/wine/wine.inf'

See Pacman#Hooks for more information.

Execute Windows binaries with Wine implicitly

The wine package installs a binfmt file which will allows you to run Windows programs directly, e.g. ./myprogram.exe will launch as if you had typed wine ./myprogram.exe. Service starts by default on boot, if you have not rebooted after installing Wine you can start systemd-binfmt.service to use it right away.

Note: Make sure the Windows binary is executable, otherwise the binary will not run.

Dual Head with different resolutions

If you have issues with dual-head setups and different display resolutions you are probably missing lib32-libxrandr.

Also installing lib32-libxinerama might fix dual-head issues with wine (for example, unclickable buttons and menus of application in the right most or bottom most monitor, not redrawable interface of application in that zone, dragging mouse cursor state stucked after leaving application area).

Burning optical media

To burn CDs or DVDs, you will need to load the sg kernel module.

Proper mounting of optical media images

Some applications will check for the disc to be in drive. They may check for data only, in which case it might be enough to configure the corresponding path as being a CD-ROM drive in winecfg.
However, other applications will look for a name and/or a serial number, in which case the image has to be mounted with these special properties.

Some virtual drive tools do not handle these metadata, like fuse-based virtual drives (Acetoneiso for instance). CDemu will handle it correctly.

Show FPS overlay in games

Wine features an embedded FPS monitor which works for all graphical applications if the environment variable WINEDEBUG=fps is set. This will output the framerate to stdout. You can display the FPS on top of the window thanks to osd_cat from the xosd package. See winefps.sh for a helper script.

Running Wine under a separate user account

It may be desirable to run Wine under a specifically created user account in order to reduce concerns about Windows applications having access to your home directory.

First, create a user account for Wine:

# useradd -m -s /bin/bash wineuser

Now switch to another TTY and start your X WM or DE as you normally would or keep reading…

Note: The following approach only works when enabling root for Xorg. See Xorg#Rootless Xorg for more information on how to execute the xhost command under your main user.

Afterwards, in order to open Wine applications using this new user account you need to add the new user to the X server permissions list:

$ xhost +SI:localuser:wineuser

Finally, you can run Wine via the following command, which uses env to launch Wine with the environment variables it expects:

$ sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine arguments

It is possible to automate the process of running Windows applications with Wine via this method by using a shell script as follows:

/usr/local/bin/runaswine
#!/bin/sh
xhost +SI:localuser:wineuser
sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine "$@"

Wine applications can then be launched via:

$ runaswine "C:pathtoapplication.exe"

In order to not be asked for a password each time Wine is run as another user the following entry can be added to the sudoers file: mainuser ALL=(wineuser) NOPASSWD: ALL. See Sudo#Configuration for more information.

It is recommended to run winecfg as the Wine user and remove all bindings for directories outside the home directory of the Wine user in the «Desktop Integration» section of the configuration window so no program run with Wine has read access to any file outside the special user’s home directory.

Keep in mind that audio will probably be non-functional in Wine programs which are run this way if PulseAudio is used. See PulseAudio/Examples#Allowing multiple users to share a PulseAudio daemon for information about allowing the Wine user to access the PulseAudio daemon of the principal user.

Temp directory on tmpfs

To prevent Wine from writing its temporary files to a physical disk, one can define an alternative location, like tmpfs. Remove Wine’s default directory for temporary files and creating a symlink:

$ rm -r ~/.wine/drive_c/users/$USER/Temp ~/.wine/drive_c/windows/temp
$ ln -s /tmp/ ~/.wine/drive_c/users/$USER/Temp
$ ln -s /tmp/ ~/.wine/drive_c/windows/temp

Prevent installing Mono/Gecko

If Gecko and/or Mono are not present on the system nor in the Wine prefix, Wine will prompt to download them from the internet. If you do not need Gecko and/or Mono, you might want to disable this dialog, by setting the WINEDLLOVERRIDES environment variable to mscoree=d;mshtml=d.

Vulkan

The default Wine Vulkan ICD loader works fine for most applications, but does not support advanced features, like Vulkan layers. To use these features, you have to install the official Vulkan SDK, see step 2-4 on the original Vulkan patches author’s GitHub page.

Remove Wine file bindings

For security reasons it may be useful to remove the preinstalled Wine bindings so Windows applications cannot be launched directly from a file manager or from the browser (Firefox offers to open EXE files directly with Wine!).
If you want to do this, you may add the following to the [options] section in /etc/pacman.conf

NoExtract = usr/lib/binfmt.d/wine.conf
NoExtract = usr/share/applications/wine.desktop

WineASIO

If you need professional audio support under wine you can use wineasioAUR which provides an ASIO interface for wine that you can then use with JACK.

In order to use wineasio you must add yourself to the realtime user group.

Next you need to register wineasio in your desired wine prefix. Register the 32-bit and/or 64-bit version as needed:

$ regsvr32 /usr/lib32/wine/i386-windows/wineasio.dll
$ wine64 regsvr32 /usr/lib/wine/x86_64-windows/wineasio.dll

Disable starting explorer.exe

If you run a text mode (Command User Interface) executable without X installed, these errors might appear while starting the executable:

0060:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0060:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0060:err:systray:initialize_systray Could not create tray window

This is because wine by default starts explorer.exe. Even wineconsole starts explorer.exe /desktop according to ps output.

Starting explorer including systray can be disabled with this environment setting:

$ WINEDLLOVERRIDES="explorer.exe=d" wine program.exe

Depending on your CUI program, you might be able to use it with lowest memory footprint by disabling services.exe too:

$ WINEDLLOVERRIDES="explorer.exe,services.exe=d" wine program.exe

Troubleshooting

See Wine User’s Guide and Wine FAQ (especially its Troubleshooting section) for general tips.

Also refer to the Wine AppDB for an advice on specific applications.

XWayland problems

If you use Wine under XWayland, you can activate the option for «Emulating a virtual desktop» in the Graphics Tab in winecfg, to avoid problems with:

  • flickering;
  • wrong window location;
  • wrong mouse cursor location and clicks;
  • keyboard detection.

Keyboard input not working

This could be caused by the window manager not switching focus. In the Graphics tab of winecfg, disable the ‘Allow the window manager…’ options, or set windowed mode with ‘Emulate a virtual desktop’.

  • Some suggest to toggle all the Window settings, click Apply, then change them back. If that does not work, try the above.

If the keyboard does not work after unfocusing the application, try editing the registry:

  • Under HKEY_CURRENT_USERSoftwareWineX11 Driver, add a string value UseTakeFocus and set it to N.
  • Alternatively, you can use winetricks to set the value:
    $ winetricks usetakefocus=n

Wine is setting its own applications as defaults

Every time Wine creates (or updates) a prefix it will set its own bundled apps like Notepad and Winebrowser as the default text editor and web browser accordingly.

A way to work around this undesirable behavior is by using this environment variable:

$ WINEDLLOVERRIDES=winemenubuilder.exe=d ...

See also

  • Wine Homepage
  • Wine Wiki
  • Wine Application Database (AppDB) — Information about running specific Windows applications (Known issues, ratings, guides, etc tailored to specific applications)
  • Wine Forums — A great place to ask questions after you have looked through the FAQ and AppDB
  • Gentoo:Wine
  • Darling — a similar project for MacOS software
  • WineASIO — GitHub page of the WineASIO project with further information

Contents

  1. Introduction
  2. Installing Wine

    1. Ubuntu versions of Wine (Recommended)
    2. Newer versions of Wine (Not Recommended)
  3. Initial Setup
  4. Installing Windows Applications With Wine
  5. To start/run Windows programs using Wine
  6. Uninstalling Wine Applications
  7. Configuring Wine

    1. Adding CD and DVD drives to Wine
    2. Adding applications to the menu
    3. Changing application specific settings

      1. Using Windows Themes/Skins In Wine
      2. Color Scheme
      3. Using Theme/Skins
    4. Fullscreen issues with overlapping Panel
  8. Instructions for using wine over remote X11 sessions
  9. Instructions for specific Windows programs
  10. Creating file associations
  11. Troubleshooting

    1. Error: Cannot change screen BPP from 32 to XX
    2. ‘dhtmled.ocx’ is missing or invalid
    3. Screen flickers to black when starting an application
  12. Related Wiki Pages

Introduction

  • Wine allows you to run many Windows programs on Linux. Its homepage can be found at WineHQ.org. They also have an Ubuntu page with installation and build advice.

  • If you are running the latest release of Wine which is v1.6, you can get further assistance on the #winehq IRC channel on irc.freenode.net. First,

  • please consider if you really need to run the specific Windows program because in most cases, its equivalent can be provided by an OpenSource program. Also, consider using Qemu instead of Wine if you need a complete Windows installation.

Installing Wine

Ubuntu versions of Wine (Recommended)

  • open the software center
  • Type wine and install ‘wine’

Newer versions of Wine (Not Recommended)

The Wine Ubuntu repository provides the newest development versions of Wine. Follow these steps to add the repository to your software sources:

  1. Open a terminal and run these commands:
  1. wget https://dl.winehq.org/wine-builds/winehq.key

  1. sudo apt-key add winehq.key

  2. sudo apt-add-repository ‘https://dl.winehq.org/wine-builds/ubuntu/’

Note, however, that these are development packages (ie beta software), and may suffer from regressions and other problems not present in the stable version of Wine included with Ubuntu. You should avoid using them unless the current stable version of Wine does not support or is incompatible with the application you wish to use.

If you are using an older version of Wine and want support from WineHQ, you will need to upgrade to the latest development version first. If you do this, however, please file associated Wine bugs at winehq’s Bugzilla Page rather than in Launchpad.

Initial Setup

Before using Wine, it is necessary to create the fake C: drive where your Windows applications will be installed. To do this, enter the following command into the terminal: You may find the terminal by going to Applications -> Accessories -> Terminal

winecfg

You also have the option of configuring Wine via the Configure Wine option in the Applications-> Wine menu.

This will create a hidden folder (.wine) in your home directory containing the fake C: drive as well as registry files similar to those used in Windows. Once this directory is created, the Wine Configuration Window will appear. This window will allow you to customize a variety of settings for Wine, including which Windows Version that is emulated, drive mappings, DLL overrides, as well as application specific settings. Click the Ok button to close the window.

Installing Windows Applications With Wine

To install Windows applications using Wine, follow these instructions:

  1. Download the Windows application from any source (e.g. download.com). Download the .EXE (executable).
  2. Place it in a convenient directory (e.g. the desktop, or home folder).
  3. Open the terminal, and cd into the directory where the .EXE is located.

  4. Type wine the-name-of-the-application.extension (e.g. wine realplayer_installer.exe).

This will start the .EXE using Wine. If it is an installer, it should then run as it would in Windows. If the application asks for a directory to install the application to, select put it under C:Program Files.

To start/run Windows programs using Wine

After installing an application using the directions above, those applications can be started and used by entering wine programname.exe (e.g. wine realplayer.exe). When done, close the application as one would normally. You must run the installed executable, which will by default be in the virtual Windows drive created by Wine, at ~/.wine/drive_c. Generally programs will install themselves somewhere under Program Files inside the virtual Windows drive, following Windows conventions.

You can also use the Wine file browser, by running winefile in a terminal. Clicking the C: button in the toolbar will open a window where you can browse the virtual Windows drive created in .wine. Doubleclicking an executable in the Wine file browser will run it in Wine.

Instead of having to always enter the terminal or use the Wine file browser, you may also create a desktop icon, and start a Wine application using that icon. To do this, right click on the desktop and select «Create a launcher.» If you wish, select an icon from the list of available icons (or browse to an icon you would like to use), fill out other information that is requested (Name, generic name, etc.). For the command, type in wine the-location-of-the-program.exe (e.g. wine /home/john/.wine/realplayer.exe). The most important part of creating a launcher is the command, the generic name is not as important. Just make sure you de-select «Run in terminal.» This completes the process.

In some cases the application requires to be running from a certain location. In this case create launcher with command

sh -c "cd /home/USER/.wine/drive_c/Program Files/Appdir/; wine /home/USER/.wine/drive_c/Program Files/Appdir/game.exe"

Of course you will need to replace USER and Appdir with the proper data.

If you desire to have an icon on the panel, create a launcher on the panel of choice. Do this by right-clicking the panel, selecting «Add to Panel,» and selecting «Custom Application Launcher.» This will ask you for the same information as before.

Alternatively, to make life easier, you can set it so wine will automatically open .exe files files for you — instead of using the Wine File to locate the file each time. To do so, right click on the .exe file, select Properties, and then select the Open With tab. Click the ‘Add’ button, and then click on ‘Use a custom command’. In the line that appears, type in wine, then click Add, and Close. Now all .exe files will be automatically opened by Wine, so you can use Nautilus to browse and open them instead of the Wine File.

Uninstalling Wine Applications

Open up a terminal window and type the command below.

wine uninstaller

What this will do is open up a program similar to the Windows add/remove programs control panel, allowing you to uninstall applications from a Wine installation. Running uninstall programs directly via Wine should also work normally. Alternatively, you could also simply delete the folder of the application. However, as when done in Windows, this method will be unclean and will not remove the program’s configuration from the Wine registry like using an uninstaller will.

Configuring Wine

On the command line or in Run Application, type winecfg

Adding CD and DVD drives to Wine

Go to the drives tab in winecfg. Hit the Autodetect button.

If you find that this does not work correctly for you, then follow these instructions:

  1. Run

    winecfg

  2. Navigate to the drives tab

  3. Click on Add…

  4. In the path bar, type

    /media/cdrom

  5. Click Show Advanced button below the Browse… button and set the Type to

    CD-ROM

  6. Click OK

If you have more than one CD/DVD device you will need to identify each one differently. Use /media/cdrom0 for the first CD/DVD device, /media/cdrom1 for the second one, and so on. If in doubt, type the following command in your terminal.

ls -la ~/.wine/dosdevices/

What this command will do is check your CD/DVD device details after Wine is installed.

It is good procedure before setting up the menu entry to launch the new Windows program from the command line to make sure the program runs properly. To do this type this command in the terminal.

wine "C:PATHTOPROGRAMProgram.exe" 

For example the command would be wine «C:Program FilesWorld of WarcraftWoW.exe» Once you are satisfied that you have the correct details, use the normal menu editing process to add a new entry. When you get to the Command field of the entry editor be sure to copy and paste the line you used to launch the program from the terminal. Finish and save the new entry. Test to make sure the new Windows program loads via the menu.

Changing application specific settings

  1. Type this command into your terminal.

    winecfg

  2. Click on Add Application…

  3. Navigate to where the .exe is and choose that program
  4. The dropdown at the bottom allows you to choose which version of Windows Wine should emulate. Also, any changes to the Libraries and Graphics tabs will only affect the chosen application in the Applications tab.

Using Windows Themes/Skins In Wine

Color Scheme

You can change the wine color scheme to closely match the default Ubuntu colors with this Terminal command.

gedit ~/.wine/user.reg

You may also want to create a backup copy in your Home folder with this command via terminal.

cp ~/.wine/user.reg ~/

Replace the [Control Panel\Colors] section with

[Control Panel\Colors] 1176981676
"ActiveBorder"="239 235 231"
"ActiveTitle"="203 133 61"
"AppWorkSpace"="198 198 191"
"Background"="93 77 52"
"ButtonAlternativeFace"="200 0 0"
"ButtonDkShadow"="85 85 82"
"ButtonFace"="239 235 231"
"ButtonHilight"="255 255 255"
"ButtonLight"="255 255 255"
"ButtonShadow"="198 198 191"
"ButtonText"="0 0 0"
"GradientActiveTitle"="239 235 231"
"GradientInactiveTitle"="239 235 231"
"GrayText"="198 198 191"
"Hilight"="246 200 129"
"HilightText"="0 0 0"
"InactiveBorder"="239 235 231"
"InactiveTitle"="239 235 231"
"InactiveTitleText"="255 255 255"
"InfoText"="0 0 0"
"InfoWindow"="255 255 166"
"Menu"="239 235 231"
"MenuBar"="239 235 231"
"MenuHilight"="246 200 129"
"MenuText"="0 0 0"
"Scrollbar"="239 235 231"
"TitleText"="255 255 255"
"Window"="255 255 255"
"WindowFrame"="0 0 0"
"WindowText"="0 0 0"

Using Theme/Skins

Wine has basic handling for Windows theme/skin files in the «msstyles» format. There is a large number of these themes on Deviant Art. To use these you must make a folder in Wine’s virtual Windows drive, then tell Wine to use the theme.

Firstly go into Wine’s virtual drive, which is usually «.wine/drive_c» in your Home folder (this is hidden, you may need to select View->Show Hidden Files in the file manager). Inside this folder go into the «windows» folder then make a new folder in there called «Resources». Enter this new folder and make a new folder called «Themes». Inside here you should make a folder for each theme you want, and put the files ending in «.msstyles» directly into them. For example, the full path to a theme file called sample.msstyles might be «/home/username/.wine/drive_c/windows/Resources/Themes/Sample/sample.msstyles».

Next you need to tell Wine to use your theme, so once again run this command in the terminal.

winecfg

In the configuration window select the tab Desktop Integration and un-check out the Theme: box, which should now have your theme in it’s menu. After selecting the theme click Apply at the bottom to see how it looks (they don’t always display properly), then if you are happy click ok and you’re done!

Fullscreen issues with overlapping Panel

Sometimes the Panel overlaps your fullscreen application you’re running in wine. If you are running Visual Effects, the first solution you should try is to turn those off: Go to System -> Preferences -> Appearance, and click the Visual Effects tab. Select None, and your screen will flash. Try your full-screen application again. You may re-enable Visual Effects afterwards — just don’t forget to turn them back off when you want to run that application again!

If that does not work, then you will have to turn off the panels prior to running the application and restarting it afterwards, until a better workaround can be found. In Ubuntu the commands are gnome-session-remove gnome-panel and gnome-panel & respectively. In Xubuntu I understand they are killall xfce4-panel and xfce4-panel.

Instructions for using wine over remote X11 sessions

If you’re (trying) to use wine over a forwarded X11 session (ie Ubuntu is on one computer; you’re connected to it by ssh or another connection and you already have X11 forwarding set up to display regular Ubuntu applications on your remote computer) and the windows opened by wine are lacking fonts etc, the answer is here

Instructions for specific Windows programs

Some Windows programs have been tested on Ubuntu. They are listed below:

  • DVDShrink

  • FlashPlayerStandalone

  • WorldofWarcraft

Also, see Wine’s Application Database at http://appdb.winehq.org/ or http://wine-review.blogspot.com/

Creating file associations

If you want certain files to open in a windows application by clicking on them, the best way is to create a script. For example I want Adobe Flash project files (*.fla) to open in Adobe’s Flash editor if I double click it.

You can for example create a file using this terminal command.

gedit ~/.wine/Flash 8

Now paste the following example script in it, save and close gedit.

Example script:

 #!/bin/sh

QUICKPARLOCATION="c:\Program Files\Macromedia\Flash 8\Flash.exe"
PARAM=`winepath -w "$*"`
wine "$QUICKPARLOCATION" "$PARAM"
exit 0

Make sure the file is executable with this command.

chmod +x ~/.wine/Flash 8

After you completed this go to an *.fla file right click it, properties, go to the “open with” pane, click add, add this line into your terminal and select the radio button.

'/home/<yourusername>/.wine/Flash 8'

Now if everything went ok, you can doubleclick the file and it will be openend in Flash 8.

Troubleshooting

Error: Cannot change screen BPP from 32 to XX

In some cases (mostly games) the application does not start and you get error: Cannot change screen BPP from 32 to 16 (or some other number).

In such case editing xorg.conf and CTRL-ALT-Backspace helps as is described on http://ubuntuforums.org/showthread.php?t=649283

‘dhtmled.ocx’ is missing or invalid

It seems that in Ubuntu Karmic Wine(v1.0.1) registry isn’t configured correctly to use ActiveX component dhtmled.ocx. On some application this can cause error like this: «Component ‘dhtmled.ocx’ or one of it’s dependencies not correctly registered: a file is missing or invalid». So we must tell Wine where to find this file.

1. Download registry file:

  • cd ~ wget http://jwc.sourceforge.net/other/ieslinux-dhtmledit.reg

2. Open regedit:

  • wine regedit.exe

3. Import the downloaded registry settings

  • file->import registry file->open ~/ieslinux-dhtmledit.reg

Screen flickers to black when starting an application

This is sometimes caused by a problem with the video driver not handling XRandR well. To see if this is actually a problem with XRandR, in a console, run:

xrandr

If your screen blanks while running that command, then this might be the issue. To work around this issue, Wine can be configured to not use XRandR. To do so:

  1. Start Wine’s Registry Editor.
  2. Navigate to «HKEY_CURRENT_USERSoftwareWineX11 Driver». You may need to create X11 Driver.
  3. Create a new key called «UseXRandR» and set it to «N».

See Wine Bug #15214 and Wine Wiki page UsefulRegistryKeys.

  • Games

  • AdobePhotoshop — A guide for running CS4 under WINE.


Понравилась статья? Поделить с друзьями:
  • Газовая печь веко с электродуховкой инструкция по применению
  • Инструкция по эксплуатации туалетной бумаги прикол фото
  • Газовая колонка baxi eco 4s инструкция для чайников на русском
  • Тримедат таб 200мг 30 шт инструкция
  • Диктофон savetek gs r07 инструкция по эксплуатации