Vultr Remote Desktop Ubuntu
How to Install Xrdp on Ubuntu 20.04 – Vultr.com
Categories
Ubuntu
How to Install Xrdp on Ubuntu 20. 04
Introduction
Remote Desktop Protocol (RDP) is a Microsoft protocol providing a remote graphical connection to another computer via the network. It supports strong encryption, audio, and disk redirection. xrdp is an open-source project to implement the RDP on the Linux X desktop. This tutorial explains how to install xrdp on a Ubuntu 20. 04 instance with GNOME desktop environment.
Prerequisites
Deploy a Vultr Ubuntu 20. 04 instance.
Create a sudo user.
Update the Ubuntu server.
Installation Steps
Connect to your instance via SSH or the Web Console as your sudo user.
Install GNOME desktop.
$ sudo tasksel install ubuntu-desktop
Reboot your instance.
$ sudo reboot
After the reboot, connect to your instance again via SSH or the Web Console as your sudo user.
Install xrdp.
$ sudo apt install xrdp
It’s recommended to change the RDP port. For example, change the default port of 3389 to 13389. If you choose a different port, adjust the sed command below.
$ sudo sed -i ‘s/3389/13389/g’ /etc/xrdp/
Open the port in the Ubuntu firewall, ufw.
$ sudo ufw allow 13389
If you use the Vultr Firewall, open the port there as well.
Restart the xrdp service:
$ sudo systemctl restart xrdp
Connect your instance with an RDP Client.
More Resources
xrdp Official Site
Setup Ubuntu Server at Tokyo and Transform it to Desktop …
While waiting for lunch, it’s nice to do some warmups. Setting a server overseas seems a pretty cool warmup to do for developers, right? Recently, my friend recommended me to try out Vultr which provide cloud servers. So today, I’m going to share how I deploy a Ubuntu server which is located in Tokyo, a city far away from where I am now.
Step 1: Choosing Server Location
Vultr is currently available in many cities in popular countries such as Japan, Singapore, Germany, United States, Australia, etc.
Step 2: Choosing Server Type and Size
Subsequently, we will be asked to select the type and size for the server. Here, I choose 60 GB SSD server with Ubuntu 16. 04 x64 installed. I tried with Ubuntu 17. 10 x64 before but I couldn’t successfully RDP into it. Then the latest Ubuntu 18. 04 x64 is not yet tried by me. So ya, we will stick to using Ubuntu 16. 04 x64 in this article.
Step 3: Uploading SSH Key
Vultr is friendly to provide us a tutorial about generating SSH Keys on Windows and Linux.
The steps for creating SSH key on Windows with PuTTYgen is as follows.
Firstly, we need to click on the “Generate” button on PuTTYgen.
Secondly, once the Public Key is generated, we need to enter a key passphrase for additional security.
Thirdly, we click on the “Save Private Key” button to save the private key on somewhere safe.
Fourthly, we copy all of the text in the Public Key field and paste it to the textbox in Vultr under the “Add SSH Key” section.
Step 4: Naming and Deployment
Before we can deploy the server, we need to key in the hostname for the new server.
After we have done that, then we can instruct Vultr to deploy the server by clicking on the “Deploy Now” button at the bottom of the page.
Within 5 minutes, the server should finish installing and booting up.
Step 5: Getting IP Address, Username, and Password
In order to get the user credential to access the server, we need to click on the “Server Details” to view the IP address, username, and password.
Step 6: Updating Root Password
The default password is not user-friendly. Hence, once we login to the server via PuTTY, we need to immediately update the root password using the command below for our own good.
# passwd
Step 7: Installing Ubuntu Desktop
Firstly, let’s do some updating for the packages via the following commands.
# sudo apt-get update
# sudo apt-get upgrade
This will take about 2 minutes to finish.
Then we can proceed to install the default desktop using the following command.
# sudo apt-get install ubuntu-desktop
This will take about 4 minutes to finish. Take note that at this point of time Unity will be the desktop environment.
After that, we update the packages again.
Step 8: Installing Text Editor
We are going to change some configurations later, so we will need to use a text editor. Here, I’ll use the Nano Text Editor by installing it first.
# sudo apt-get install nano
Step 9: Installing xrdp
xrdp is an open source Remote Desktop Protocol (RDP) server which provides a graphical login to remote machines. This helps us to connect to the server using Microsoft Remote Desktop Client.
sudo apt-get install xrdp
Step 10: Changing to Use Xfce Desktop Environment
We will then proceed to install Xfce which is a lightweight desktop environment for UNIX-like operating systems.
sudo apt-get install xfce4
After it is installed successfully, please run the following command. This is to tell the Ubuntu server to know that Xfce has been chosen to replace Unity as desktop environment.
echo xfce4-session >~/. xsession
Step 11: Inspect xrdp Settings
We need to configure the xrdp settings by editing the in Nano Text Editor.
nano /etc/xrdp/
We need to edit the file by changing entire of the file content to be as follows.
if [ -r /etc/default/locale]; then. /etc/
export LANG LANGUAGE
fi
startxfce4
Then we need to restart xrdp.
# sudo service xrdp restart
After that, we restart the server.
# reboot now
Step 12: Connecting with Remote Desktop Client
After the server has been restarted, we can access the server with Windows Remote Desktop Client.
At this point of time, some of you may encounter error when logging in via RDP. The error will be saying things as follows.
Connecting to sesman IP 127. 0. 1 port 3350
sesman connect ok
sending login info to session manager, please wait…
xrdp_mm_process_login_response:login successful for display
started connecting
connecting to 127. 1 5910
error-problem connecting
Problem of connecting via xrdp.
As pointed out in one of the discussion threads on Ask Ubuntu, the problem seems to be xrdp, vnc4server, and tightvncserver are installed in the wrong order. So in order to fix that, we just need to remove them and re-install them in a correct order with the following set of commands.
# sudo apt-get remove xrdp vnc4server tightvncserver
# sudo apt-get install tightvncserver
# sudo apt-get install xrdp
After the server is restarted, we should have no problem accessing our server via RDP client on Windows.
References
How to Install the Desktop Components (GUI) on an Ubuntu Server
[YouTube] Ubuntu Server To Desktop With RDP Installation
Install XRDP on Ubuntu Server with XFCE Template
Error/problem connecting (Windows 10 RDP into XRDP)
Setup an Ubuntu Desktop GUI on a Vultr VM Remotely
Lubuntu is a free Ubuntu desktop GUI that you can install on a Vultr or Digital Ocean VM in the cloud, more information on lubuntu here.
Introduction
When you set up a Vultr server (see my guide here on setting up a Vultr VM) you can also install an Ubuntu GUI Desktop if you prefer GUI access to your server (over SSH and the terminal command line).
After you have set up your server (fyi: you can buy a server here on Vultr for as low as $2. 5 a month or buy a Digital Ocean server for $5 a month) and secure it (perform an optional security audit). Don’t forget to add a free SSL certificate.
Vultr allows you to log into an admin panel and access your servers web console (text or GUI)
Setup lubuntu
From the command line type
TIP: If you receive failures about “Temporary failure resolving ‘’” edit the file “/etc/” and add “nameserver 8. 8. 8” Update will then work.
There are two versions of the Ubuntu Desktop
1) Light Desktop
A Light version of lubuntu is available for low memory VMs
To install a light version run
Note: lubuntu-core should work on a VM with as low as 128MB of RAM. Read more here.
or
2) Full Desktop
If you have more memory (> 1GB RAM) you can run a richer environment
Note: lubuntu-desktop will take a lot longer to install over the core version.
Install the Firefox browser
apt-get install firefox
Reboot Your Server
sudo shutdown -r now
After your server reboots login to the Vultr admin panel and click the Web Console icon (computer screen icon, 5 in from the right).
Core Version
After you login to the web console, you will receive this screen (for the core version).
You can log in as any existing user instead of a guest if you wish.
You have a limited desktop and environment with the core version.
When you log out you can choose from the options below.
Full Desktop version
As before open the Vultr web console for the server.
If your lubuntu desktop session does not load try running
You can then log into the Ubuntu desktop (same as the light version above). You will be able to use FireFox, use a Terminal, install packages with the Lubuntu Software Center and browse files. The start menu is per packed with software too,
The full desktop has loads more software pre-installed (and available to install via the software center).
I opened a few apps and my server only used 472MB ram (it was using about 420MB before I installed lubuntu), all CPU cores were mostly idle.
Common Folders:
etc
Lubuntu Sofware Center
Installing MySQL workbench
I Installed MySQL Workbench
More software is available in the lubuntu Software Center
Synaptic Package Manager
The Synaptic package manager is also available if you are familiar with that.
Troubleshooting
You may receive this error on startup.
Review your: /root/. profile file
Erroring line
It is safe to ignore this error message as the command is just trying to generate a suggests exit result. More on the mesg command here.
Check out the extensive Hardening a Linux Server guide at Enjoy
Donate and make this blog better
Ask a question or recommend an article
[contact-form-7 id=”30″ title=”Ask a Question”]
Revision History
v1. 2 added link to hardening linux server.
v1. 1 fixed typos (26th Sep 2017)
v1. 0 Initial Post (26th Sep 2017)
Copyright © – Do not copy or duplicate (that means you)