Remotely access the graphical interface of the Ubuntu system through XManager or VNC
1. XManager remote access to Ubuntu graphical interface
Reference article: Xmanager remote access to Ubuntu1604LTS
The following steps have been actually tested and can be used on both Ubuntu16.04 and Ubuntu18.04.
1. Install gdm3 and lightdm
Execute the command sudo apt install gdm -y
to install gdm3, a window will pop up, just select lightdm.
You can also sudo dpkg-reconfigure gdm3
set the default display manager by
2. Configure lightdm
1. Create a new and edit configuration file: sudo vi /etc/lightdm/lightdm.conf
paste the following content:
[SeatDefaults]
greeter-show-manual-login=true
xserver-allow-tcp=true
[XDMCPServer]
Enabled=true
Port=177
2. Create a new and edit configuration file: sudo nano /etc/lightdm/gdm.schemas
paste the following content:
<schema>
<key>xdmcp/Enable</key>
<signature>b</signature>
<default>true</default>
</schema>
3. Install xubuntu-desktop
xubuntu-desktop uses xfce, a lightweight Unix desktop management environment. Execute the following installation command:
sudo apt-get update
sudo apt-get upgrade
sudo apt install xfce4
sudo apt install xubuntu-desktop -y
4. Turn off the firewall
Turn off the firewall: sudo ufw disable
or allow port 177:sudo ufw allow 177
5. Modify the configuration Ubuntu file
Modify the configuration file: sudo nano /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
The modified content is as follows:
[Seat:*]
user-session=ubuntu
[XDMCPServer]
enabled=true
[SeatDefaults]
xserver-allow-tcp=true
6. Restart the XDMCP daemon
Restart lightdm: sudo service lightdm restart
View status:systemctl status lightdm.service
7. Remote access to X Window
If XManager crashes when accessing the graphical interface, you can try switching to another desktop system.
2. VNC remote access to Ubuntu graphical interface
Refer to the following articles, which are feasible for practical use:
Build Ubuntu 16.04 graphical interface through VNC
Build Ubuntu 18.04 and 20.04 graphical interface through VNC
If you encounter the problem that VNC (win10) and Ubuntu16 cannot interoperate [copy and paste], you only need to enter in the Ubuntu terminal: The vncconfig
following dialog box appears, keep this box there, and you can copy and paste:
3. X11VNC remote access to Ubuntu graphical interface
Reference article: Ubuntu X11VNC remote desktop installation and use