sudo apt install tightvncserver
sudo apt-get install --no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
vncserver
You need to set a password for the first run
“`
New ‘X’ desktop is server_name:1
Starting applications specified in /root/.vnc/xstartup
“`
5. Close vncserver
vncserver -kill :1
vi ~/.vnc/xstartup
Modify to the following content and save
“`
#! /bin/sh
[ - x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ - r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
x-window-manager &
gnome-session &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
“`
8. Start vncserver again, you can use the Viewer to connect at this time, the default port is 5901.
The port changes depending on the ID of the display. For example, if the display ID is 2, the default is 5902. The port can also be found in the log file location prompted after the operation.
Recommended Posts