Ubuntu

Ubuntu Remote Desktop

If you need to access your Ubuntu machine while you are away from your Ubuntu system and you have a Windows PC, then you have come to the right place. This guide shows you how to access your Ubuntu machine remotely from any Windows computer.

Methods for Connecting to a Remote Desktop

There are multiple ways that you can access an Ubuntu machine from another computer. There are several third-party applications that allow remote desktop access from another system. For example:

  • SSH into the Ubuntu Machine’s terminal using putty
  • Remote Desktop Protocol (RDP)

SSH into the Ubuntu Machine

You can simply SSH into the Ubuntu machine’s terminal by installing putty on your windows system. You can download and install putty on your system by visiting the official putty website (Download PuTTY – a free SSH and telnet client for Windows).

Click the here anchor tag to download and install putty.

This button will take you to the Downloads page.

Choose the MSI (windows installer) file according to your operating system version, and the download will start.

Once the download is complete, run the MSI file and install Putty.

Enter the IP address of your Ubuntu machine, along with the port number, and click the Open button.

Type the username, provide the password, and hit Enter.

You should now be logged into your Ubuntu machine.

However, in this SSH method, access is restricted to the terminal only. For complete GUI access, you may try the RDP or VNC method covered in the next section.

Remote Desktop Protocol

RDP comes pre-installed in the Windows operating system. So, it is only necessary to install this software on the Ubuntu machine to use the remote system. This is the easiest way to access Ubuntu remotely, but it also has some constraints, such as problems with accessing the Ubuntu machine while a user is logged in.

This issue was bugged in Ubuntu 18.04 LTS and was still not resolved in Ubuntu 20.04 LTS. So, if you are using any version of Ubuntu earlier than 18.04, the following procedure should work for you. Otherwise, skip this method and use the VNC method to remotely access the Ubuntu machine from the Windows operating system.

To run it on the Windows operating system, search for the term “RDP” in the search bar, and click Remote Desktop Connection.

The application will run, and you will be asked to enter the IP address of the machine that you would like to access.

But, before that, you will need to install XRDP. To install XRDP, run the following command:

$ sudo apt install xrdp

You will be asked for permission to take additional disk space for the XRDP to install. Press “y” and the installation will begin.

Once the installation is done and XRDP is installed, check whether the XRDP service is running by issuing the following command:

$ sudo systemctl status xrdp

If the service is active and running, then this is great.

Otherwise, start the service by running the sudo systemctl start xrdp command.

$ sudo systemctl start xrdp

Enable the service to run/start it on the bootload time.

$ sudo systemctl enable xrdp

After running XRDP on the Ubuntu machine, it is now time to configure the firewall.

Configure the firewall by allowing port 3389 from any to any TCP connection, because XRDP listens on port number 3389.

$ sudo ufw allow from any to any port 3389 proto tcp

Once you allow the port, you are ready to access the Ubuntu machine from your Windows RDP.

Let us determine the IP address of the Ubuntu machine so that we can access it through the Windows Operating system’s RDP application.

$ ip a

As you can see, the IP address of my Ubuntu system is 192.168.18.134.

Now, access it through the RDP client from the Windows operating system.

Open the Remote Desktop Connection application and click the Show Options button.

Enter the IP address, type in the username of the Ubuntu system, check the Allow me to save credentials checkbox, and hit the Connect button.

A prompt will appear to confirm the connection; click Yes.

Enter the password of the specified user and click OK.

After providing the password, you will be logged into your Ubuntu machine from the Windows operating system.

About the author

Shehroz Azam

A Javascript Developer & Linux enthusiast with 4 years of industrial experience and proven know-how to combine creative and usability viewpoints resulting in world-class web applications. I have experience working with Vue, React & Node.js & currently working on article writing and video creation.