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.
root@ubuntu:~# 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
root@ubuntu:~# tar -xvf frp_0.39.0_linux_arm64.tar.gz
2. Modify the frpc.ini file
root@ubuntu:/etc/frp# cp /root/frp_0.39.0_linux_arm64/frps .
root@ubuntu:/etc/frp# ls
frpc frpc_full.ini frpc.ini frps frps_full.ini frps.ini
root@ubuntu:/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
root@ubuntu:~/frp_0.39.0_linux_arm64/systemd# cp frpc.service /etc/systemd/system/.
root@ubuntu:/etc/systemd/system# chmod 754 frpc.service
Set to boot to start this service
root@ubuntu:/etc/systemd/system# systemctl enable frpc.service
4. In the /etc/frp directory
root@ubuntu:/etc/systemd/system# cd /etc/frp
root@ubuntu:/etc/frp# ls
frpc frpc_full.ini frpc.ini frps frps_full.ini frps.ini
root@ubuntu:/etc/frp# cp frpc /usr/bin
root@ubuntu:/etc/frp# chmod +x /usr/bin/frpc
root@ubuntu:/etc/frp# systemctl start frpc
root@ubuntu:/usr/bin# ps -ef | grep frpc
root 46955 512 0 18:32 pts/0 00:00:00 grep --color=auto frpc
root@ubuntu:/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
root@ubuntu:/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
root@ubuntu:~/frp_0.39.0_linux_arm64/systemd# cp frpc.service /etc/systemd/system/.
root@ubuntu:~/frp_0.39.0_linux_arm64/systemd# cd /etc/systemd/system/
Set permissions
root@ubuntu:/etc/systemd/system# chmod 754 frps.service
Enable it start frps.service after boot system.
root@ubuntu:/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
root@ubuntu:/etc/systemd/system# cd /etc/frp
root@ubuntu:/etc/frp# ls
frpc frpc_full.ini frpc.ini frps frps_full.ini frps.ini
root@ubuntu:/etc/frp# cp frps /usr/bin
root@ubuntu:/etc/frp# chmod +x /usr/bin/frps
root@ubuntu:/etc/frp# systemctl start frps
root@ubuntu:/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
root@ubuntu:/etc/frp#
(Option) frp隐藏CMD窗口运行
新建一个文本文档在开头处写入
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
REM
frpc.exe -c frpc.ini
其中frpc.exe -c frpc.ini为运行命令。 另存为.bat文件,放在frp目录下,双击该bat文件会在屏幕中一闪而过。
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:
Post a Comment