Basic Docker image for Wine.
To build the Docker image, please run the following command.
$ docker build -f wine.Dockerfile --tag=wine:20.04 .
To run the Docker container, please run the following command with additional Docker arguments if necessary.
$ xhost +
$ docker run \
-it \
--rm \
--gpus all \
--device /dev/snd \
--device=/dev/dri \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-v $(pwd):/mnt \
wine:20.04
$ xhost -
For Win32 applications, we create a directory ~/.wine32
to store the configurations.
$ WINEARCH=win32 WINEPREFIX=~/.wine32 winecfg
For Win64 applications, we create a directory ~/.wine64
to store the configurations.
$ WINEARCH=win64 WINEPREFIX=~/.wine64 winecfg
For Win32 applications, we specify the Win32 configuration directory as WINEPREFIX
before wine
.
$ WINEPREFIX=~/.wine32 wine app.exe
For Win32 applications, we specify the Win64 configuration directory as WINEPREFIX
before wine
.
$ WINEPREFIX=~/.wine64 wine app.exe
For some old applications, the display usually is very small. We could scale the display using a scaling script.
For example, to scale the display of app.exe by 1.5x, we could run the following command.
$ WINEPREFIX=~/.wine32 run_scaled --scale=1.5 wine app.exe
We will use running Windows WeChat as an example.
$ wget https://dldir1.qq.com/weixin/Windows/WeChatSetup.exe
$ xhost +
$ docker run \
-it \
--gpus all \
--device /dev/snd \
--device=/dev/dri \
-e DISPLAY=$DISPLAY \
-e XMODIFIERS=@im=fcitx \
-e QT_IM_MODULE=fcitx \
-e GTK_IM_MODULE=fcitx \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
-v $(pwd):/mnt \
wine:20.04
Notice --rm
has been removed and -e XMODIFIERS=@im=fcitx
, -e QT_IM_MODULE=fcitx
, -e GTK_IM_MODULE=fcitx
has been added to enable the fcitx
input from the host computer.
$ WINEARCH=win64 WINEPREFIX=~/.wine64 winecfg
Make sure virtual desktop is used in winecfg
. In my case, I used resolution 2560 x 1440
for the virtual desktop.
$ cd /mnt
$ WINEPREFIX=~/.wine64 wine WeChatSetup.exe
$ WINEPREFIX=~/.wine64 wine ~/.wine64/drive_c/Program\ Files\ \(x86\)/Tencent/WeChat/WeChat.exe