Remote desktop protocol is a popular network protocol that is often used to manage computers in Windows environments by connecting to them remotely. This protocol can be used to connect to Windows-based machines that are either real or virtual. But if your computer has Linux  installed with a graphical user interface (GUI), you can use the remote desktop protocol (RDP) to set up remote desktop connections from Linux machines to Windows machines and from Windows machines to your Linux machines. If you need to, you can also use RDP to connect Linux machines to other Linux machines. It is easy to connect to virtual machines running in public clouds like Azure, Amazon EC2, and Google Cloud by using RDP for Ubuntu.

There are three network protocols that are most often used to manage Ubuntu:

  1. SSH (Secure Shell)
  2. RDP (Remote Desktop Protocol)
  3. VNC (Virtual Network Computing)

This blog post shows how to set up Ubuntu’s remote desktop, which can also be used with other Linux distributions.

How to Connect to a Remote Desktop in Ubuntu

Most of the time, you have to install the Ubuntu remote desktop client on your Ubuntu Linux system by hand. In today’s blog post, VMware’s virtual machine is set up with Ubuntu 18.04.2. The text editor vim, the net-tools, and the SSH server are already installed on our Ubuntu before we set up Ubuntu remote desktop (which allows you to connect via SSH to the Linux console remotely). With a single command, you can install these packages.

Depending on the direction of the connection, you need to install either the RDP client or the RDP server in order to set up Ubuntu RDP connections.

Using Remmina – Ubuntu Remote 

Remmina is free, open-source software that helps system administrators set up Ubuntu remote desktop connections. Remmina supports not only RDP for Ubuntu, but also VNC, SSH, and SPICE, which are other remote desktop protocols. In this remote desktop protocol tutorial, you can find out how to install and set up Remmina as the Ubuntu remote desktop client. You can use one of the two methods below to install Remmina.

Install Remmina in the GUI

To get to the Main Menu, click the button in the bottom left corner of the Ubuntu Desktop.

In the search box, type rdp.

You can see that the remote desktop client has been found to be Remmina.

On this screen, click Remmina.

You are taken to the page for Ubuntu software. If you click Remmina, you can find out more about this software.

Click Install to put the remote desktop client Remmina in place.

To install packages, you will need to enter your password.

Wait until all the needed packages have been put in.

Xrdp – Ubuntu Remote Desktop Server

You can also set up a Remote Desktop server on your Linux system and use a standard Windows Remote Desktop client to connect to it from a Windows machine. Popular Linux + distributions don’t come with the Remote Desktop server installed, but you can manually install and set up the server so that you can manage a Linux machine remotely in graphical mode. In this section, we will show you how to set up access to Ubuntu 18.04.2 through the Remote Desktop Protocol. The most important thing you need for this is xrdp.

Xrdp is a version of Microsoft RDP that lets operating systems other than Windows use the RDP server’s features. The code for Xrdp is free and open source. For xrdp to work, you need to have the X Window system. Let’s find out how to set up an Ubuntu server for a remote desktop.

Update the software repository tree first:

sudo apt-get update

Install xrdp from software repositories on the Internet:

sudo apt-get install xrdp

You must put the XFCE desktop environment in place. By default, Ubuntu 18 comes with GNOME 3, but XFCE, which is a lighter desktop environment, works better with xrdp. After you install XFCE and set up RDP for Ubuntu, you will still be able to use GNOME to log in locally to Ubuntu Linux.

Hence, install XFCE: sudo apt-get install xfce4

Make the.xsession file in your user’s home directory and write the xfce4-session string into it. So, you set up the xrdp server so that the default graphical environment is xfce.

echo xfce4-session > /home/username/.xsession

Set up your Linux so that xrdp starts automatically when it boots up.

sudo systemctl enable xrdp

To make changes take effect, you need to restart the xrdp service.

sudo service xrdp restart

Clear the settings in the startwm.sh shell script file that are needed to start xrdp:

sudo sh -c “cat > /etc/xrdp/startwm.sh /dev/null”

(If you need to, you can make a copy of that file before running the command above by typing cp /etc/xrdp/startwm.sh /etc/xrdp/startwm.sh1)

Vim can be used to change the startwm.sh shell script configuration file:

sudo vim /etc/xrdp/startwm.sh

The following lines must be in the startwm.sh shell script file:

#!/bin/sh

-r /etc/default/locale; then

. /etc/default/locale

export LANG LANGUAGE

fi

startxfce4

Leave a blank line at the end of the file.

Conclusion 

It has shown how to use remote desktop connections in Ubuntu Linux. Ubuntu makes it easy for most users to set up both incoming and outgoing remote desktop connections. To connect Ubuntu to Windows computers and other computers, you need to install a remote desktop client. You need to install and set up a remote desktop server on your Ubuntu Linux machine so that you can connect to it. For this, Xrdp and XFCE must be installed.

If you can’t use RDP with Ubuntu for some reason, you could use VNC, which is a different protocol. Using RDP and VNC, you can use the graphical user interface to connect to your real and virtual machines from afar. To keep your data safe, don’t forget to back up your Linux servers and virtual machines.  You can learn about linux certificates.  You can back up your virtual machines and physical servers by downloading NAKIVO Backup & Replication.