HOWTO Run a 32-bit windows application in a container
The magnetic field calculations for the Hall D solenoid were done using 32-bit windows programs from LANL. The programs were run on Linux machines using wine, but with the advent of RHEL9 at JLab the 32-bit version is no longer compatible with many drivers. For this reason, we provide a description on how to build a container with wine32, provide links to docker and apptainer containers and how to run the executables in them.
If you are able to use the provided containers and just want to run your program, you may skip to the very last line.
Create docker container
The following dockerfile can be used to build a docker container based on fedora 39, installs and sets up wine32:
$ cat Dockerfile_fedora39_wine32 FROM fedora:39 # Enable multilib and install necessary packages RUN dnf -y install dnf-plugins-core && \ dnf -y install wine wine.i686 glibc.i686 libX11.i686 freetype.i686 && \ dnf clean all # Set Wine environment ENV WINEARCH=win32 ENV WINEPREFIX=/root/.wine32 # Create Wine 32-bit prefix RUN winecfg
It can be built on any machine that has docker installed, which may require sudo privileges:
$ docker build -f Dockerfile_fedora39_wine32 -t fedora39_wine32 .
It can be run from the same machine:
$ docker run -it fedora39_wine32 bash
To allow X11 forwarding into the docker container, a few additional options are needed
$ xhost +local:docker $ docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -it fedora39_wine32 bash
This docker image was saved on dockerhub as: aaustreg/fedora39_wine32
Convert to apptainer image
The docker image is converted into an apptainer image
apptainer build fedora39_wine32.sif docker:aaustreg/fedora39_wine32
The resulting file is accessible on the group disk:
/group/halld/www/halldweb/html/dist/gluex_fedora39_wine32.sif
This command opens an interactive shell:
apptainer shell /group/halld/www/halldweb/html/dist/gluex_fedora39_wine32.sif
Alternatively, the application can be run directly in the container, e.g.:
apptainer run /group/halld/www/halldweb/html/dist/fedora39_wine32.sif AUTOMESH.EXE MAG.am