我尝试使用 vncviewer 连接的计算机是 Ubuntu 18.04 系统仪表板到面板侏儒扩展。
当我使用第一个.vnc/xstartup,我只有连接后黑屏。
当我使用第二个.vnc/xstartup, 我有一个鹦鹉螺文件管理器连接后,我可以通过双击 pdf 文件本身,使用 evince 打开 pdf。但我无法通过双击文本文件本身来打开 gedit,也无法使用右键菜单打开终端。为什么 ?
我发出时得到以下journalctl日志ssh destination_computer_username@destination_computer_ip_addr "DISPLAY=:2 nohup gnome-terminal"在我的源计算机终端上
Dec 20 14:06:13 UbuntuHW15 dbus-daemon[4137]: [session uid=1000 pid=4137] Activating via systemd: service name='org.gnome.Terminal' unit='gnome-terminal-server.service' requested by ':1.352' (uid=1000 pid=13704
Dec 20 14:06:13 UbuntuHW15 systemd[4111]: Starting GNOME Terminal Server...
Dec 20 14:06:13 UbuntuHW15 gnome-terminal-server[13707]: Invalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused
Dec 20 14:06:13 UbuntuHW15 gnome-terminal-server[13707]: Failed to parse arguments: Cannot open display:
Dec 20 14:06:13 UbuntuHW15 systemd[4111]: gnome-terminal-server.service: Main process exited, code=exited, status=10/n/a
Dec 20 14:06:13 UbuntuHW15 systemd[4111]: gnome-terminal-server.service: Failed with result 'exit-code'.
Dec 20 14:06:13 UbuntuHW15 systemd[4111]: Failed to start GNOME Terminal Server.
第一个.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`
if [ $OS = 'Linux' ]; then
case "$WINDOWMANAGER" in
*gnome*)
if [ -e /etc/SuSE-release ]; then
PATH=$PATH:/opt/gnome/bin
export PATH
fi
;;
esac
fi
if [ -x /etc/X11/xinit/xinitrc ]; then
exec /etc/X11/xinit/xinitrc
fi
if [ -f /etc/X11/xinit/xinitrc ]; then
exec sh /etc/X11/xinit/xinitrc
fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
gnome-wm&
metacity&
第二个.vnc/xstartup
# Uncomment the following two lines for normal desktop:
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &