Enable RDP in Ubuntu SSH

How to enable RDP/VNC in Ubuntu Remotely – SSH

Setting up Remote Desktop in a Ubuntu or any other Linux is always tricky. The RDP feature in Windows or Mac comes along with OS. To take a Remote Desktop on Ubuntu the one needs to install third party softwares such as Tiger VNC Server, Real VNC Server, etc..  From Ubuntu 16.04, Vino VNC Server comes along with OS. But it is not enabled by default. User have to enable it from the Ubuntu Settings option. Enabling from GUI is a straightforward approach. But there is no official documentation to enable f RDP or VNC server via command line. So, In this article explains “How to enable RDP/VNC in Ubuntu using terminal / SSH ?”

How to enable RDP/VNC in ubuntu Remotely – SSH or Command line

There are two ways to setup Ubuntu Remote Desktop or VNC Server:

  1. GUI Method
  2. Command line Method

GUI Method:

I already wrote an article to enable VNC through GUI Method. Please See the below Link:

How to enable Remote Desktop on Ubuntu 16.04 / Ubuntu 18.04

Command line method:

If you are not able access the physical system, then the above step won’t help you much. Please follow the below steps to enable it via console:

1. Enable Auto Login for a user:

VNC or Remote Desktop will not work if the system is in locked state. So, enable the Automatic login for a user:

  •  Enter below command
sudo vi /etc/gdm3/custom.conf
  • Change the below line as below: “username” should be your ubuntu login username
# Enabling automatic login
AutomaticLoginEnable = true
AutomaticLogin = username
  • Save the File
  • Reboot the system using below command
sudo reboot

2. Setup Vino VNC Server:

  1. Enter below commands one by one, The last setting is a password option, you can change abc to your own passwords.
gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino authentication-methods "['vnc']"
gsettings set org.gnome.Vino require-encryption false
gsettings set org.gnome.settings-daemon.plugins.sharing active true
gsettings set org.gnome.Vino vnc-password $(echo -n 'abc'|base64)

2. Enter the below command and copy the UUID of your Ethernet connection:

nmcli c

Example output:

NAME                UUID                                  TYPE      DEVICE  
Wired connection 1  e1ba1805-f254-78f8-b6e5-123cdf398be0  ethernet  enp2s0 

3. Use the Copied UUID e1ba1805-f254-78f8-b6e5-123cdf398be0 in the below command:

gsettings set org.gnome.settings-daemon.plugins.sharing.service:/org/gnome/settings-daemon/plugins/sharing/vino-server/ enabled-connections "['e1ba1805-f254-78f8-b6e5-123cdf398be0']"

4. Enter below command to start the VNC Viewer:

nohup /usr/lib/vino/vino-server &

All are setup. Connect with VNC Viewer and test the setup

  1. Download VNC viewer
  2. Enter IP address and Click Enter
  3. Enter password: abc

If you want to see all setting about vino, type below command:

gsettings list-recursively org.gnome.Vino

This will give the settings info as below:

org.gnome.Vino alternative-port uint16 5900
org.gnome.Vino disable-background false
org.gnome.Vino use-alternative-port false
org.gnome.Vino icon-visibility 'client'
org.gnome.Vino use-upnp false
org.gnome.Vino view-only false
org.gnome.Vino prompt-enabled false
org.gnome.Vino disable-xdamage false
org.gnome.Vino authentication-methods ['vnc']
org.gnome.Vino network-interface ''
org.gnome.Vino require-encryption false
org.gnome.Vino mailto ''
org.gnome.Vino lock-screen-on-disconnect false
org.gnome.Vino vnc-password '548ch'

Leave a Reply

avatar
  Subscribe  
Notify of
%d bloggers like this: