- Connect from Windows 10 to Ubuntu 18.10 / 18.04 | 16.04 via XRDP Remote Desktop Protocol (RDP)
- Step 1: Install XRDP Server
- Step 2: Connect from Windows 10
- Published by Richard Zayzay
- 14 Replies to “Connect from Windows 10 to Ubuntu 18.10 / 18.04 | 16.04 via XRDP Remote Desktop Protocol (RDP)”
- Xrdp — Connect Ubuntu Linux Remote Desktop via RDP from Windows
- Xrdp Requirement
- 1) Installation on Linux
- on Ubuntu 18.04
- On Centos/Redhat 7
- 2) Connect from Windows
- Access Remote desktop of Ubuntu/CentOS
- Как подключиться к Linux из Windows
- Удалённый доступ к Linux с помощью VNC
- Шаг 1. Установка рабочей среды XFCE
- Шаг 2. Установка TightVNC
- Шаг 3. Настройка пароля
- Шаг 4. Настройка скрипта запуска
- Шаг 5. Запуск VNC сервера
- Шаг 6. Подключение из Windows
- Шаг 8. Настройка systemd
- Использование RDP для удалённого подключения
- Подключение к Linux из Windows по SSH
- Использование Putty для подключения к Linux
- Выводы
Connect from Windows 10 to Ubuntu 18.10 / 18.04 | 16.04 via XRDP Remote Desktop Protocol (RDP)
I recently installed Ubuntu 18.10 [BETA] desktop on one of my test servers… To test my apps, I wanted to connect to the Ubuntu machine via Microsoft Remote Desktop Connection (RDP)….
If you want to learn how to make that work, the steps below should be a great place to start… Students and new users should fine the steps below helpful…..
In most Linux environments, VNC server and other opensource remote connection tools are the only options available to users… You don’t see tools supporting Microsoft Remote Desktop Connction (RDP) protocols to connect to Linux desktop… The only tool that gets this done is XRDP….
XRDP is an open source remote desktop protocol server which uses RDP to present a GUI to desktop clients… It provides a fully functional Linux terminal server, capable of accepting connections from rdesktop, freerdp, and Microsoft’s own terminal server / remote desktop clients.
This brief tutorial is going to show students and new users how to using Windows own remote desktop connection protocol to connect to Ubuntu 18.10 / 18.04 and 16.04 desktops
When you’re ready, follow the steps below to get it working…
Step 1: Install XRDP Server
To get Ubuntu desktops to accept RDP connections, you must first install and enable XRDP remote desktop tool… to do that, run the commands below
After running the commands below reboot the desktop…..
Step 2: Connect from Windows 10
Now that Xrdp server is installed, go and open Windows Remote Desktop Connection app and connect to the server IP or hostname… Make sure you’re not already logged into the desktop…
XRPD will not connect if you’re already logon to the desktop with the account you wish to connect…. The solutions I have tested is to restart the Ubuntu desktop and not to logon….
Then click Connect to initiate the connection to XRDP server…. you should be warned about Windows not trusting the computer you’re conneting to… Accept and continue to connect anyway..
Next, type in your Ubuntu machine account username and password and connect using Xorg session…
When your accout username and password are confirmed, you should be logon to your Ubuntu machine from Windows… as shown in the image below
You are now connected to your Ubuntu desktop from Windows using Microsoft own remote desktop connection protocol (RDP)… The graphic isn’t great, but good enough to get your work done….
If you attempt to logon to the Ubuntu machine and the connection is ending abruptly without connecgting, follow the steps below to resolve…
- Make sure you’re not already logged on to the Ubuntu desktop… best thing is to restart and don’t logon…
- If you try Xorg session and it quickly disconnect… the next time, select X11rdp from the drop-down list.. it will hang and not fully connect..… that’s OK…
- Close the X11rdp session by canceling the RDP windows… then reboot the Ubuntu desktop again… After rebooting, try the Xorg session again… this time is should connect….
- You’ll be prompted to authenticate three times after loggon on….
You may also like the post below:
Published by Richard Zayzay
Hi, I’m Richard. In my spare time, I research topics that are interesting and worthwhile for users and students who want to try something new. I, too, am a student and my focus here is to help other students and new users get started with managing Ubuntu Linux, Windows, Content Management Systems (CMS) and others. I try to do my best explaining the topics and detailing the instructions so that anyone can understand. These tutorials may not work in all situations and for all users. However, if you run into trouble, please ask your questions below and I or someone from the community may help you resolve. Thanks for reading and hope you come back.
14 Replies to “Connect from Windows 10 to Ubuntu 18.10 / 18.04 | 16.04 via XRDP Remote Desktop Protocol (RDP)”
Hello, I have tried this and get a window within my windows 10 computer stating connect is ok, then i get kicked out w/out accessing the linux computer. I am not logged into the linux so not sure why i am not able to open a remote connect within my network? Thanks in advance
I have done this over and over. I installed a new instance of Ubuntu 18.04 Desktop on my laptop. I have a new Windows 10 machine with all of the updates. What happens, is that after getting an RDP session started, I get booted out, and the session ends. The session still runs on the Ubuntu machine and when I reconnect, it will resume. I have looked at my Administrative settings in Windows, looked at my settings in Ubuntu and the problem persists. My intent is to use the Ubuntu with a log on for each of my browsing types, and then setup a VPN for the Ubuntu laptop. By different browsing types, News, banking, social media, etc. for now both computers are sitting next to each other and connected via CAT 6 Rj45 network cables. Can you please provide assistance?
Xrdp — Connect Ubuntu Linux Remote Desktop via RDP from Windows
How often do you access Linux Desktop? What tools do you use to access remote desktop?
Xrdp is an open source tool which allows users to access the Linux remote desktop via Windows RDP. Apart from Windows RDP, xrdp tool also accepts connections from other RDP clients like FreeRDP, rdesktop and NeutrinoRDP. Xrdp is now supporting TLS security layer.
Xrdp Requirement
- xrdp and xorgxrdp packages
- Listens on 3389/tcp. Make sure your firewall accepts connections
In this article, I will show how you can remotely connect to Ubuntu Desktop from a Windows machine using Xrdp tool.
1) Installation on Linux
on Ubuntu 18.04
First, you need to install Xrdp on Ubuntu
You have to configure the polkit rule to avoid an authenticate popup after inputting the username and password at the xrdp login screen on windows
restart the xrdp service
Then make sure that the service is running
Now make sure to automatically start the service at the system startup
Now you will need to check your ip address because you will need it for the connection
My ip address is 172.16.8.177 . So keeps yours it in your mind.
Xrdp works with port 3389 so make sure to open it. UFW is disabled by default so you will need to enable the firewall and create a rule for xrdp
Now you can continue the configuration on windows side
On Centos/Redhat 7
Make sure to install the Epel repositories before
Now install xrdp packages
Add a rule in the firewall. On Centos/RedHat is not ufw but firewalld to configure
Then reload the firewall
Now enable and restart the xrdp service
Check your ip address for the remote connection on Windows
2) Connect from Windows
On your windows machine such as windows 10 in our case, launch the default remote desktop connection tool.
You will need to enter the ip address of your machine and you will be asked to enter the username
Access Remote desktop of Ubuntu/CentOS
Enter the ip address and the username
Now confirm the information and launch the connection. If you are not logged out in local, the remote login would fail.
Now you will be asked for your password
Now confirm your credentials. You can see the IP address of my Ubuntu on the top and the login page. Enter your password and enjoy
Are you aware of any other tools? Please advise us on the comments
Как подключиться к Linux из Windows
В мире ИТ существует уже довольно широкий спектр операционных систем, начиная с серверных, заканчивая операционными системами для мобильных устройств. В обычных пользовательских компьютерах и в серверах довольно часто используются две ОС — Linux и Windows. Поэтому очень часто возникают ситуации, когда приходится подключаться по сети из одной операционной системы к другой для выполнения разнообразных операций.
В этой статье мы рассмотрим варианты подключения к Linux из Windows. Существуют бесплатные и условно бесплатные утилиты вроде AnyDesk или TeamViewer, но установка их довольно тривиальна и не нуждается в дополнительном пояснении. Утилиты подобного рода обладают рядом ограничений при бесплатном некоммерческом использовании, либо их функциональность не удовлетворяет тем или иным потребностям пользователя. Мы рассмотрим полностью бесплатные способы как подключится к Linux из Windows.
Удалённый доступ к Linux с помощью VNC
На сегодняшний день самое популярное удаленное подключение к Linux из Windows, с использованием привычный в Windows графического интерфейса, является VNC (Virtual Network Computing) — утилита, использующая протокол RFB (Remote FrameBuffer — удалённый кадровый буфер). Управление осуществляется путём передачи нажатий клавиш на клавиатуре и движений мыши с одного компьютера на другой и ретрансляции содержимого экрана через компьютерную сеть.
В качестве сервера VNC в данном примере будет использоваться TightVNC, установленный в Ubuntu 20.04. Для установки сервера VNC необходимо выполнить ряд действий:
Шаг 1. Установка рабочей среды XFCE
Xfce — одна из самых легковесных рабочих сред, используемых в Linux, она будет быстро работать даже при слабом и нестабильном сетевом подключении. Установите её с помощью команд:
sudo apt update
sudo apt install xfce4 xfce4-goodies
Шаг 2. Установка TightVNC
Далее установите TightVNC:
sudo apt install tightvncserver
Шаг 3. Настройка пароля
Перед началом выполнения всех действий необходимо задать пароль пользователя VNC. Выполните команду:
Вам будет предложено создать новый пароль, а также пароль только для просмотра. Откажитесь от второй опции:
Завершите процесс vncserver:
vncserver -kill :1
Шаг 4. Настройка скрипта запуска
Отредактируйте скрипт, который выполняется после запуска VNC-сервера:
Он должен содержать такой текст:
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &
Сделайте файл исполняемым:
Шаг 5. Запуск VNC сервера
На этом этапе уже можно запустить VNC-сервер с помощью команды:
Шаг 6. Подключение из Windows
Для того, чтобы подключиться из Windows к вашему Linux-серверу, используйте TightVNC Viewer.
Укажите IP-адрес компьютера, к которому нужно подключиться, и номер порта в поле Remote Host. В данном примере — 192.168.56.102::5901:
После того, как будет введён пароль, вы должны увидеть рабочий стол Xfce:
Шаг 8. Настройка systemd
Для того, чтобы запуск вашего VNC-сервера добавить в автозагрузку надо использовать systemd. Создайте новый файл сервиса systemd:
sudo nano /etc/systemd/system/vncserver@.service
Его содержимое должно быть следующим:
[Unit]
Description=Systemd VNC server startup script for Ubuntu 20.04
After=syslog.target network.target
[Service]
Type=forking
User=ubuntu
ExecStartPre=-/usr/bin/vncserver -kill :%i &> /dev/null
ExecStart=/usr/bin/vncserver -depth 24 -geometry 800×600 :%i
PIDFile=/home/ubuntu/.vnc/%H:%i.pid
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target
Измените имя пользователя ubuntu и рабочего каталога ubuntu на нужные вам значения. Если у вас запущен VNC-сервер, остановите его:
vncserver -kill :1
Сообщите systemd о появлении нового сервиса:
sudo systemctl daemon-reload
Добавьте запуск вашего нового сервиса в список автозагрузки:
sudo systemctl enable vncserver@1.service
sudo systemctl start vncserver@1
Использование RDP для удалённого подключения
Помимо VNC, для управления Linux-сервером из Windows можно воспользоваться RDP (Remote Desktop Protocol). Для этого на компьютере с Ubuntu 20.04 установите утилиту xrdp:
sudo apt install xrdp
Для корректной работы сервиса необходимо добавить пользователя xrdp в группу ssl-cert:
sudo adduser xrdp ssl-cert
sudo apt-get install xfce4
Добавьте Xfce в сессии RDP в качестве рабочего стола по умолчанию:
Перезапустите сервис xrdp:
sudo systemctl restart xrdp.service
Процедура подключения из Windows к Linux-серверу по протоколу RDP почти ничем не отличается от подключения к удалённым Windows-серверам. Введите IP-адрес сервера, логин и пароль пользователя в Linux:
Если всё сделано правильно, вы увидите рабочий стол Xfce:
Подключение к Linux из Windows по SSH
Для подключения к компьютеру под управлением Linux по протоколу SSH из Windows можно воспользоваться PowerShell. Сначала становите OpenSSH Client, если ещё не установлен. Запустите на вашем компьютере PowerShell от имени администратора системы и выполните следующую команду:
Get-WindowsCapability -Online | ? Name -like ‘OpenSSH*’
Это необходимо для того, чтобы узнать текущую версию SSH-клиента. В данном примере доступна версия OpenSSH.Client-0.0.1.0. Установите OpenSSH.Client с помощью команды:
Add-WindowsCapability -Online -Name OpenSSH.Client
Для того, чтобы подключиться к устройству, на котором запущен SSH-сервер, необходимо ввести имя пользователя и IP-адрес. Команда для подключения по SSH используя PowerShell выглядит так:
Здесь ubuntu — имя пользователя на удалённом компьютере, а 192.168.56.1 — IP-адрес Linux-сервера, на котором запущен демон SSH.
При первом подключении необходимо подтвердить использование специального персонального ключа для шифрованного соединения по SSH-протоколу (введите слово Yes), затем введите пароль пользователя (в данном случае для пользователя ubuntu):
Как видите, соединение прошло успешно. Теперь можно выполнять все команды так же, как если бы вы их выполняли используя стандартный Linux SSH-клиент:
Для завершения терминальной сессии на удалённом компьютере введите команду exit. Теперь вы знаете как выполняется подключение к Linux из Windows по SSH.
Использование Putty для подключения к Linux
Пожалуй, одним из самых популярных способов подключения к Linux из Windows является кроссплатформенная утилита Putty — небольшая по размерам, но очень часто незаменима для подключения по таким протоколам как SSH, Telnet, rlogin и даже с помощью последовательных портов.
Для обычного подключения к Linux-серверу по протоколу SSH достаточно в поле Host Name (or IP—address) указать его IP-адрес и нажать кнопку Open (в данном примере Linux-сервер имеет IP-адрес: 192.168.56.102):
При первом подключении Putty предупредит, что используется специальный ключ безопасности и его нужно добавить в доверенные хосты. Нажмите кнопку Да:
Далее нужно будет ввести логин и пароль. Если всё сделано правильно, запустится удалённая сессия терминала Linux:
Мало кто знает, что Putty позволяет запустить почти любое приложение, установленное на компьютере с Linux, по сети в Windows. Для этого на компьютере с Windows нужно установить собственный X-сервер. В данном примере воспользуемся Xming.
Скачайте Xming с официального сайта. Установка довольно тривиальная, поэтому не будем на ней останавливаться. Ничего не меняйте в процессе установки. Просто нажимайте кнопку Next до тех пор, пока программа не установится и не запустится:
Когда установка Xming завершится, откройте Putty и в настройках сессии для вашего подключения в разделе SSH -> X11 включите флажок напротив опции Enable X11 forwarding, а также, в строке Отображение дисплея X впишите значение localhost:0, после чего откройте сессию подключения с помощью кнопки Open:
В открывшемся терминале Putty введите консольное название программы, обладающей графическим интерфейсом. В данном примере введено название графического редактора drawing:
(Знак & позволит запустить программу в фоновом режиме, в этом случае в окне Putty можно будет выполнять и другие команды):
Как видите, Linux-приложение drawing успешно запустилось по сети на X-сервере, установленном в Windows. С ним можно работать так же, как и с локальным приложением.
Выводы
Сегодня не существует слишком уж больших проблем для подключения к Linux из Windows. Способов существует довольно много. Каждый из них обладает своими достоинствами и недостатками, например, скорость работы VNC, да и других тоже, существенно зависит от скорости сетевого соединения. Существуют также программные средства, позволяющие подключаться к Linux-серверам используя мессенджеры или браузеры.