windows 通过 vnc4server 远程 ubuntu

程序安装与配置运行

linode 有一篇详尽的文章:Install VNC on Ubuntu 16.04

  • ubuntu
    • 安装 vnc4server,sudo apt-get install vnc4server
    • 运行 vncpasswd,配置密码,密码至少6个字符,至多8个字符
    • 运行 vnc4server :1,启动 vnc server。可通过 vnc4server -kill :1 关闭 vnc server。
  • windows
    • chrome 安装 vnc viewer 插件
    • 通过 ip:5901 远程登陆,默认使用 x-terminal-emulator & x-window-manager 界面。
  • 配置使用 gnome 界面,参考链接
    • 安装包,sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
    • 修改配置文件 ~/.vnc/xstartup

log

vnc4server 配置与运行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
sunyongfeng@openswitch-OptiPlex-380:~$ vncpasswd 
Password:
Verify:
sunyongfeng@openswitch-OptiPlex-380:~$
sunyongfeng@openswitch-OptiPlex-380:~$ vncserver :1

New 'openswitch-OptiPlex-380:1 (sunyongfeng)' desktop is openswitch-OptiPlex-380:1

Starting applications specified in /home/sunyongfeng/.vnc/xstartup
Log file is /home/sunyongfeng/.vnc/openswitch-OptiPlex-380:1.log

sunyongfeng@openswitch-OptiPlex-380:~$
sunyongfeng@openswitch-OptiPlex-380:~$ vncserver -kill :1
Killing Xvnc4 process ID 2788

配置支持 gnome 界面

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
sunyongfeng@openswitch-OptiPlex-380:~$ cat .vnc/xstartup 
#!/bin/sh

# 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 &
gnome-terminal &
sunyongfeng@openswitch-OptiPlex-380:~$

Screenshot

chrome 插件

  • 插件

chrome-plugin VNC viewer

  • 输入 IP & 端口号

access

  • 输入密码

auth

  • xwindow 界面

xwindow

  • gnome 界面

gnome