WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ea8776f

Browse files
committed
Add remote desktop enable option
1 parent 8c8da8a commit ea8776f

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

build-armbian/armbian-files/common-files/usr/share/ophub/armbian-software/command-desktop.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,22 @@ software_201() {
5353
if [[ -n "${get_desktop_user}" ]]; then
5454
sudo adduser ${get_desktop_user}
5555
sudo usermod -aG sudo ${get_desktop_user}
56+
echo -e "${INFO} Desktop user: [ ${get_desktop_user} ]"
5657
else
5758
echo -e "${NOTE} You skipped adding the logged in desktop system user."
5859
fi
5960

61+
# Remote desktop enable option
62+
echo -ne "${OPTIONS} Is remote desktop enabled? Options: (y/n): "
63+
read get_rd
64+
if [[ -n "${get_rd}" ]]; then
65+
get_rd="${get_rd,,,}"
66+
[[ "${get_rd:0:1}" == "y" ]] && get_rd="yes" || get_rd="no"
67+
else
68+
get_rd="no"
69+
fi
70+
echo -e "${INFO} Remote desktop enable option: [ ${get_rd} ]"
71+
6072
if [[ "${VERSION_CODEID}" == "ubuntu" ]]; then
6173
# Install ubuntu-desktop(gdm3) on Ubuntu (focal/jammy/lunar/mantic)
6274
software_install "ubuntu-desktop gdm3"
@@ -67,6 +79,27 @@ software_201() {
6779
error_msg "VERSION_CODEID not supported: [ ${VERSION_CODEID} ]"
6880
fi
6981

82+
# Install xrdp and configure
83+
[[ "${get_rd}" == "yes" ]] && {
84+
# Install xrdp
85+
software_install "xrdp xorgxrdp"
86+
sudo service xrdp start
87+
88+
# Configure xrdp
89+
sudo cat <<EOF >>/etc/xrdp/xrdp.ini
90+
91+
[xrdp2]
92+
name=Custom_Remote_Desktop
93+
lib=libvnc.so
94+
username=${get_desktop_user}
95+
password=ask
96+
ip=${my_address}
97+
port=-1
98+
code=20
99+
100+
EOF
101+
}
102+
70103
# Install Chinese desktop support
71104
sudo bash ${software_path}/201-desktop-chinese-fonts.sh
72105

documents/README.cn.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Github Actions 是 Microsoft 推出的一项服务,它提供了性能配置非
9191
- [12.16 如何解决写入 eMMC 时 I/O 错误的问题](#1216-如何解决写入-emmc-时-io-错误的问题)
9292
- [12.17 如何解决 Bullseye 版本没有声音的问题](#1217-如何解决-bullseye-版本没有声音的问题)
9393
- [12.18 如何编译 boot.scr 文件](#1218-如何编译-bootscr-文件)
94+
- [12.19 如何开启远程桌面和修改默认端口](#1219-如何开启远程桌面和修改默认端口)
9495

9596
## 1. 注册自己的 Github 的账户
9697

@@ -1366,3 +1367,13 @@ reboot
13661367
# 在 Amlogic 设备中,在 USB 中使用的是 /boot/boot.scr 文件,写入 eMMC 时使用的是 /boot/boot-emmc.scr 文件。
13671368
```
13681369

1370+
### 12.19 如何开启远程桌面和修改默认端口
1371+
1372+
在软件中心 `armbian-software` 里选择 `201` 可以安装桌面,在安装桌面时会询问是否开启远程桌面,输入 `y` 即可开启。远程桌面的默认端口是 `3389`,可以根据需要自定义使用其他端口:
1373+
1374+
```shell
1375+
sudo nano /etc/xrdp/xrdp.ini
1376+
# 修改为自定义端口,例如 5000
1377+
port=5000
1378+
```
1379+

documents/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ GitHub Actions is a service launched by Microsoft that provides a virtual server
9191
- [12.16 How to Resolve the Issue of I/O Errors While Writing to eMMC](#1216-how-to-resolve-the-issue-of-io-errors-while-writing-to-emmc)
9292
- [12.17 How to Solve the Issue of No Sound in the Bullseye Version](#1217-how-to-solve-the-issue-of-no-sound-in-the-bullseye-version)
9393
- [12.18 How to build the boot.scr file](#1218-how-to-build-the-bootscr-file)
94+
- [12.19 How to Enable Remote Desktop and Modify the Default Port](#1219-how-to-enable-remote-desktop-and-modify-the-default-port)
9495

9596
## 1. Register your own Github account
9697

@@ -1371,3 +1372,13 @@ reboot
13711372
# For Amlogic devices, the file used in USB is /boot/boot.scr, while the file used for writing to eMMC is /boot/boot-emmc.scr.
13721373
```
13731374

1375+
### 12.19 How to Enable Remote Desktop and Modify the Default Port
1376+
1377+
In the software center `armbian-software`, selecting `201` allows you to install a desktop. When installing the desktop, you will be asked whether to enable the remote desktop, input `y` to enable. The default port for the remote desktop is `3389`, and you can use a custom port according to your needs:
1378+
1379+
```shell
1380+
sudo nano /etc/xrdp/xrdp.ini
1381+
# Change to a custom port, for example 5000
1382+
port=5000
1383+
```
1384+

0 commit comments

Comments
 (0)