目录

VNCViewer远程阿里云ECS服务器

这篇文章展示了通过VNCViewer远程控制阿里云ECS服务器的安装配置操作.

系统环境
  • 桌面端版本:Windows 10
  • 远程端版本:Ubuntu 16.04
  • VNCViewer版本:6.20.113

阿里云ECS添加安全组

安全组
  • 协议类型:自定义TCP
  • 端口范围:5900/59001
  • 授权对象:0.0.0.0/0

通过自带的Workbench连接Terminal

1
sudo apt-get update 
1
2
sudo apt-get install vnc4server
# 中间会有确认安装的提示,输入 Y 确认安装
1
2
vncserver
# 第一次启动会提示设置密码(19981112)
1
sudo apt-get install x-window-system-core
1
2
sudo apt-get install gdm
# 选择lightdm
1
sudo apt-get install ubuntu-desktop
1
sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
1
vim ~/.vnc/xstartup  #用vim进行编辑
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#!/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 &
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# Uncomment the following two lines for normal desktop:
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
# 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-session &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
技巧
自动生成新桌面
第一次生成:1
第二次生成:2
表示不同的桌面
1
vncviewer
1
vncserver -kill :1      #:1表示桌面号
创建新链接
File -> New connection
VNC Server中输入IP:桌面号39.105.95.4:1