Ubuntu 14.04 配置 VNC Server

用putty连接Linux后,如果会话断开,也会终止此会话在Linux执行的任务。

用WinSCP传输文件很方便,目前也只能传输文件。

按照以下步骤以及提示,安装VNC Server,

1、apt-get install vnc4server  ,需要root权限。安装完,建议切换到常用的非root用户

2、vncserver :1  

3、apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

4、编辑 ~/.vnc/xstartup,注意是当前用户的主目录下,内容如下:

#!/bin/sh

export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic & 

gnome-panel & 
gnome-settings-daemon & 
metacity & 
nautilus & 
gnome-terminal &

5、重启一号桌面,kill一个没在运行的桌面,将报错:Can't find file /home/user/.vnc/hostName:1.pid,You'll have to kill the Xvnc4 process manually

vncserver -kill :1
vncserver :1

6、在VNC Viewer中输入地址,格式:

RemoteIPAddress:1 # 如:172.21.15.189:1

7、经试验,适用于Ubuntu 16.04

原文地址:https://www.cnblogs.com/chenhuanBlogs/p/8275752.html