Recently I’ve found several reasons why Windows containers fit in nicely in our Linux-dominated environments:
- You actually do have a scientific application which is exclusively available for windows
- How about installing and running MS Office inside a safe environment?
- Do you own Windows games you always wanted to play under Linux?
- Your tax reporting software runs under Windows only?
That’s why I initiated a project called dolmades which should bring portable and sustainable windows applications to linux users. Its goal is to provide stable recipes for people who are interested in regularly using one or only a few particular windows application. For that purpose VMs and dual-booting bear a huge overhead in both performance and resources. Another approach is to use wine, a wrapper that redirects Windows system calls into native Linux system calls and allows execution of native Windows binaries under supported platforms (Unix with X, just recently Android).
So, why don’t we formulate the following equation: wine + singularity = dolmades ?
This document describes how to get a dolmade running in which one or several windows apps can be installed temporarily or permanently. Both a Singularity Hub and a Docker Hub image template is readily available and supports plenty of win apps already without further modification needed.
This tutorial uses singularity 2.3 which is all what you will need to have installed. The game which is being installed is freely downloadable. Normal user privileges will suffice provided you install your software into the proper location.
Let’s pull the dolmades docker image. Alternatively, you can use the shub image.
singularity pull docker://c1t4r/dolmades
This image comes with Ubuntu 16.04 and has the winehq PPA enabled. It has wine version 2.0.1 (current stable) installed and some additional packages which are needed to run some DX9 games.
Now, extend the size of the image and execute its run script in read-write mode:
singularity expand -s 1500 dolmades.img singularity exec -w dolmades.img /singularity
This will do the following in
- Check if a wine prefix exists from a previous run? If yes: restore it, if no: initialize it. The wine prefix is kind of a chroot location for wine apps and where the windows user profiles and their apps are being stored.
- Download and install DirectX9
- Start a new shell
- Prints the instructions to manually download and install Broken Sword 2.5 (a nice, free adventure game)
- After you are done, test it and finally exit the shell.
- The profile will be saved under
/PROFILES, the game under
NOTE: it is important to call the EXE from its directory or else it will fail!
Expand the size of your container further or use a new one to try out other windows games or apps!
If you are unsure if an app will install or work properly you can test that without modifying the container. Simply start it read-only:
./dolmades.img # or singularity run dolmades.img
Once you have figured out how to install and make an app work you repeat the steps in rw-mode. Often, some registry entries need to be tweaked or some builtin DLLs substituted by native ones.
That can be often done using the tool
winetricks. Some more settings can be tweaked using the tool
This is the
Dockerfile to build the dolmades docker image
This is the link to the singularity hub dolmades build spec file which also contains the run script.
Dolmades are still in the early stages and there are many challenges to tackle before we seize the potential over using wine on Linux systems directly. If this speaks to you then send me your feedback or questions, and check my project page for screen shots of further examples.