Winetricks: vcrun2015 can't install in Docker container

Created on 12 Feb 2018  路  3Comments  路  Source: Winetricks/winetricks

I'm trying to install vcrun2015 inside a Docker container (without GUI - I want to run this on a server).
I successfully ran several Windows commandline applications inside a Docker container, but now I'm struggling with an application which depends on VC++ 2015.

Do you have any idea how to get this to work?

# export WINEPREFIX="$HOME/prefix32"
# export WINEARCH=win32
# wine wineboot
# winetricks vcrun2015
root@1a952a109f6f:~/.wine/dosdevices/c:# winetricks vcrun2015
------------------------------------------------------
Running Wine/winetricks as root is highly discouraged. See https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F
------------------------------------------------------
Using winetricks 20171222-next - sha256sum: 46fa67fbddf8b7154bf7e030728e6dd8ca08374df1410a458accc0547ea2a1e8 with wine-3.0 and WINEARCH=win32
Executing w_do_call vcrun2015
Executing load_vcrun2015 
------------------------------------------------------
Working around wine bug 37781 
------------------------------------------------------
------------------------------------------------------
This may fail in non-XP mode, see https://bugs.winehq.org/show_bug.cgi?id=37781
------------------------------------------------------
Using native,builtin override for following DLLs: api-ms-win-crt-conio-l1-1-0 api-ms-win-crt-heap-l1-1-0 api-ms-win-crt-locale-l1-1-0 api-ms-win-crt-math-l1-1-0 api-ms-win-crt-runtime-l1-1-0 api-ms-win-crt-stdio-l1-1-0 api-ms-win-crt-time-l1-1-0 atl140 concrt140 msvcp140 msvcr140 ucrtbase vcomp140 vcruntime140
Executing wine regedit C:\windows\Temp\_vcrun2015\override-dll.reg
Setting Windows version to winxp
Executing wine regedit C:\windows\Temp\_vcrun2015\set-winver.reg
------------------------------------------------------
Running /usr/bin/wineserver -w. This will hang until all wine processes in prefix=/root/prefix32 terminate
------------------------------------------------------
Executing cd /root/.cache/winetricks/vcrun2015
Executing wine vc_redist.x86.exe
0031:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0031:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0032:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0032:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
------------------------------------------------------
Note: command wine vc_redist.x86.exe returned status 120. Aborting.
------------------------------------------------------
# winetricks -V     
20171222-next - sha256sum: 46fa67fbddf8b7154bf7e030728e6dd8ca08374df1410a458accc0547ea2a1e8
# wine --version
wine-3.0
# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

Most helpful comment

Hi @mihaitodor ,
thanks for your help - this worked fine!
To avoid running a background process (which is not perfectly suitable for Docker), I ended up with the following commands in my Dockerfile.

RUN set -xe                     && \
    WINEDLLOVERRIDES="mscoree,mshtml=" xvfb-run wine wineboot && \
    xvfb-run wineserver -w      && \
    xvfb-run winetricks -q vcrun2015

Probably use on servers is not the main target of Wine, but still it would be great if CLI stuff would work without an X Display.
Our use case is to use a closed-source Windows-only library for converting files.

All 3 comments

Hi @heidemn. Unfortunately, Wine assumes that there is always a display available, so I think you'll need to have Xvfb running in there in the background to get this to work and set your $DISPLAY accordingly.

For Xvfb, I am starting it in the background like so: Xvfb :1 -ac -pixdepths 8 16 24 32 -screen 0 1024x768x24 +extension GLX +extension RANDR +render -noreset & (you probably won't need all those fancy options).

Then try something like this:

  • delete your existing $WINEPREFIX directory
  • export DISPLAY=":1"
  • WINEDLLOVERRIDES="mscoree,mshtml=" wine wineboot && wineserver -w (this sets up Wine without Mono and Gecko. If you need those, you'll have to figure out how to make the installers continue automatically, since they show a popup during install)
  • winetricks -q vcrun2015 (the -q flag is important to make the installer run iwithout user intervention)

Hope this helps!

Hi @mihaitodor ,
thanks for your help - this worked fine!
To avoid running a background process (which is not perfectly suitable for Docker), I ended up with the following commands in my Dockerfile.

RUN set -xe                     && \
    WINEDLLOVERRIDES="mscoree,mshtml=" xvfb-run wine wineboot && \
    xvfb-run wineserver -w      && \
    xvfb-run winetricks -q vcrun2015

Probably use on servers is not the main target of Wine, but still it would be great if CLI stuff would work without an X Display.
Our use case is to use a closed-source Windows-only library for converting files.

thanks for your help - this worked fine!

I'm glad to hear. I'm also using xvfb-run during the docker build process. I thought you're asking about runtime after the the container is built.

Probably use on servers is not the main target of Wine, but still it would be great if CLI stuff would work without an X Display.

It works, if you are careful to use the right options. Windows apps mostly assume that they have a display attached (including installers), so then you get into nasty problems...

Our use case is to use a closed-source Windows-only library for converting files.

Hehe, join the club :)

Please close the issue if it's all working.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AgrastonLeroy picture AgrastonLeroy  路  6Comments

IngeniousDox picture IngeniousDox  路  7Comments

Ads20000 picture Ads20000  路  11Comments

kenorb picture kenorb  路  6Comments

prcastro picture prcastro  路  9Comments