首页 > 解决方案 > 如何使用 ubuntu:20.04 基础在 docker 中运行 wine(适用于 ubuntu:18.04 基础)

问题描述

从 ubunut:18.04 构建时,以下工作。但是当我将它更改为从 ubuntu:20.04 构建时,它失败了。

在第一次运行时,它可以工作,但会出现以下错误:

wine@wine:~$ wine regedit
wine: created the configuration directory '/home/wine/.wine'
X Error of failed request:  BadRROutput (invalid Output parameter)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  9 (RRGetOutputInfo)
  Serial number of failed request:  187
  Current serial number in output stream:  187
0010:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0010:err:winediag:nodrv_CreateWindow The explorer process failed to start.
0012:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0012:err:winediag:nodrv_CreateWindow The explorer process failed to start.
0012:err:ole:apartment_createwindowifneeded CreateWindow failed with error 183
0012:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0012:err:ole:apartment_createwindowifneeded CreateWindow failed with error 14007
0012:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x800736b7
0012:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 800736b7
0012:err:ole:get_local_server_stream Failed: 800736b7
000b:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
000b:err:winediag:nodrv_CreateWindow The explorer process failed to start.
Could not find Wine Gecko. HTML rendering will be disabled.
wine: configuration in L"/home/wine/.wine" has been updated.
002f:err:clipboard:convert_selection Timed out waiting for SelectionNotify event
002f:err:clipboard:convert_selection Timed out waiting for SelectionNotify event

所有后续运行都不起作用,并给出以下错误:

wine@wine:~$ wine regedit
0014:err:module:DelayLoadFailureHook failed to delay load setupapi.dll.SetupDiGetClassDevsW
wine: Call from 0x7b032f82 to unimplemented function setupapi.dll.SetupDiGetClassDevsW, aborting
wine: Unimplemented function setupapi.dll.SetupDiGetClassDevsW called at address 7B032F82 (thread 0014), starting debugger...
^C000d:err:user:load_desktop_driver failed to load L"C:\\windows\\system32\\winex11.drv"
0020:err:user:load_desktop_driver failed to load L"C:\\windows\\system32\\winex11.drv"
^C0020:err:module:DelayLoadFailureHook failed to delay load comctl32.dll.InitCommonControlsEx
wine: Call from 0x7b032f82 to unimplemented function comctl32.dll.InitCommonControlsEx, aborting

Dockerfile:

FROM ubuntu:20.04
ARG DEBIAN_FRONTEND="noninteractive"
RUN dpkg --add-architecture i386 \
        && apt update \
        && apt install -y --install-recommends apt-utils \
        && apt install -y --install-recommends wine-stable wine32 \
        && useradd -m wine
ENV HOME="/home/wine"
WORKDIR $HOME
USER wine
CMD /bin/bash

建造:

docker build -t wine .

创建容器:

docker create -it \
    --user="wine" \
    --hostname="wine" \
    --name="wine" \
    --env="DISPLAY" \
    --volume="/tmp/.X11-unix:/tmp/.X11-unix" \
    --network="host" \
    wine

运行:

docker start wine

在正在运行的 docker 容器中打开一个 shell:

docker exec -it wine /bin/bash

在容器内运行 regedit 作为测试:

wine regedit

当容器从 ubuntu:18.04 构建时,它可以工作。

当容器从 ubuntu:20.04 构建时,它会打开一次 regedit 窗口,但会引发错误。随后对“wine regedit”的调用不起作用,并且仍然抛出错误。

这些错误表明打开 X 窗口存在问题,但它能够打开一次 regedit,这很奇怪,因为它必须成功访问 X 才能做到这一点。

标签: dockerubuntuubuntu-18.04ubuntu-20.04wine

解决方案


推荐阅读