我正在尝试通过ssh -X
连接到远程计算机,并从中运行启用了图形界面的docker。
我找到并尝试按照本教程: https://blog.yadutaf.fr/2017/09/10/running-a-graphical-app-in-a-docker-container-on-a-remote-server/
但即使使用最终脚本
,我也会收到以下错误
xterm: Xt error: Can't open display: :10
如果我在脚本中添加sudo chmod -R 777 display
,我会收到此错误:
X11 connection rejected because of wrong authentication. xterm: Xt error: Can't open display: :10
我缺少什么?还有什么我应该在本地,远程机器或容器上配置?
本地计算机上的$ xauth list
test/unix:1 MIT-MAGIC-COOKIE-1 f3e4afd36654c52965e3e529c8a3ce88
test/unix:0 MIT-MAGIC-COOKIE-1 a806b599d75e8b6df4f107a87faa952f
test/unix:10 MIT-MAGIC-COOKIE-1 85342ce3b19106adfea27f3333ba19d8
test/unix:11 MIT-MAGIC-COOKIE-1 224cda4faa7c6d128748c2c35387df68
test:10 MIT-MAGIC-COOKIE-1 5061d4d95dc44d11b60137ad215f1abe
test:11 MIT-MAGIC-COOKIE-1 1eddbb0db43952186265eca6e49e08a4
$ echo $DISPLAY
:0.0
远程计算机上的ssh -X localhost
)$ xauth list
test/unix:1 MIT-MAGIC-COOKIE-1 f3e4afd36654c52965e3e529c8a3ce88
test/unix:0 MIT-MAGIC-COOKIE-1 a806b599d75e8b6df4f107a87faa952f
test/unix:10 MIT-MAGIC-COOKIE-1 85342ce3b19106adfea27f3333ba19d8
test/unix:11 MIT-MAGIC-COOKIE-1 224cda4faa7c6d128748c2c35387df68
test:10 MIT-MAGIC-COOKIE-1 5061d4d95dc44d11b60137ad215f1abe
test:11 MIT-MAGIC-COOKIE-1 1eddbb0db43952186265eca6e49e08a4
$ echo $DISPLAY
test:10.0
$ sudo lsof -i4:6010
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 25693 me 10u IPv4 575887 0t0 TCP *:6010 (LISTEN)
sshd 25693 me 13u IPv4 583043 0t0 TCP localhost:6010->localhost:33366 (ESTABLISHED)
socat 25735 me 3u IPv4 585843 0t0 TCP localhost:33366->localhost:6010 (ESTABLISHED)
$ xauth list
xterm/unix:10 MIT-MAGIC-COOKIE-1 85342ce3b19106adfea27f3333ba19d8
$ echo $DISPLAY
:10
,但没有成功