Desktop sharing Ubuntu system connected to local network
- Access Ubuntu Software Center
- Search for vnc server
- x11vnc server turns up as the top rated server, install it.
- Enable/Disable SSL encryption, Listening on LocalHost or file transfer as the need be.
- Use a VNC client of choice on Windows and connect.
First we need to start the display port to get connected with a remote system and for this you need to run below command in terminal.
x11vnc -display :0
On entering above command if it shows below message with port as 5901 and “:1” the we may need to connect this remort system with IP:1, eg. “192.168.100.2:1”
The VNC desktop is: microdebug-desk:1 PORT=5901
Install Remmina (Remote Desktop Viewer) from software center and access remote machine through it.
Goto Remote system and enter below command to get the IP address to get connected with.
ifconfig (or) ip a
Append zero “0” with the IP address taken from remote machine “192.168.100.2:0” and enter in the new connection window like below.
Create VNC Service [Optional]
This service layer will help running VNC server background always and your remote desktop can get connected to it at any time on request.
To create a service layer for this VNC you can follow below step
sudo touch /lib/systemd/system/x11vnc.service sudo vi /lib/systemd/system/x11vnc.service
Insert below lines into x11vnc.service file
[Unit] Description="x11vnc" Requires=display-manager.service After=display-manager.service [Service] ExecStart=/usr/bin/x11vnc -display :0 -auth guess -loop -forever -safer -shared -ultrafilexfer -bg -o /var/log/x11vnc.log ExecStop=/usr/bin/killall x11vnc [Install] WantedBy=multi-user.target
after this you can start and stop service by below commands
sudo service x11vnc start sudo service x11vnc stop
And to make the service start on boot
sudo systemctl enable x11vnc
See below article if you need to boot your system without monitor and connect via remote desktop connection.