Tutorial for installing VNC Server on Ubuntu 20.04.

The following is a tutorial for installing a VNC server (VNC Server) on Ubuntu 20.04:

  1. Update system:

    sudo apt update
    sudo apt upgrade
  2. Install the Xfce desktop environment:

    sudo apt install xfce4 xfce4-goodies
  3. Install TightVNC server:

    sudo apt install tightvncserver
  4. Start the VNC server and set the access password:

    vncserver

    When you run vncserver for the first time, you will be asked to set an access password and confirm the password.

  5. Stop the VNC server:

    vncserver -kill :1

    Note that ":1" is the identifier for the display, if you set a different display number you should change accordingly.

  6. Configure the VNC server:

    cd ~/.vnc
    mv xstartup xstartup.bak
    touch xstartup
    chmod +x xstartup
    nano xstartup

    Open the xstartup file in an editor and copy paste the following into the file:

    #!/bin/bash
    xrdb $HOME/.Xresources
    startxfce4 &
  7. Restart the VNC server:

    vncserver
  8. Configure the firewall:

    sudo ufw allow 5901

    This will allow connections to port 5901 via VNC.

You should now be able to connect to your Ubuntu 20.04 server via a VNC client. Make sure to specify the connection in the format used in the VNC client  <IP地址>:5901. Then enter the VNC access password you set earlier.

Note that VNC connections transmit data in clear text, so it is recommended to use VNC in a secure network environment and set a strong password to ensure security.

Hope this tutorial helps you!

Guess you like

Origin blog.csdn.net/tiansyun/article/details/131317222