x11vnc is a Vitrutal Netowrk Computing service. It provides real display to remotely control another computer.
I have a PC with Ubuntu 19.04 but only want to use it remotely while keep its remote desktop environment accessibility. During this procedure, I have faced many issues but found rare information regarding Ubuntu 19.04. After I figured it out, I decided to write this article for those who are also troubled as I was.
Install X11VNC
1 | sudo apt install x11vnc |
create password (the following command create a encrpted password for the client to access the server )
The encryted password will be stored in the user folder.
1 | x11vnc -storepasswd |
You can then test x11vnc service by running following command.
1 | x11vnc -create -xkb -display :0 -noxrecord -noxfixes -noxdamage -rfbauth /home/$username/.vnc/passwd -usepw |
Display Manager Change
Since Ubuntu 19.04 use gdm3 for display manager ( to display login interface), which has some problem with x11vnc and I found no solution online, I then changed display manager to lightdm by using following command.
1 | sudo dpkg-reconfigure gdm3 |
You can change it to lightdm in the interface.
Start x11vnc on Boot
Afterwards, in order to make the x11vnc on boot, we need make it a service by creating this file to /etc/systemd/system/x11vnc.service
.
1 | [Unit] |
ExecStart
is the command we wanna execute. There are some new paramters.
-o /var/log/x11vnc.log
: specify the log file path
-auth guess
: let x11vnc autmatically determin display manager path on startup. Without this parameter, x11vnc has problem to execute before login
-forever
: Keep listening for more connections rather than exiting as soon as the first client(s) disconnect.
1 | # create the file |
Connect Remotely
You can then connect your Ubuntu 19.04 remotely. In Mac OS, you can easily connect by open Finder and press CMD
+ K
to open connect server promp and paste folllowing such kind of url:
1 | vnc://192.168.2.142:5900 |
vnc
is the protocal to be used;192.168.2.142
is the address of your ubuntu server;5900
is the port to your x11vnc service run on.
Hope this can help solve your problem:D