Env: centos 7, xshell, xmanager.
Saya memiliki dua mesin virtual centos7, salah satunya dapat berhasil membuka Chrome Browser melalui penerusan X11 dalam sesi SSH, tetapi yang lain tidak.
Yang normal :
[root@localhost ~]# google-chrome --no-sandbox
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
[16458:16458:0523/075723.020611:ERROR:gl_surface_glx.cc(419)] GLX 1.3 or later is required.
[16458:16458:0523/075723.020636:ERROR:gl_initializer_x11.cc(153)] GLSurfaceGLX::InitializeOneOff failed.
[16458:16458:0523/075723.022497:ERROR:gpu_child_thread.cc(254)] Exiting GPU process due to errors during initializat
[16393:16422:0523/075723.081833:ERROR:browser_gpu_channel_host_factory.cc(108)] Failed to launch GPU process.
[root@localhost ~]# [0523/075728.166795:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandb
Most likely you need to configure your SUID sandbox correctly
Yang abnormal:
WARNING! The remote SSH server rejected X11 forwarding request.
[root@yxs ~]# google-chrome --no-sandbox
(google-chrome:10346): Gtk-WARNING **: cannot open display:
[root@yxs ~]# [0523/202401.444038:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
^C
[root@yxs ~]# su yxs
[yxs@yxs root]$ google-chrome
(google-chrome:10407): Gtk-WARNING **: cannot open display:
Konfigurasi keduanya hampir sama.
Yang normal:
[root@localhost ~]# cat /etc/ssh/sshd_config | grep X11
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
# X11Forwarding no
[root@localhost ~]# rpm -qa | grep xauth
xorg-x11-xauth-1.0.9-1.el7.x86_64
[root@localhost ~]# ssh -V
OpenSSH_6.6.1p1, OpenSSL 1.0.1e-fips 11 Feb 2013
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@localhost ~]# echo $DISPLAY
localhost:10.0
#enable ipv6
#minimal centos
Yang abnormal:
[root@yxs ~]# cat /etc/ssh/sshd_config | grep X11
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
# X11Forwarding no
[root@yxs ~]# rpm -qa | grep xauth
xorg-x11-xauth-1.0.9-1.el7.x86_64
[root@yxs ~]# ssh -V
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
[root@yxs ~]# echo $DISPLAY
[root@yxs ~]#
#disbale ipv6
#has installd "GNOME Desktop"
Saya mencoba mengeksekusi export DISPLAY=localhost:10.0
pada mesin virtual abnormal, Tapi ketika saya reboot, variabel lingkungan $DISPLAY
menjadi kosong lagi.
Saya tidak bisa membuka perintah Chrome By google-chrome --no-sandbox
melalui Sesi SSH di Xshell. Tetapi saya dapat menggunakan secara normal melalui jendela VNC pada manajemen mesin virtual.
xhost +
.xhost: unable to open display ""
Jawaban:
Hanya karena saya menonaktifkan IPv6, saya perlu menambahkan inet AddressFamily ke / etc / ssh / sshd_config., Saya terlalu ceroboh sebelumnya. Maafkan saya.
Jawaban ketiga: Link
sumber