我 win10 用的 vncviewer.exe,
在Ubuntu上首先需要安装vnc4server
# apt-get install vnc4server
出现灰色屏幕和×型鼠标是因为vncserver找不到指定的图形化组件,
错误提示如下:在软件的下方提示的,大概2s就消失了
查看/home/用户名/.vnc/*.log 可以看到日志文件
cat /home/用户名/.vnc/*.log
提示:
error opening security policy file /etc/X11/xserver/SecurityPolicy
Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!
Could not init font path element /usr/share/fonts/X11/75dpi/, removing from list!
Could not init font path element /usr/share/fonts/X11/100dpi/, removing from list!
这是没有找到文件,无法初始化,所以运行如下命令即可解决:
5. 需要更改~/.vnc/xstartup文件
在安装之前,我们先安装如下软件:
$sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
然后修改xstartup文件
#!/bin/sh
# Uncomment the following two lines for normal desktop:
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
unset DBUS_SESSION_BUS_ADDRESS
gnome-panel &
gnmoe-settings-daemon &
metacity &
nautilus &
gnome-terminal &
Ubuntu:
mkdir /usr/X11R6/lib/X11/
cd /usr/X11R6/lib/X11
ln -s /usr/share/fonts/X11/ fonts
重启VNCserver就ok了。
安装VNC详细教程:在Ubuntu 16.04上安装和配置VNC_ubuntu安装vnc_boss-dog的博客-优快云博客
如何安装Ubuntu 18图形化桌面? (aliyun.com)
需要注意的是,在这篇教程的自启动配置中,配置文件可能位于:/usr/lib/systemd/system/*