Linux remote desktop. Remote graphical access to ubuntu via VNC Remote access to ubuntu from a windows machine

In this article, we will look at several ways to connect remotely from Windows to Ubuntu.

Imagine you are in the same room, sitting in front of a Windows computer; the data you need is on another computer running Ubuntu. If both computers are in the same house, no problem; but what if they are in the same office block?

Why connect to Ubuntu remotely from Windows?

There are several reasons why you might need to connect remotely to your Ubuntu computer. Perhaps you are at work and need to log into your home computer. Alternatively, you may have an Ubuntu computer in one room, a Windows computer in another, and want to run updates on Ubuntu.

Alternatively, perhaps you are using an Ubuntu server. You may have configured it to control the launch of a game such as Counter-Strike or Minecraft. In any case, setting up a remote connection will save a lot of time and effort.

You have two options for establishing a remote connection to your Ubuntu computer: you can use Remote Desktop (RDP) or Virtual Network Computing (VNC).

Let's look at each method in turn.

Find out the IP address of your Ubuntu PC

Before you can connect to your Ubuntu device, you need to know the IP address.

The first method is the simplest. Physically go to your Ubuntu device, press Ctrl + Alt + T to open a terminal and enter the command:

Ifconfig

Look for "inet addr" next to the connection you are currently using. For example, if you are using Wi-Fi, look for wlan0. If the computer is connected to a 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 details. Here you will find the IP address.

Can't open any of these options? You can also connect to the router directly through your computer's browser.

After logging into the router's administration console, you will be able to see what devices are connected. Just search for your Ubuntu device name, find the IP address and write it down.

1. Connect via SSH

Before you get started, you might want to install PuTTY on your computer (or just try the built-in Windows SSH feature). This will allow you to establish an SSH connection which gives you remote access to command line Ubuntu.

To be clear, this is not a remote desktop option as there are no mouse controls. But it's useful to have the tools you'll use for remote installation. However, SSH is often disabled by default, so if it's not installed, you'll have to fix that.

In short, it depends on what version of Ubuntu you are using and whether you have used SSH before.

After installation via terminal ( sudo apt install openssh-server) you will be able to establish a remote connection (simply using the IP address and Ubuntu username and password) and use the terminal to install necessary tools for RDP and for VNC.

2. Remote access using Remote Desktop Protocol

The simplest option is to use the Remote Desktop Protocol or RDP. Built into Windows, this tool can be used to create a remote desktop connection in your home network. All you need is the IP address of your Ubuntu device.

While necessary software comes pre-installed on Windows, you will need to install the xrdp tool on Ubuntu. To do this, open a terminal window ( Ctrl + Alt + T) and enter:

Sudo apt install xrdp

Sudo systemctl enable xrdp

Wait for it to install, then launch the Remote Desktop application on Windows using the Start or Search menu. Enter rdp and click on Remote Desktop Connection. Once the application is open, enter the IP address in the Computer field.

Then click the button Show options and add Username for Ubuntu PC. You can click Save to save these settings for use again next time.

Click the button To plug to begin connecting and enter your Ubuntu account password when prompted. After this, the connection will be established, giving you full access to the remote Ubuntu computer using your mouse and keyboard. If you plan to use this connection frequently, you can create a configuration file for it to save time.

Troubleshooting RDP problems

While RDP is a great option for connecting remotely to your Ubuntu computer, with the arrival of Ubuntu 18.04 LTS it is less reliable. There appears to be an issue establishing a remote connection when the account is already logged in on the Ubuntu machine.

So an easy way to get around this is to simply log out the user.

If this is not possible, try switching the RDP connection from using the Xorg server to using X11rdp, wait until that works, and then try Xorg again.

You can also try to establish a connection after rebooting your Linux machine.

3. Remote access using virtual network (VNC)

Another option with full remote desktop functionality is VNC (Virtual Network Computing). This requires a client application on a Windows PC and a server on Ubuntu.

On the remote PC, install the TightVNC Server component after checking for updates:

Sudo apt update

Install the server:

Sudo apt install tightvncserver

And run:

Sudo tightvncserver

At this point, you will be asked to set a password for the connection. You will also be assigned a desktop number, usually:1. Write it down.


Now that TightVNC Server is configured on Ubuntu, you will need to install the client on Windows. It can be downloaded from www.tightvnc.com/download.php - make sure you select the correct version as it is available in 32-bit and 64-bit.

TightVNC tools are only available as a bundle, so after installation, search for TightVNC Viewer in Windows search.

After launching the viewer, enter the Ubuntu IP address into the host, followed by the desktop number. It might look like this:

192.168.0.99:1

Enter your password when prompted and start working on your remote desktop!

Making TightVNC more secure

By default, TightVNC will encrypt your password, but nothing else. This makes it unsafe for Internet connections. Luckily, it can be made more secure thanks to SSH and Xming.

To do this, download and install the tool from Sourceforge. After that, find the desktop shortcut, right-click and select Properties.


Look for the Shortcut tab, and in the Target field enter the following:

"C:\Program Files (x86)\Xming\Xming.exe" :0 -clipboard -multiwindow

Check the box Enable X11 forwarding, then return to session at the top of the menu.


Enter the IP address of the remote device and click Open. After a few seconds, a secure connection to the Ubuntu remote 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.

Three main options are available:

  • RDP: It uses the Windows Remote Desktop Protocol, via the open source xrdp implementation source code.
  • VNC: Virtual Network Computing is an alternative to RDP but is less secure.
  • VNC over SSH: Mixing VNC with SSH improves connection security.

You can also use SSH to control the terminal on your Ubuntu computer.

We've shown you three ways to establish a remote connection to your Ubuntu computer or server from Windows. Each of them has its own advantages and disadvantages. But if you just want to get your feet wet with Ubuntu, why not try the Windows Subsystem for Linux available in Windows 10?

Remotely connecting to a Linux desktop from Windows using Xming and SSH

Unlike Windows, in Linux the graphical shell is not part of the system kernel. The standard window system for Linux is the X Window System, or, simply put, X's. It takes care of rendering graphic elements and interacting with input/output devices. And the best part is that this system has a transparent client-server architecture. The window system acts as a server, and graphical applications act as clients. As clients should, they connect to the server and interact with it to render and receive mouse and keyboard events.

But that is not all! The fact is that the window system can be located on another computer, and the graphical application can communicate with it via the network. This way you can run the application on a remote computer, forcing it to be drawn on the computer you are currently working on. Or vice versa. Or run the program on one remote computer and draw the interface on another remote computer.

1.SSH client. I installed PuTTY.

2.X Server for Windows. I chose Xming.

First, let's establish an SSH connection with a remote computer. To do this, launch PuTTY. Enter the IP address of the Linux computer

Now go to the Connection / SSH / X11 section and enable GUI redirection. Enter the IP address as the location of the X server Windows computer, which we are currently sitting on (it will most likely be 127.0.0.1)

In addition, so that crocodile does not appear instead of Russian letters, it is advisable to set the correct encoding in the Window / Translation section (I have UTF8 - the standard encoding on Debian and Ubuntu). We return to the Session section, save the settings and connect to the Linux computer. If the connection is successful, we enter the username and password and see a text console. With its help, we can remotely launch console programs, but graphics programs cannot be drawn in the console. Therefore, we will leave our connection via SSH for a while.

Now let's configure Xming. To do this, launch the XLaunch program - this is a settings wizard. In the first step, we indicate the method of integration into the Windows graphical environment. I prefer the first one, where each Linux application is in its own window.

In the second step, we are asked to automatically launch some application along with X. I chose to do this later as needed using PuTTY that we already had running.

In the third step, we specify the Xming launch parameters. The Clipboard option allows you to integrate the clipboard. Also, for full operation, I entered the following parameters:

“-dpi 96? – to adjust the font size. The value can be adjusted to taste.

“-xkblayout us,ru” – for working with two keyboard layouts.

“-xkbvariant basic,winkeys” – clarification of layouts.

“-xkboptions grp:caps_toggle” – switching the layout using the CAPS LOCK key.

And finally, in the next step, save the settings with the “Save configuration” button and start the X server with the “Finish” button.

The Xming icon will appear in the system tray.

So, the X server is running. We return to our console provided by the SSH connection. Here we can remotely launch a console application, and in the same console we will see the output of this application. What will happen now if we try to run a graphical application in this console? Typically, if you connect via SSH and try to launch a windowed application, you will get an error because you connected to the remote computer in console mode and there is simply nothing to draw windows with. However, this time we enabled graphics redirection to our Windows computer, which already has its own X server running. Therefore, if you try to run a windowed application in a remote console terminal, its window will be drawn on the Windows computer. For example, try typing the following command:

$gedit&

The ampersand at the end of the command indicates that the program should be run at background so that while it is running, the console is available for other actions.

Xrdp is an open source tool that allows users to access a Linux remote desktop via Windows RDP.

Apart from Windows RDP, the xrdp tool also accepts connections from other RDP clients such as FreeRDP, rdesktop and NeutrinoRDP

XRDP Requirements

  • xrdp and xorgxrdp packages
  • Listens to 3389/tcp. Make sure your firewall is accepting connections

In this article, I will show how you can remotely connect to Ubuntu Desktop from a Windows computer using the Xrdp tool.

1) Installation on Linux

on Ubuntu 18.04

Firstly, you need to install Xrdp on Ubuntu

# apt install xrdp Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: xorgxrdp Suggested packages: guacamole xrdp-pulseaudio-installer The following NEW packages will be installed: xorgxrdp xrdp 0 upgraded, 2 newly installed, 0 to remove and 256 not upgraded. Need to get 498 kB of archives. After this operation, 3,303 kB of additional disk space will be used. Do you want to continue? y

You should configure a polkit rule to avoid authentication popup after entering username and password on xrdp login screen in windows

# vim /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf polkit.addRule(function(action, subject) ( if ((action.id == “org.freedesktop.color-manager. create-device" || action.id == "org.freedesktop.color-manager.create-profile" || action.id == "org.freedesktop.color-manager.delete-device" || action.id = = “org.freedesktop.color-manager.delete-profile” || action.id == “org.freedesktop.color-manager.modify-device” || action.id == “org.freedesktop.color-manager. modify-profile”) && subject.isInGroup(“(group)”)) ( return polkit.Result.YES; ) ));

restart xrdp service

# systemctl restart xrdp

Then make sure the service is running

# systemctl status xrdp ● xrdp.service - xrdp daemon Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: en Active: active (running) since Tue 2018-10-16 02:05:21 WAT; 11min ago Docs: man:xrdp(8) man:xrdp.ini(5) Main PID: 2654 (xrdp) Tasks: 1 (limit: 2290) CGroup: /system.slice/xrdp.service └─2654 /usr /sbin/xrdp

Now make sure that you automatically start the service when the system starts.

# systemctl enable xrdp Synchronizing state of xrdp.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable xrdp

Now you will need to check your IP address because you will need it to connect

# ip add 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:0c:29:ef:f6:9b brd ff:ff:ff:ff:ff:ff inet 172.16.8.177/24 brd 172.16.8.255 scope global dynamic noprefixroute ens33

My IP address is 172.16.8.177. So keep that in mind.

Xrdp works on port 3389, so be sure to open it.

UFW is disabled by default, so you need to enable the firewall and create a rule for xrdp

# ufw enable # ufw allow 3389/tcp

Now you can continue configuration from the windows side.

On Centos/Redhat 7

Be sure to install the Epel repositories first

# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Now install xrdp packages

# yum update && yum -y install xrdp tigervnc-server

Add a rule to your firewall. On Centos/RedHat ufw does not work, but firewalld does.

# firewall-cmd --permanent --zone=public --add-port=3389/tcp

Then restart your firewall

# firewall-cmd --reload

Now enable and restart the xrdp service

# systemctl enable xrdp && systemctl restart xrdp

Check your IP address for remote connection in Windows

2) Connect from Windows

On your windows computer, such as windows 10 in our case, launch the default Remote Desktop Connection tool.

You will need to enter your device's IP address and you will be prompted to enter a username

Ubuntu/CentOS Remote Desktop Access

Enter IP address and username

Now confirm the information and start the connection.

If you are not logged out locally, remote login will fail.

You will now be asked to enter your password

Now confirm your credentials. You can see my Ubuntu's IP address at the top and the login page. Enter your password and enjoy

Remote Desktop allows you to connect to your computer over the Internet using another computer or even a smartphone. You may often need to do something on another computer, even if you are not near it. Ubuntu also has this option.

In this article, we will look at how to set up a remote desktop on Ubuntu 16.04, as well as how to connect to it using various devices. We will use VNC as the remote access protocol; it is slow and already outdated, but it is supported everywhere. In Ubuntu 16.04, almost all the software is already installed by default, you just need to change a few settings.

Ubuntu Remote Desktop

As I already said, we will use VNC as the remote access protocol. And as a server - Vino, this program is supplied by default with the distribution. And all you have to do is make a few settings for it to work.

Open the Dash main menu and search for Desktop Sharing.

If the system does not detect anything, this is a common bug. You can run the utility through the terminal. To do this, open a terminal with Ctrl+Alt+T and do:

vino-preferences

Next, in the window that opens, check the box "Allow other users to see your desktop" Then opposite the field "Require password" enter the password that will be used to connect:

That's it, ubuntu remote desktop is configured. And now you can try to connect to your computer using another Linux distribution. But there is one more point. You won't be able to connect from Windows. By default, mandatory encryption is enabled. And this is not supported by all clients. To disable forced encryption you need to install dconf-editor:

sudo apt install dconf-editor

Then open the program and follow the path org.gnome.desktop.remote-desktop there, uncheck the box:

Now you are ready to test your ubuntu remote desktop connection. Open the main menu and find the Remmina remote connection client.

In the connection line, select the protocol VNC, then enter the address, since we are going to check on the local machine, then enter localhost, in other cases you will have to use the computer’s IP address. Next click "Connect":

Immediately the program will ask you for a password to gain remote access to the computer:

And then, in the VNC system, the server will ask whether this client needs to be allowed to connect to the ubuntu 16.04 remote desktop:

Once you approve the connection, you can use the remote desktop. Now is the time to connect from another computer. You can use any VNC client for Linux, Windows or Android and connect to your computer if it is on the local network. In addition, you can access it even via the Internet by creating a private local network, for example, using hamachi or OpenVPN.

conclusions

In this article, we looked at how to set up a remote desktop on Ubuntu 16.04, as well as how to access it using other devices. Everything is very simple, even simpler than with x11vnc, for which you need to create several configuration files. If you have any questions, ask in the comments!

Related posts:


One of useful functions Windows is that you can connect to your desktop from another location to control your computer remotely. Luckily, major Linux distributions also offer this feature, and Ubuntu is one of them. If you want to connect to your Windows computers from Ubuntu remotely, you can use the default RDP client found in it, called Remmina. Here's how to create, configure, and install a remote desktop connection from Ubuntu on Windows.

NOTE. This tutorial was created on Ubuntu 18.04 LTS (Bionic Beaver). However, this works on other versions of Linux as well.

Step 1: Enable Remote Desktop Connections on Windows PC

If you want to allow other computers to connect remotely to your Windows PC, you must first configure it to accept Remote Desktop connections.

Step 2: Launch the Remmina Remote Desktop Client

By default, Ubuntu comes with a remote desktop client application that supports the Remote Desktop Protocol (RDP) used by operating systems Windows for remote connections. You can find it in the Ubuntu application list.

If you prefer to search, you can find the default Ubuntu RDP client using the RDP search term.

Step 3: Set up and install Ubuntu Remote Desktop Session for Windows

When you open the Remmina Remote Desktop Client, you should see something like this:

Click the "Create a new connection profile" button.

Its icon is a green plus sign, which is easy to spot in the upper left corner of the window.

The previous action opens a window called “Remote Desktop”. Here you can configure the Ubuntu Remote Desktop connection to Windows that you are about to install.

In the Profile section, enter the Name you want to use to connect. It could be anything. Leave the other settings from the Profile section at their default settings.

In the Server field on the General tab, enter the IP address of the Windows PC you will be connecting to. Enter the username and user password for the user account you want to use on the remote Windows PC. This user account must exist on the Windows PC.

If you are using account Microsoft on Windows PC, then it's ok to fill in your address Email and password. If your Windows PC is part of a domain, enter it in the Domain field, otherwise leave it blank.

You can then set the resolution and color depth you want to use for your remote desktop connection. By default, the Remote Desktop profile is set to "Use client resolution", which means that the connection uses the same resolution as the Windows computer you are connecting to. The color depth is also set to the highest quality possible. However, choosing a lower desktop resolution and color depth can improve the performance of a Linux to Windows remote desktop session. If when connecting to a remote worker Windows desktop delay occurs, try reducing the color depth or resolution.

When you are done setting up all the details, click Save and Connect. This will save your connection profile and then initiate an RDP connection to your Windows PC.

After a few seconds, you should have a working remote desktop connection on your Windows PC.

You can also connect to a remote computer under Windows control without any of the personalization steps mentioned earlier. However, this means that you will have to reconfigure the Remote Desktop Connection profile the next time remote control your Windows PC.

Publications on the topic

  • Can't play online via Hamachi Can't play online via Hamachi

    The technical understanding of VPN technology and its implementation on a personal computer is not always easy for the average user...

  • No license found to use the program! No license found to use the program!

    The 1C program is used where accounting needs to be optimized. This software is licensed, therefore, to work in it, you must enter...