vnc配置

仅安装核心组件:

假如不安装例如 office、浏览器、等等的额外组件,可以使用如下命令:

1
apt-get install --no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y

修改密码

1
vncpasswd

端口转发

1
ssh -L 5901:127.0.0.1:5901 用户名@IP地址或网址

修改配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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 &

开启

1
vncserver :1

关闭

1
vncserver -kill :1

访问

1
vncserver 127.0.0.1:5901
请作者喝一杯咖啡☕️