Run the script
-
Save the script below as
install-wine.shon your computer. -
Send it to the sandbox in one of these ways:
Surface How CLI boat ssh bx_f7k2q9hd 'bash -s' < install-wine.shAPI Pass the script as the commandofPOST /sandboxes/{sandboxId}/commands, withdetached: true.SDK Pass the script to the commandcall, withdetached: true. - For the API and the SDK, poll the command status until the command finishes.
Without
detached, the command stops after its 30-second default timeout. Wine is then only half installed.install-wine.sh
set -e
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -qO /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -qNP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources
printf 'Package: libgd3\nPin: release o=Ubuntu\nPin-Priority: 1001\n' | sudo tee /etc/apt/preferences.d/wine-libgd3
sudo apt-get update -qq
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --allow-downgrades --no-install-recommends \
winehq-staging mesa-vulkan-drivers mesa-vulkan-drivers:i386 cabextract p7zip-full
sudo wget -qO /usr/local/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
sudo chmod +x /usr/local/bin/winetricks
export DISPLAY=:0
WINEDLLOVERRIDES="mscoree,mshtml=" wineboot -i
winetricks -q corefonts vcrun2022 dxvk d3dcompiler_47
wine --version
What each part does
| Part | Why it is there |
|---|---|
| WineHQ staging | Ubuntu’s own Wine is version 9. Steam, Paint.NET 5.2 and Direct3D games need Wine 11 or newer. |
The libgd3 pin | The sandbox has a PHP repository. Its libgd3 exists only for 64-bit. 32-bit Wine needs the same version for both. The pin selects Ubuntu’s version. As a side effect, PHP’s gd extension is removed. |
mesa-vulkan-drivers | A sandbox has no GPU. This software Vulkan driver lets DXVK run Direct3D 8 to 11 on the CPU. |
WINEDLLOVERRIDES="mscoree,mshtml=" | A new Wine set-up opens a “Wine Mono Installer” window and waits for a click. This setting skips that window. Apps that need .NET get Microsoft’s runtime from winetricks instead. |
| winetricks | Installs Microsoft’s free redistributables: core fonts, the Visual C++ 2015 to 2022 runtime, DXVK and the Direct3D shader compiler. |