Setup A Wineprefix On Ubuntu 18.04

June 24, 2019

Wine is great, fill a glass, sit back, and find another reason to not boot into Windows. Wine lets us run built-for-windows applications on Linux. Wineprefix’s lets us setup different Wine configurations, do you need 32 or 64-bit Wine, or specific runtime libraries, or do you just want to separate Windows applications. There’s dozens of different ways to get to the same goal, and this applies to Wine in Linux too. Here’s one way to setup Wineprefix(s), install an application and create a shortcut for it on Ubuntu 18.04.

sudo apt install wine-stable winetricks

When working with long path names make things easier. Specify a bash variable for the working path.

prefix=$HOME/.wine/wineprefixes

If the path doesn’t exist you may need to create it first. Tell mkdir to make directories and sub directories with -p. -p, --parents no error if existing, make parent directories as needed

mkdir -p $HOME/.wine/wineprefixes/
export WINEPREFIX=$prefix/tools64
wine wineboot
export WINEPREFIX=$prefix/tools32
WINEARCH=win32 wine wineboot

For the rest of the commands I’ll be using the 64-bit Wineprefix to install LTspice for this example.

wine $HOME/Downloads/LTspiceXVII.exe
nano ~/Desktop/shortcut.desktop
[Desktop Entry]
Name=LTspice XVII
Exec=env WINEPREFIX=/home/username/.wine/wineprefixes/tools64 wine "/home/username/.wine/wineprefixes/tools64/drive_c/Program Files/LTC/LTspiceXVII/XVIIx64.exe"
Type=Application
StartupNotify=true
Comment=Analog Devices's LTspice XVII
Path=/home/username/.wine/wineprefixes/tools64/dosdevices/c:/Program Files/LTC/LTspiceXVII
Icon=DB38_XVIIx64.0
StartupWMClass=xviix64.exe
chmod +x ~/Desktop/shortcut.desktop