Ubuntu安装VNCServer

警告
本文最后更新于 2023-06-15,文中内容可能已过时。

Step1 (安装GNOME桌面)

1
2
3
sudo apt-get update 
sudo apt-get install gnome-session-flashback 
sudo apt-get install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y

Step2

1
sudo apt-get -y install xfonts-100dpi xfonts-100dpi-transcoded xfonts-75dpi xfonts-75dpi-transcoded xfonts-base

Step3

1
sudo apt install tigervnc-standalone-server

Step4:配置密码

1
vncpasswd

Step5:配置XStartup

1
vim ~/.vnc/xstartup

内容如下:

1
2
3
4
5
6
#!/bin/sh
# Start Gnome 3 Desktop
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &

Step6:重启TigerVNC

1
2
tightvncserver -kill :1 
vncserver -depth 24 -name mydesktop -localhost no :1
0%