VNC is a remote desktop protocol. This article only applies to servers where Ubuntu has a monitor. If you do not have a monitor, refer to the first article in Resources

Note: The following commands are all installed on Ubuntu

  1. First, install x11VNC
sudo apt-get install x11vnc -y
Copy the code
  1. Setting the VNC Password
sudo x11vnc -storepasswd /etc/x11vnc.pass
Copy the code
  1. Create the x11VNC automatic startup service

Create the/etc/systemd/system/x11vnc. The service, and write the following content

[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth /run/user/1000/gdm/Xauthority -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target
Copy the code
  1. Start the X11VNC service
sudo systemctl enable x11vnc
sudo service x11vnc start
Copy the code

I also installed the following things, I don’t know if it affected the final installation

sudo apt-get install vnc4server
sudo apt-get install ubuntu-desktop
sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
sudo apt-get install vino
Copy the code

Open Screen Sharing in [Setting -> Sharing]

Now that the installation is complete on Ubuntu, open focus Search on your MAC.CMD + spaceThe inputvnc://your_ip, and then enter the password

[Error: the software on the remote computer appears to be incompatible with this “screen Share” version] Just type the following command on Ubuntu

gsettings set org.gnome.Vino require-encryption false
Copy the code

Finally on the MAC the face of success on remote server desktops

Resources

Ubuntu 20.04 VNC installation and setup _BlueWhalerobot blog -CSDN blog MAC Side VNC connection Ubuntu Remote desktop tutorial _CallMeYunzi blog -CSDN blog _Mac Ubuntu remote desktop