Use FRP (Fast Reverse Proxy) to Improve Windows MSTSC Access Ubuntu xRDP Experience
Windows RDP program MSTSC has a compatibility issue with xRDP application in Linux. Based on our testing with previous posts :
- 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
RDP experience will have lagging feeling especially the sound delayed a lot. You can feel that when you are playing a YouTube video as show in my previous posts. Actually, tt is not networking issue, not bandwidth or Oracle ARM platform's CPU or memory related hardware issue. ARM machine provided by Oracle cloud is enough powerful to support YouTube 1080p playback.
After did some research, I found a workaround for this issue. In this post, I am going to show this solution by using FRP program to fix this issue.
frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports TCP and UDP, as well as HTTP and HTTPS protocols, where requests can be forwarded to internal services by domain name. frp also has a P2P connect mode.
Architecture
Download latest FRP package and Extract it
FRP Github Link: https://github.com/fatedier/frp/releases/
Please find out the right version from the list. Each version release contains both components, frps and frpc. If you use Oracle cloud ARM vm, pleae choose linux_arm64 version. For example, if you use Tencent Cloud as the server, then Tencent Cloud is amd64, and Oracle ARM is arm64. Pay attention to the version when throwing it on your own machine! !
Again, frps is the server and frpc is the client.
Following command is to download version 0.39.0. You can check the Github release to find out latest version.
[email protected]:~# wget https://github.com/fatedier/frp/releases/download/v0.39.0/frp_0.39.0_linux_arm64.tar.gz
Configure frpc - Client side
1. Unzip the package and put the following files in the /etc/frp directory
[email protected]:~# tar -xvf frp_0.39.0_linux_arm64.tar.gz
2. Modify the frpc.ini file
[email protected]:/etc/frp# cp /root/frp_0.39.0_linux_arm64/frps .
[email protected]:/etc/frp# ls
frpc frpc_full.ini frpc.ini frps frps_full.ini frps.ini
[email protected]:/etc/frp# nano frpc.ini
[common]
server_addr = 127.0.0.1
#(For internal forwarding, use 127.0.0.1. If you use other Cloud provider for server forwarding, fill in their Cloud's IP)
server_port = 7000
token = 12345678
[13389]
type = tcp
remote_port = 13389
local_ip = 127.0.0.1
local_port = 3389
3. Put frpc.service in the systemd folder under /etc/systemd/system.
Copy frpc.server and set permissions
[email protected]:~/frp_0.39.0_linux_arm64/systemd# cp frpc.service /etc/systemd/system/.
[email protected]:/etc/systemd/system# chmod 754 frpc.service
Set to boot to start this service
[email protected]:/etc/systemd/system# systemctl enable frpc.service
4. In the /etc/frp directory
[email protected]:/etc/systemd/system# cd /etc/frp
[email protected]:/etc/frp# ls
frpc frpc_full.ini frpc.ini frps frps_full.ini frps.ini
[email protected]:/etc/frp# cp frpc /usr/bin
[email protected]:/etc/frp# chmod +x /usr/bin/frpc
[email protected]:/etc/frp# systemctl start frpc
[email protected]:/usr/bin# ps -ef | grep frpc
root 46955 512 0 18:32 pts/0 00:00:00 grep --color=auto frpc
[email protected]:/etc/frp#
Configure frps - Server side
1. Unzip the package and put the following files into the /etc/frp directory
2. Modify the frps.ini file
[email protected]:/etc/systemd/system# nano frps.ini
[common]
bind_port = 7000
token = 12345678
3. Copy frps.service which is under unzipped systemd folder, into /etc/systemd/system folder
[email protected]:~/frp_0.39.0_linux_arm64/systemd# cp frpc.service /etc/systemd/system/.
[email protected]:~/frp_0.39.0_linux_arm64/systemd# cd /etc/systemd/system/
Set permissions
[email protected]:/etc/systemd/system# chmod 754 frps.service
Enable it start frps.service after boot system.
[email protected]:/etc/systemd/system# systemctl enable frps.service
Created symlink /etc/systemd/system/multi-user.target.wants/frps.service -> /etc/systemd/system/frps.service.
4. In the /etc/frp directory
[email protected]:/etc/systemd/system# cd /etc/frp
[email protected]:/etc/frp# ls
frpc frpc_full.ini frpc.ini frps frps_full.ini frps.ini
[email protected]:/etc/frp# cp frps /usr/bin
[email protected]:/etc/frp# chmod +x /usr/bin/frps
[email protected]:/etc/frp# systemctl start frps
[email protected]:/etc/frp# ps -ef|grep frps
nobody 47406 1 12 18:33 ? 00:00:00 /usr/bin/frps -c /etc/frp/frps.ini
root 47412 512 0 18:33 pts/0 00:00:00 grep --color=auto frps
[email protected]:/etc/frp#
Configure RDP from Windows MSTSC
Oracle Security Group Open 13389 Port
Since we are using 13389 port for our RDP connection, which will be redirect to local 3389 port, we will need to open 13389 from our network security group.
Here is an example to create a rule for it.
No comments