Skip to content

Instantly share code, notes, and snippets.

@RobinCPC
Last active March 25, 2024 09:38
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save RobinCPC/9f42be23a1343600507aabdfecc5061d to your computer and use it in GitHub Desktop.
Save RobinCPC/9f42be23a1343600507aabdfecc5061d to your computer and use it in GitHub Desktop.
Wine Setup

Install Wine with Mono & Gecko in Ubuntu 20.04

Warning: Do not try those command in your main PC, I test in a virtual Machine

Note: Most of commands are from the Dockerfile in Reference section. If you want to test wine, just run their docker container

1. Setup PPA

sudo dpkg --add-architecture i386
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
# for Ubuntu 20.04
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'

2. Install Wine on Ubuntu

sudo apt-get update
sudo apt-get -y install winehq-stable=7.0.0.0~focal-1
# if ask paudio (or similar) different from ...., I choose to use Default [N]

3. Check Wine Version

wine --version
# It will prompt `wine-7.0`

4. Install Mono

sudo mkdir /opt/wine-stable/share/wine/mono
sudo wget -O - https://dl.winehq.org/wine/wine-mono/7.0.0/wine-mono-7.0.0-x86.tar.xz | sudo tar -xJv -C /opt/wine-stable/share/wine/mono

5. Download Gecko

sudo mkdir /opt/wine-stable/share/wine/gecko
sudo wget -O /opt/wine-stable/share/wine/gecko/wine-gecko-2.47.1-x86.msi https://dl.winehq.org/wine/wine-gecko/2.47.1/wine-gecko-2.47.1-x86.msi
sudo wget -O /opt/wine-stable/share/wine/gecko/wine-gecko-2.47.1-x86_64.msi https://dl.winehq.org/wine/wine-gecko/2.47.1/wine-gecko-2.47.1-x86_64.msi

After above steps, you should find wine-mono & wine-gecko as following screenshots: Where to find wine-mono Where to find wine-gecko

6. Set WINE env config in bashrc

note: do not run any windows program before this setup Run following lines will add WINE env config in your .bashrc file

# Wine Setup
echo "export WINEPREFIX=~/prefix32" >> ~/.bashrc
echo "export WINEARCH=win32" >> ~/.bashrc

7. Run explore.exe to setup wine folder automatically.

Use following command in bash terminal, and it will take a while for setup.

wine /opt/wine-stable/lib/wine/i386-windows/explorer.exe
# or
/opt/wine-stable/bin/wine /opt/wine-stable/lib/wine/i386-windows/explorer.exe

Here is screenshot of Windows explorer Windows explorer

If setup successfully, go to My Computer -> Control Panel -> Add/Remove Programs. Then, there should have Wine Mono Windows Support and Wine Gecko.
Here are some screenshots:

  • After double clicks My Computer After double clicks My Computer

  • After double clicks Control Panel After double clicks Control Panel

8. Manually install Mono and Gecko

After you double click Add/Remove Programs, nothing happenned or prompt some error message (such as no suitable program to open Add/Remove Programs). You may need to install Mono and Gecko, I used following steps.

8.1 Open control.exe in system32

  • Go to My Computer -> C: -> Windows -> system32, find control.exe and double clicks it Screenshot from 2022-07-15 00-40-30

  • Double click Add/Remove Programs Screenshot from 2022-07-15 00-40-42

If there is no any program on the list (in the middle of Add/Remove Programs window), need to install manually.

8.2 Install wine-gecko

  • Click Install button on the Add/Remove Programs window, then, It will show up file dialog. Find the wine-gecko-x86.msi file which download in previous step, and select & open it. Screenshot from 2022-07-15 00-41-14 Then, wine-gecko should show up on the Add/Remove Programs window. Screenshot from 2022-07-15 00-41-57

8.3 Install wine-mono

  • Click Install button on the Add/Remove Programs window, then, It will show up file dialog. Find the winemono-support.msi file which download in previous step, and select & open it. Screenshot from 2022-07-15 00-42-32 Then, Wine Mono Windows Support should show up on the Add/Remove Programs window. Screenshot from 2022-07-15 01-05-08

Test some Windows programs with Wine

Here are some screenshots:

Run PuTTY Screenshot from 2022-07-15 00-54-53

Run Bult-in Windows programs (such as Task Manager, Notepad, and cmd.exe), you can find them in system32 folder Screenshot from 2022-07-15 00-39-17

Reference:

https://github.com/solarkennedy/wine-x11-novnc-docker/blob/master/Dockerfile
https://tecadmin.net/install-wine-on-ubuntu/

@bennylangston
Copy link

nothing works

@eusoubrasileiro
Copy link

that's true wine seams kinda dead

@weirdal3333
Copy link

This tutorial only shows how to download the wine gecko installer files, not how to install them.
It's not even up to date. Use the guide in te official wine website instead.

@Tower-Yikk
Copy link

And how do I do that? The instructions are very unclear on how to do so in the website.

@weirdal3333
Copy link

Download the msi from here: https://dl.winehq.org/wine/wine-mono/
Run the uninstaller: wine64 uninstaller
Select the msi that you downloaded, and click install.

You can also just install winetricks and install dotnet48. Run these commands individually.
sudo apt update && sudo apt install winetricks
sudo winetricks --self-update
winetricks dotnet48

Mono is just a slim replacement for Microsoft .net framework, after all.

@Marietto2008
Copy link

Marietto2008 commented Jul 13, 2022

Download the msi from here: https://dl.winehq.org/wine/wine-mono/
Run the uninstaller: wine64 uninstaller
Select the msi that you downloaded, and click install.

=

marietto@marietto-BHYVE:~$ wine64 uninstaller

wine: created the configuration directory '/home/marietto/.wine'
0040:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0040:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
002c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
002c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0048:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0048:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0050:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0050:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0050:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0050:err:ole:start_rpcss Failed to open RpcSs service
0040:err:setupapi:SetupDefaultQueueCallbackW copy error 1812 L"@wineusb.sys,-1" -> L"C:\\windows\\inf\\wineusb.inf"
0064:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0064:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
006c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
006c:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
Could not find Wine Gecko. HTML rendering will be disabled.
0074:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0074:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00a0:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00a0:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00a8:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00a8:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
Could not find Wine Gecko. HTML rendering will be disabled.
00b0:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00b0:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00d0:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00d0:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
wine: configuration in L"/home/marietto/.wine" has been updated.
0024:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0024:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00e4:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00e4:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00f0:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00f0:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00f0:fixme:file:NtLockFile I/O completion on lock not implemented yet
00f0:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
00f0:err:mscoree:LoadLibraryShim error reading registry key for installroot
00f0:err:mscoree:LoadLibraryShim error reading registry key for installroot
00f0:err:mscoree:LoadLibraryShim error reading registry key for installroot
00f0:err:mscoree:LoadLibraryShim error reading registry key for installroot
00f8:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00f8:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00f8:fixme:file:NtLockFile I/O completion on lock not implemented yet
00f8:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
00f8:err:mscoree:LoadLibraryShim error reading registry key for installroot
00f8:err:mscoree:LoadLibraryShim error reading registry key for installroot
00f8:err:mscoree:LoadLibraryShim error reading registry key for installroot
00f8:err:mscoree:LoadLibraryShim error reading registry key for installroot
0100:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0100:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0108:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0108:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0110:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
0110:fixme:font:get_name_record_codepage encoding 20 not handled, platform 1.
00f8:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)
00f8:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)
00f0:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)
00f0:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)

or

marietto@marietto-BHYVE:~$  winetricks dotnet48

Executing mkdir -p /home/marietto
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Using winetricks 20220411-next - sha256sum: 9013b68a97e1f6e7c660b605af27a196509ba2f00cd72bf614cbf79651dad222 with wine-6.0.3 (Ubuntu 6.0.3~repack-1) and WINEARCH=win64
Executing w_do_call dotnet48
Executing mkdir -p /home/marietto
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_dotnet48 
------------------------------------------------------
warning: This package (dotnet48) is broken in wine-6.0.3. Broken since 5.18. Upgrade to >=6.6. See https://bugs.winehq.org/show_bug.cgi?id=49897 for more info. Use --force to try anyway.

@weirdal3333
Copy link

weirdal3333 commented Jul 13, 2022 via email

@Marietto2008
Copy link

Marietto2008 commented Jul 13, 2022

export WINEPREFIX=~/prefix32 
export WINEARCH=win32

marietto@marietto-BHYVE:~$  winetricks dotnet48

Executing mkdir -p /home/marietto
------------------------------------------------------
Using winetricks 20220411-next - sha256sum: 9013b68a97e1f6e7c660b605af27a196509ba2f00cd72bf614cbf79651dad222 with wine-6.0.3 (Ubuntu 6.0.3~repack-1) and WINEARCH=win64
Executing w_do_call dotnet48
Executing mkdir -p /home/marietto
------------------------------------------------------
Executing load_dotnet48 
------------------------------------------------------
warning: This package (dotnet48) is broken in wine-6.0.3. Broken since 5.18. Upgrade to >=6.6. See https://bugs.winehq.org/show_bug.cgi?id=49897 for more info. Use --force to try anyway.

@weirdal3333
Copy link

weirdal3333 commented Jul 13, 2022 via email

@ShiiBuukii
Copy link

Work like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment