Windows apps (Wine)
A sandbox can run many Windows programs on its desktop with Wine. They open as ordinary windows: you watch them with froog desktop, and agents drive them with the computer tools (screenshots, clicks and keys, Wine programs have no accessibility tree). Install once, then save the sandbox as a snapshot and start new sandboxes from it.
Install Wine. Save this as install-wine.sh and run it in the background (it takes several minutes, longer than a plain froog exec waits):
$ froog exec my-box --detach -- bash -s < install-wine.sh
$ froog logs my-box JOB -f
set -e
. /etc/os-release
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
# WineHQ's packages for this release (Ubuntu or Debian); the distribution's own Wine if it has none yet
if sudo wget -qNP /etc/apt/sources.list.d/ "https://dl.winehq.org/wine-builds/$ID/dists/$VERSION_CODENAME/winehq-$VERSION_CODENAME.sources"; then
sudo apt-get update -qq
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --install-recommends winehq-stable
else
sudo apt-get update -qq
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq wine
fi
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends cabextract p7zip-full mesa-vulkan-drivers
sudo wget -qO /usr/local/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
sudo chmod +x /usr/local/bin/winetricks
bash ~/.froog/desktop/desktop.sh >/dev/null # the desktop, display :1
export DISPLAY=:1
WINEDLLOVERRIDES="mscoree,mshtml=" wineboot -i # no "Wine Mono Installer" window waiting for a click
winetricks -q corefonts vcrun2022
wine --version
WineHQ's builds are newer than Ubuntu's and Debian's own Wine, which many current programs need. winetricks adds Microsoft's free redistributables: the core fonts and the Visual C++ 2015-2022 runtime. Programs that need .NET get it the same way (winetricks -q dotnet48), and Direct3D programs winetricks -q dxvk, which runs on the CPU through mesa-vulkan-drivers (sandboxes have no GPU, so only light 3D is usable). On Omarchy, install wine and winetricks with pacman from the multilib repository instead.
Install and start a program. Download the vendor's installer in the sandbox, install it silently, and start it with wine start /unix. Every command that opens a window needs DISPLAY=:1:
# in the sandbox (froog ssh my-box): 7-Zip, from 7-zip.org
export DISPLAY=:1
curl -fsSLo /tmp/7z.exe https://www.7-zip.org/a/7z2501-x64.exe
wine /tmp/7z.exe /S
wine start /unix "$HOME/.wine/drive_c/Program Files/7-Zip/7zFM.exe"
- Silent switches:
/Sfor NSIS installers,/VERYSILENTfor Inno Setup,msiexec /i app.msi /qnfor MSI. TheInstallerUrlin a program's winget manifest is the vendor's own download link. wine start /unix PATHgives the program normal Windows console handles. Some programs crash without them.C:\is~/.wine/drive_c, andZ:\is the Linux root/.- Licence windows on first start (e.g. Sysinternals tools) can be accepted beforehand in the registry, so an agent doesn't have to:
wine reg add 'HKCU\Software\Sysinternals\Process Explorer' /v EulaAccepted /t REG_DWORD /d 1 /f. - Old games that change the screen resolution:
wine reg add 'HKCU\Software\Wine\X11 Driver' /v UseXRandR /t REG_SZ /d N /f.
Set up once, start many. Wine and its programs are in ~/.wine and the system packages, so a snapshot keeps both: froog snapshot my-box --name wine-apps, then froog new task-1 --from wine-apps for each task. Running programs don't survive a stop or a fork: start them again.
Which programs run. We haven't verified any Windows program on froog yet. Programs that Wine runs well elsewhere and that make good first tries: Notepad++, 7-Zip, WinMerge, HxD, IrfanView, Sysinternals Process Explorer, LTspice. Programs that load Windows kernel drivers (hardware tools, anti-cheat, some VPN and backup software) don't run under Wine at all. Wine's AppDB has reports for most programs.
| Problem | Fix |
|---|---|
wineboot never finishes | The "Wine Mono Installer" window waits for a click: run WINEDLLOVERRIDES="mscoree,mshtml=" wineboot -i. |
Cannot open display | export DISPLAY=:1, and start the desktop (froog desktop, or bash ~/.froog/desktop/desktop.sh inside). |
unimplemented function msvcp140.dll… | winetricks -q vcrun2022 |
A program exits at once with init_sys_streams | Start it with wine start /unix. |
| Windows go blank and show "Not Responding" | A dialog was closed from Linux (close_window, wmctrl -c) while it was modal. Answer dialogs with keys (press_key Return) instead. |
Install only software you have the right to use, from its vendor. Don't copy Windows system files into Wine: Microsoft's licence doesn't allow it, and the programs above don't need them.