How to Establish Remote Desktop Access to Ubuntu From Windows
You’re in one room, sitting in front of a PC; the data you want is in another, on a computer running Ubuntu. If both computers are in the same house, no problem; but what if they’re in the same office block? It might be a bit of a walk!
The answer, therefore, is setting up a remote desktop connection. Two good remote desktop options are available for Windows users to access Ubuntu.
Why Remote Connect to Ubuntu From Windows?
There are several reasons why you might want to remote connect to your Ubuntu computer. Perhaps you’re at work and need to log into your home computer. Alternatively, you might have an Ubuntu PC in one room, your Windows PC in another, and a desire to run updates on Ubuntu.
Alternatively, you might be running an Ubuntu server. Perhaps you set this up to manage the running of a game, like Counter-Strike, or Minecraft. Either way, a method of setting up a remote connection will save a lot of time and effort.
You have two options for establishing a remote connection with your Ubuntu machine: you can use Remote Desktop (RDP) or Virtual Network Computing (VNC).
Let’s look at each method in turn.
Find Your Ubuntu PC’s IP Address
Before you can establish a connection to your Ubuntu device, you’ll need to know the IP address.
The first way is the easiest. Physically go to the Ubuntu machine, press Ctrl + Alt + T to open the Terminal, and input the command:
Look for the “inet addr” against the connection you’re currently using. For instance, if you’re on Wi-Fi, look for wlan0. If the computer is connected to the network for Ethernet, look for eth0.
Another way to find the IP address is to find the connection icon in the panel, right-click, and select Connection Information. You’ll find the IP address listed here.
Neither of these options open? You can also connect to your router directly, via your computer’s browser.
Once signed into the router’s admin console, you’ll be able to see which devices are connected. Just look for your Ubuntu device name, find the IP address, and make a note of it for later.
1. Remote Access Using SSH
Before you start, you might want to install PuTTY on your PC (or just try the built-in Windows SSH function). This enables you to set up an SSH connection, which gives remote access to the Ubuntu command line.
To be clear: this isn’t a remote desktop option; there is no mouse control. But it is useful to have in order to remotely install the tools you’ll be using. SSH is often disabled by default, however, so if it is not installed, you’ll need to fix this.
In short, it depends on which Ubuntu version you’re using, and whether you’ve used SSH previously.
Once installed via the terminal (sudo apt install openssh-server) you’ll be able to make a remote connection (just using the IP address and the Ubuntu username and password) and use the terminal to install the tools you need for RDP and for VNC.
2. Remote Access Using Remote Desktop Protocol
The easiest option is to use Remote Desktop Protocol or RDP. Built into Windows, this tool can be used to establish a remote desktop connection across your home network. All you need is the IP address of the Ubuntu device.
While the necessary software is pre-installed on Windows, you’ll need to install the xrdp tool on Ubuntu. To do this, open a Terminal window (Ctrl + Alt + T) and enter:
sudo apt install xrdp
Follow this with
sudo systemctl enable xrdp
Wait for this to install, then run the Remote Desktop application in Windows using the Start Menu or Search. Type rdp then click on Remote Desktop Connection. With the app open, input the IP address in the Computer field.
Next, click Show Options and add the Username for the Ubuntu PC. You can click Save to keep these settings for reuse on another occasion.
Click Connect to start the connection and input the Ubuntu account password when prompted. The connection will then be established, giving you full mouse and keyboard access to your remote Ubuntu computer.
While RDP is a great option for remote connecting to your Ubuntu PC, with the arrival of Ubuntu 18.04 LTS, it is less reliable. There appears to be an issue with establishing a remote connection while already logged into the same account on the Ubuntu machine.
As such, the simple way around this is to simply log out of the Ubuntu computer.
If this isn’t possible, try switching the RDP connection from using the Xorg server to using X11rdp, waiting for that to fail, and then trying Xorg again.
You might also attempt connection after restarting the Linux machine.
3. Remote Access Using Virtual Network Computing
Another option with full remote desktop functionality is VNC. This requires a client application on the Windows PC and a server on Ubuntu.
On the remote PC, install the TightVNC Server component after checking for updates:
sudo apt update
Then install the server utility:
sudo apt install tightvncserver
You’ll then need to run it:
At this point you’ll be prompted to set a password for the connection. You’ll also be given a desktop number, usually :1. Keep a note of this.
Now that TightVNC Server is set up on Ubuntu, you’ll need to install the client on Windows. This can be downloaded from www.tightvnc.com/download.php—make sure you choose the right version, as it is available in 32-bit and 64-bit flavors.
TightVNC tools are only available as a bundle, so once installed, look for TightVNC Viewer in Windows search.
Once you’ve launched the viewer, input the IP address of the Ubuntu box in Remote Host, followed by the desktop number. So, it might look like this:
Input the password when prompted and commence your remote desktop activity!
Making TightVNC More Secure
By default, TightVNC will encrypt your password, but nothing else. This makes it insecure for connections over the internet. Fortunately, it can be made more secure, thanks to SSH and Xming.
To use this, download and install the Xming tool for Windows from Sourceforge. Once this is done, look for the desktop shortcut, right-click, and choose Properties.
Look for the Shortcut tab, and in the Target field, enter the following:
"C:\Program Files (x86)\Xming\Xming.exe" :0 -clipboard -multiwindow
Click Apply to save the change, then OK. Double-click the icon to run Xming, then open PuTTY. Here, expand the menu on the left to Connection > SSH > X11.
Check Enable X11 Forwarding, then return to Session at the top of the menu.
Enter the IP address for the remote device and click Open. Moments later, a secure connection to the remote Ubuntu desktop will be available.
Choosing the Right Remote Access Solution
How you use these methods depends on what you want to get out of your remote desktop experience.
Three main options are available:
- RDP: This uses the Windows Remote Desktop Protocol, via the open source xrdp implementation.
- VNC: Virtual Network Computing is an alternative to RDP, but less secure.
- VNC over SSH: Mixing VNC with SSH improves the security of the connection.
You can also use SSH to issue some remote instructions to your Ubuntu PC.
We’ve shown you three ways to establish a remote connection to your Ubuntu computer or server from Windows. Each has its advantages and disadvantages. But if you just want to quickly dip into Ubuntu, why not try the Windows Subsystem for Linux, available on Windows 10?
Explore more about: Remote Access, Remote Desktop, Ubuntu, VNC.