How to Setup A Ubuntu Remote Desktop

Access a computer remotely with Ubuntu

Connect To Your Ubuntu Desktop Using Windows
Connect To Your Ubuntu Desktop Using Windows.

There are many reasons why you might want to connect to a computer remotely.

Maybe you are at work and you have realized you have left that important document on your computer at home and need to get it without getting back in the car and embarking on a 20-mile journey.

Possibly you have a friend who is having issues with their computer running Ubuntu and you wish to offer your services to help them fix it but without having to leave the house.

Whatever your reasons are for needing to connect to your computer this guide will help to achieve that aim, as long as the computer is running Ubuntu.

How to Share Your Ubuntu Desktop

There are two ways to set up a remote desktop using Ubuntu. The one we are going to show you is the more official way and the method that the Ubuntu developers have decided to include as part of the main system.

The second way is to use a piece of software called xRDP. Unfortunately, this software is a bit hit and miss when running on Ubuntu and while you may now be able to access the desktop you will find the experience a little frustrating due to mouse and cursor issues and general graphics based problems.

It is all due to the GNOME desktop that is installed by default with Ubuntu. You could go down the route of installing another desktop environment, but you may deem this as overkill.

The actual process of sharing the desktop is relatively straightforward. The tricky bit is trying to access it from somewhere that isn't on your home networks such as your workplace, hotel or internet cafe.

This guide will show you how to connect to the computer using Windows, Ubuntu and even your mobile phone.

Enable Sharing On Ubuntu

This guide is designed for the default Ubuntu GNOME desktop. If you're using a different desktop environment, the process won't be the same.

  1. Select the applications icon in the lower left of your screen.

    Ubuntu desktop show applications
  2. In the Activities overview, search for Settings.

    Ubuntu Activities search settings
  3. Launch the Ubuntu settings app.

  4. Select Sharing from the left side menu.

  5. On the Sharing tab, select Screen Sharing to bring up the options.

    Ubuntu Sharing settings
  6. First, select Allow connections to control the screen, if it isn't already.

    Ubuntu screen sharing settings
  7. Then, it's probably a good idea to select Require a password for a little bit of added security and to be able to sign in without accepting the connection on your Ubuntu PC.

  8. When you're ready, flip the switch at the top of the window to enable screen sharing.

    Ubuntu screen sharing enabled

Take a Note Of Your IP Address

Find Your IP Address
Find Your IP Address.

Before you can connect to your Ubuntu desktop using another computer you need to find out the IP address that has been assigned to it.

The IP address you require depends on whether you are connecting from the same network or whether you are connecting from a different network. Generally speaking if you are in the same house as the computer you are connecting to then you are more than likely going to need the internal IP address, otherwise you will need the external IP address.

How To Find Your Internal IP Address

  1. From the computer running Ubuntu open a terminal window by pressing the ALT + T keys at the same time.

  2. Type the following command into the window:

    ip a | grep -i inet
  3. You'll receive a list of IP addresses from the different interfaces on your computer. The one you're looking for will probably begin with 192.168. You're not looking for the one that ends in 255.

If you configured something different for your home network, it may begin with 10.something, but that's generally reserved for VPN connections.

Ubuntu IP address lookup

How To Find Your External IP Address

The external IP address is more easily found.

From the computer running Ubuntu open a web browser such as Firefox (usually the third icon from top on the Unity Launcher) and go to Google.

Now type What is my IP. Google will return the result of your external IP address. Write this down.

Connecting to Your Ubuntu Desktop From Windows

Whether you intend to connect to Ubuntu from your own home or elsewhere it is worth trying it out at home first to make sure it is running correctly.

Your computer running Ubuntu must be switched on and you must be logged in (although the lock screen can be showing).

In order to connect from Windows you need a piece of software called a VNC Client. There are loads to choose from but the one we recommend is called RealVNC.

  1. Select the link to Download VNC Viewer.

    RealVNC download page
  2. After the download has finished click on the executable (called something like VNC-Viewer-6.0.2-Windows-64bit.exe). This file will be located in your downloads folder.

  3. The first screen you will see is a license agreement Check the box to show you accept the terms and conditions, and press OK.

  4. Run through the rest of the installer. The default options are going to work find in most situations.

    Windows 10 RealVNC installer
  5. The next screen shows you all the functionality of Real VNC Viewer.

    There is a check box at the bottom of this screen that says usage data will be sent anonymously to the developers. This sort of data is usually used for bug fixing and improvements but you may wish to uncheck this option.

  6. Press Got It to move on to the main interface.

    RealVNC on Windows 10
  7. To connect to your Ubuntu desktop type the internal IP address into the box which contains the text Enter a VNC server address or search.

    RealVNC server search
  8. Select your server to connect.

  9. A password box should now appear and you can enter the password created when you set up desktop sharing. 

    RealVNC enter password
  10. You should now see your Ubuntu desktop on your other PC.

    Windows 10 RealVNC connected to Ubuntu
  11. When you want to disconnect, move your cursor to the top of the window, and select the X icon to close the connection.

    Windows 10 end RealVNC session

Ubuntu should now appear.

Troubleshooting

You may receive an error stating that the connection cannot be made because the encryption level is too high on the Ubuntu computer.

The first thing to try is to increase the level of encryption the VNC Viewer is attempting to use. To do this:

  1. Choose File > New Connection.

  2. Enter the internal IP address into the box VNC Server.

  3. Give the connection a name.

  4. Change the Encryption option to be always maximum.

  5. Press OK.

  6. A new icon will appear in the window with the name you gave it in step 2.

  7. Double-click on the icon.

If this fails right-click on the icon and click Properties and try each encryption option in turn.

In the event that none of the options work follow these instructions:

  1. Open a terminal on the Ubuntu computer (press ALT + T)

  2. Type the following command:

gsettings set org.gnome.vino require-encryption false
Ubuntu disable VNC encryption

You should now be able to try to connect to Ubuntu again using Windows.

Connect to Ubuntu From The Outside World

To connect to Ubuntu from the outside world you need to use the external IP address. When you try this the first time you will probably not be able to connect. The reason for this is that you need to open a port on your router to allow outside connections.

The way to open ports is a diverse subject as each router has its own way of doing this. There is a guide on Lifewire to do with port forwarding but for a more extensive guide visit https://portforward.com/.

Start by visiting https://portforward.com/router.htm and choose the make and model for your router. There are step by step instructions for hundreds of different routers so yours should be catered for.

Connect to Ubuntu Using Your Mobile Phone

Connecting to the Ubuntu desktop from your Android phone or tablet is as easy as it is for Windows.

Install RealVNC on Android

Open up the Google Play Store and search for VNC Viewer. The VNC Viewer is provided by the same developers as the Windows application.

  1. Open up the VNC Viewer and skip past all the instructions.

    Android RealVNC create connection
  2. Eventually, you will get to a blank screen with a green circle with a white plus symbol in the bottom right corner. Select it.

  3. Enter the IP address for your Ubuntu computer (either internal or external depending where you are located). Give your computer a name.

  4. Press Create, and you will now see a screen with a Connect button. Press Connect.

  5. A warning may appear about connecting over an unencrypted connection. Ignore the warning and enter your password as you did when connecting from Windows.

    Android RealVNC connection

Your Ubuntu desktop should now appear on your phone or tablet. 

Android RealVNC connected to Ubuntu

The performance of the application will depend on the resources of the device you are using.