Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法正常打开 DoChat Exited with code [0] #188

Open
baojiliu opened this issue Oct 25, 2022 · 4 comments
Open

无法正常打开 DoChat Exited with code [0] #188

baojiliu opened this issue Oct 25, 2022 · 4 comments

Comments

@baojiliu
Copy link

在运行DoChat时,报错。随后启用DEBUG模式,发现 Make sure that your X server is running and that $DISPLAY is set correctly ,我认为X11 目录挂在是正常的。期待任何建议,谢谢。

基本信息:

  • 内核
uname -a
Linux archlinux 6.0.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 15 Oct 2022 14:00:49 +0000 x86_64 GNU/Linux
  • 显卡
docker run --gpus all nvidia/cuda:9.0-base nvidia-smi
Tue Oct 25 09:50:07 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 520.56.06    Driver Version: 520.56.06    CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   51C    P0    26W /  N/A |      5MiB /  6144MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+
  • X11
 echo $DISPLAY
:0
tree /tmp/.X11-unix
/tmp/.X11-unix
└── X0
0 directories, 1 file
  • docker
docker version
Client:
 Version:           20.10.20
 API version:       1.41
 Go version:        go1.19.2
 Git commit:        9fdeb9c3de
 Built:             Sat Oct 22 19:31:23 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.20
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.19.2
  Git commit:       03df974ae9
  Built:            Sat Oct 22 19:30:29 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.6.8
  GitCommit:        9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6.m
 runc:
  Version:          1.1.4
  GitCommit:
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

错误日志:

sudo curl -sL https://gitee.com/mirrors/dochat/raw/main/dochat.sh | DOCHAT_DEBUG=true bash

       ____         ____ _           _
      |  _ \  ___  / ___| |__   __ _| |_
      | | | |/ _ \| |   | '_ \ / _` | __|
      | |_| | (_) | |___| | | | (_| | |_
      |____/ \___/ \____|_| |_|\__,_|\__|

      https://github.com/huan/docker-wechat

                +--------------+
               /|             /|
              / |            / |
             *--+-----------*  |
             |  |           |  |
             |  |   盒装    |  |
             |  |   微信    |  |
             |  +-----------+--+
             | /            | /
             |/             |/
             *--------------*

      DoChat /dɑɑˈtʃæt/ (Docker-weChat) is:

      📦 a Docker image
      🤐 for running PC Windows WeChat
      💻 on your Linux desktop
      💖 by one-line of command

🚀 Pulling the docker image...

3.3.0.115: Pulling from zixia/wechat
Digest: sha256:851ef44dcbdaed6f0db8f538ea2a29d713292347a54ee711225f77682417673b
Status: Image is up to date for zixia/wechat:3.3.0.115
docker.io/zixia/wechat:3.3.0.115

🚀 Pulling the docker image done.
WARNING: you should run this program as super-user.
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
🚀 Starting DoChat /dɑɑˈtʃæt/ ...

+ main
++ id -u
+ '[' 1000 -ne 0 ']'
+ startWechat
+ hello
++ cat /VERSION
+ VERSION=0.15.0
+ echo '[DoChat] 盒装微信 v0.15.0'
[DoChat] 盒装微信 v0.15.0
+ setupFontDpi
+ DELETE_KEYS=('HKEY_CURRENT_USER\Control Panel\Desktop' 'HKEY_CURRENT_USER\Software\Wine\Fonts')
+ for key in "${DELETE_KEYS[@]}"
+ wine reg DELETE 'HKEY_CURRENT_USER\Control Panel\Desktop' /v LogPixels /f
+ true
+ for key in "${DELETE_KEYS[@]}"
+ wine reg DELETE 'HKEY_CURRENT_USER\Software\Wine\Fonts' /v LogPixels /f
+ wine reg ADD 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Hardware Profiles\Current\Software\Fonts' /v LogPixels /t REG_DWORD /d 120 /f
+ /dochat/patch-hosts.sh
+ /dochat/disable-upgrade.sh
Disabling patch for /home/user/.wine/drive_c/users/user/AppData/Roaming/Tencent/WeChat ...
Disabling patch for /home/user/.wine/drive_c/users/user/Application Data/Tencent/WeChat ...
+ '[' -n true ']'
+ unset WINEDEBUG
+ wine reg query 'HKEY_CURRENT_USER\Software\Tencent\WeChat'

HKEY_CURRENT_USER\Software\Tencent\WeChat
    NeedUpdateType    REG_DWORD    0x0

[DoChat] DISPLAY=:0
+ echo '[DoChat] DISPLAY=:0'
++ head -1 /home/VERSION.WeChat
+ VERSION=3.3.0.115
[DoChat] WeChat 3.3.0.115
+ echo '[DoChat] WeChat 3.3.0.115'
+ true
+ echo '[DoChat] Starting...'
[DoChat] Starting...
+ '[' -n true ']'
+ wine 'C:\Program Files\Tencent\WeChat\WeChat.exe'
00e0:fixme:ver:GetCurrentPackageId (04BCFEF0 00000000): stub
00e0:fixme:sync:SetWaitableTimerEx (000000BC, 04BCFDA0, 0, 00000000, 00000000, 00000000, 1500) semi-stub
00dc:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
00dc:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
011c:fixme:iphlpapi:NotifyAddrChange (Handle 0x661fefc, overlapped 0x661fee4): stub
00dc:fixme:win:RegisterTouchWindow (00030040 00000000): stub
0120:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0x7bc2a1f5
@greasycat
Copy link

Try

sudo pacman -S xorg-xhost
xhost +

#68 (comment)

@Adel-Magebinary
Copy link

For ubuntu users, go

xhost +SI:localuser:YOUR_USER_NAME

@WhyNotHugo
Copy link

I ran:

> xhost +
access control disabled, clients can connect from any host

Still seeing the same issue:

[DoChat] WeChat 3.3.0.115
[DoChat] Starting...
+ echo '[DoChat] Starting...'
+ '[' -n true ']'
+ wine 'C:\Program Files\Tencent\WeChat\WeChat.exe'
00e0:fixme:ver:GetCurrentPackageId (04BCFEF0 00000000): stub
00e0:fixme:sync:SetWaitableTimerEx (000000C0, 04BCFDA0, 0, 00000000, 00000000, 00000000, 1500) semi-stub
00dc:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
00dc:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
011c:fixme:iphlpapi:NotifyAddrChange (Handle 0x661fefc, overlapped 0x661fee4): stub
00dc:fixme:win:RegisterTouchWindow (00030040 00000000): stub
0120:err:seh:NtRaiseException Unhandled exception code c0000005 flags 0 addr 0x7bc2a1f5

@WhyNotHugo
Copy link

WhyNotHugo commented Jun 20, 2023

I tinkered the script a bit to get an interactive shell:

diff --git a/dochat.sh b/dochat.sh
index 692aff0..55bdc93 100755
@@ -97,7 +97,7 @@ function main () {
     "${DEVICE_ARG[@]}" \
     --name DoChat \
     --rm \
-    -i \
+    -it \
     \
     -v "$HOME/DoChat/WeChat Files/":'/home/user/WeChat Files/' \
     -v "$HOME/DoChat/Applcation Data":'/home/user/.wine/drive_c/users/user/Application Data/' \

--- a/dochat.sh
+++ b/dochat.sh
@@ -117,12 +117,13 @@ function main () {
     -e UID="$(id -u)" \
     \
     --ipc=host \
     \
+    --entrypoint /bin/bash \
     "$DOCHAT_IMAGE_VERSION"
 
     echo

And checked the X11 socket:

user@c400af7960ec:/$ whoami
user
user@c400af7960ec:/$ ls -l /tmp/.X11-unix/X0 
srwxr-xr-x 1 root root 0  6月 20 18:13 /tmp/.X11-unix/X0

The socket itself is only writable by root, so the user running wechat cannot connect to it. An ugly hack could be to change the socket to be world writable (777), but this also affects the socket in the host and is terrible security.

I'm not sure how to properly fix this. My user on the host (hugo/1000) maps to root on the container (i.e.: 0). Running wechat as root inside the container would fix this, but would break in situations where docker itself is running as root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants