This post was last edited by lb8820265 on 2022-4-16 00:43
The Raspberry Pi operating system comes with VNC, which makes remote desktop connection very convenient . The default GNOME3 desktop has a remote desktop, but the Ubuntu MATE desktop does not.
Failed attempts
Installing remote desktop on MATE desktop is tricky. The methods I tried and the results are as follows:
vnc4server service - source not found.
xrdp service-Windows Remote Desktop cannot connect.
tightvnc service - Gray screen after VNC connection. After solving the gray screen problem, the VNC desktop and the Raspberry Pi desktop are two and not synchronized.
RealVNC service——VNC’s own service, the service cannot be started, and the enterprise version needs to be purchased.
Install x11vnc service
Finally I chose x11vnc and entered the following command to install it
sudo apt install x11vnc
After the installation is complete, enter the following command to start VNC
x11vnc
A new desktop connection service will be created with the port number 5900. A new desktop connection service will be created each time a command is entered.
In the VNC Viewer on the Windows side, enter the IP address of the Raspberry Pi followed by the port number. The desktop after connecting is the actual desktop of the Raspberry Pi.
Start Remote Desktop Services at boot time
Although this allows remote desktop connection, you need to enter commands in the terminal every time before connecting, which is very troublesome. Next, set up the remote desktop service to start at startup.
1. Enter the following command in the terminal to create a new X11VNC service configuration file.
sudo pluma /lib/systemd/system/x11vnc.service
- Enter the following code in the file, where <your username> is replaced with your own username, such as lb.
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbport 5900 -shared -o /home/<你的用户名>/.vnc/x11vnc.log
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
3. Start the service and set it to start at boot
sudo systemctl enable x11vnc.service
If you want to shut it down, use disable, then restart the system, and after booting up you can directly use VNC Viewer to connect to the remote desktop .
question
The remote desktop using x11vnc cannot transfer files. I wonder if there are other alternative methods .