XRDP is an easy-to-install and configurable service for Ubuntu systems. This post is going to show you the steps how you can get your Ubuntu desktop and xRDP installed on Oracle ARM based VM.
System Update and Add a new user
apt update -y
optional:
apt upgrade -y
add a new user netsec which later you can use it to log in
adduser netsec
Enable Password Log In (Optional)
By default, Oracle vm is using certificate to log in and password login has been disabled.nano /etc/ssh/sshd_config
comment the line
#PasswordAuthentication no
- service sshd restart
Install Desktop
There are various desktop environments available in Ubuntu repositories that you can choose. One option is to install Gnome, which is the default desktop environment in Ubuntu 20.04. Another option is to install Xfce . It is a fast, stable, and lightweight desktop environment, which makes it ideal for usage on a remote server.
Run one of the commands below to install the desktop environment of your choice.
Install Gnome:
apt install ubuntu-desktop -y
Install Xfce: (RDP user could not log in)apt install xubuntu-desktop
Depending on your system, downloading and installing GUI packages will take some time.
Install and Configure xRDP
Xrdp is incuded in the default Ubuntu repositories. To install it, run:
apt install xrdp -y
Once the installation is complete, the Xrdp service will automatically start. You can verify it by typing:
systemctl status xrdp
Enable 3389 port on IPv4 interface. For somehow, the default configuration, port=3389, which will cause 3389 port running on inet6 interface. You can verify port running status from following two commands
- apt install net-tools
- netstat -na | grep 3389
sudo nano /etc/xrdp/xrdp.ini
Reboot the service to take the configuration change into effect.
- systemctl restart xrdp
Allow Port 3389 from Oracle NSG (Network security group)
Don't forget to add inbound rule into your network security group to allow tcp port 3389.
Remove Built-in Firewall Rules - iptable
Even you have added 3389 port in Oracle NSG, if you are using Oracle's Ubuntu image, you will still have connectivity issue to the port 3389 since built-in iptables will block the external connection. Testing from local will still work, but not from remote.
Explanation:
iptables -F
: Flush (remove all) iptables rulesnetfilter-persistent save
Save empty ruleset to disk so it
If the iptables ruleset is empty, it will look like this:
Default output is:
MSTSC (RDP Client) Log in
Issues
I found another annoying thing which this desktop has no sound forwarding from remote to my local computer with RDP connection.
All commands:
Here are all commands I have used to get xRDP working on Ubuntu ARM instance in Oracle cloud
root@ubuntu-arm-xrdp:~# history
1 apt update -y
2 adduser netsec
3 apt install ubuntu-desktop -y && apt install xrdp -y
4 systemctl status xrdp
5 netstat -nat | grep 3389
6 apt install net-tools
7 netstat -nat | grep 3389
8 nano /etc/xrdp/xrdp.ini
9 systemctl restart xrdp
10 netstat -nat | grep 3389
11 telnet localhost 3389
12 iptables -list
13 iptables --L
14 clear
15 iptables -L
16 iptables -F
17 iptables -L
18 netfilter-persistent save
19 history
root@ubuntu-arm-xrdp:~#
Adding Sound Support
wget https://cdn.jsdelivr.net/gh/51sec/xrdp4arm@main/install_xrdp_audio.sh && bash install_xrdp_audio.sh
After the script running completed, you can RDP into environment again to try sound support. This time, you should be able to hear some sounds coming out from your local speakers.
YouTube Videos
All commands you needed
1. Install Desktop and Xrdp
apt update -y && apt install ubuntu-desktop -y && apt install xrdp -y
iptables -F
netfilter-persistent save
wget https://cdn.jsdelivr.net/gh/51sec/xrdp4arm@main/install_xrdp_audio.sh && bash install_xrdp_audio.sh
References
- DD Original Ubuntu Image to Oracle Cloud ARM VM and Install RDP with Sound Forwarding Support
- 甲骨文ARM Gnome桌面配置
- How to disable instance firewall on Ubuntu on Oracle Cloud
- How To Install XRDP (Remote Desktop) on Ubuntu 20.04
- Install xRDP with Ubuntu Desktop on Oracle ARM VM ( xRDP Sound Support)
- DD Original Ubuntu Image to Oracle Cloud ARM VM and Install RDP with Sound Forwarding Support
- DD Windows OS to Cloud Linux VM (Oracle /GCP /Azure)
how did you make NSG allow3389
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteI can't thank you enough ! This blog is my life saver. Just a small note : sound forwarding didn't work even after running the script mentioned above.
ReplyDeleteWhen I ran sudo iptables -F, SSH, web servers and webmin all stopped working and now I can't access the instance. Thank you for nothing.
ReplyDeletesd
ReplyDelete