Remote Desktop

Ubuntu/Debian怎么在命令行开启远程桌面共享

Moonlight

Sunshine Configurations

安装完 Sunshine 后,在安装文件夹下的 scripts 文件夹中有一个设置 Windows 开机自启动的脚本,可以使用管理员权限运行。

Moonlight Configurations

Moonlight 需要修改的设置:

Basic Settings:

  • Resolution and FPS: 4K 60FPS
  • Video bitrate: 20 Mbps
  • Display mode: Borderless Windowed
  • V-Sync: ON
  • Frame pacing: OFF

Input Settings:

  • Capture system keyboard shortcuts: ON – 开启以支持 Windows 键输入

补充使用 Moonlight 的一些注意事项:

如果之前使用过 Miscrosoft Remote Desktop 远程桌面,需要先 Log Out,否则会导致 Moonlight 无法连接。


Moonlight 断开连接: Ctrl + Alt + Shift + F6

xrdp

xrdp Installation

1
2
sudo apt-get -y install xrdp
sudo systemctl enable xrdp

xrdp Configurations

安装并配置 xrdp 以在 Ubuntu 上使用远程桌面

告诉 xrdp 在启动会话时要使用的桌面环境。

使用 xfce 作为桌面环境:

1
echo xfce4-session >~/.xsession

使用 KDE 作为桌面环境:

1
echo startkde >~/.xsession

20.04 XRDP KDE Plasma connect issue

使用 GNOME 作为桌面环境:

1
echo gnome-session >~/.xsession

重启xrdp服务

1
sudo service xrdp restart

查看xrdp状态

1
sudo service xrdp status

Ubuntu 20.04 Remote Desktop Access from Windows 10 with xRDP


完美方案——解决XRDP连接黑屏,以及桌面优化! - 知乎

(xRDP) Desktop looks different when connecting remotely

Xrdp 体验优化 减少/解决画面卡顿

VNC

ubuntu vncviewer

Download VNC® Viewer

VNC Installation

1
sudo apt-get install tightvncserver

输出

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
boa@Ubuntu-ss:~$ vncserver

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n

Warning: Ubuntu-ss:1 is taken because of /tmp/.X1-lock
Remove this file if there is no X server Ubuntu-ss:1
xauth: file /home/boa/.Xauthority does not exist

New 'X' desktop is Ubuntu-ss:2

Creating default startup script /home/boa/.vnc/xstartup
Starting applications specified in /home/boa/.vnc/xstartup
Log file is /home/boa/.vnc/Ubuntu-ss:2.log

编辑配置vncserver文件 nano ~/.vnc/xstartup
随后执行 chmod +x ~/.vnc/xstartup

查看运行状态: ps -ef|grep vnc

vnc config backup

1
2
3
4
5
6
7
8
9
#!/bin/sh

xrdb "$HOME/.Xresources"
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

ip:5901

VNC Configurations

连接后一片灰色

1
vncserver -geometry 1920x1080

[问题解决] VNC连接黑屏或者灰屏+命令行

vncviewer 报错 the connection was refused by the computer

NoMachine

Getting started with NoMachine

NoMachine Installation

NoMachine for Linux - amd64

1
sudo dpkg -i nomachine_8.10.1_1_amd64.deb

NoMachine for ARM

1
sudo dpkg -i nomachine_8.11.3_3_arm64.deb

Connecting to Linux headless machines with NoMachine

1
2
sudo systemctl stop display-manager
sudo /etc/NX/nxserver --restart

NoMachine Configurations

No available desktops on this server – Ubuntu 20 LTS