Remote Desktop 遠端桌面

RDP, VNC, NX Fress, X2Go

XRDP

安裝
# Ubuntu 18.04
sudo apt-get install xrdp xfce4
echo xfce4-session >~/.xsession

# 檢查 XRDP 是否已啟動
# 檢查 port 3389 是否開啟
sudo netstat -ltpn

# XRDP 服務啟動/關閉
sudo systemctl stop xrdp-sesman
sudo systemctl start xrdp-sesman

TIP:

- 不需設定 vncserver 密碼

- 預設 port 是 3389,若要變更,可修改 /etc/xrdp/xrdp.ini

Windows 用戶端登入時

  1. 選擇 sesman-Xvnc
  2. 輸入 Ubuntu 的系統帳號/密碼
FAQ

Q: 在 Ubuntu 13/14 遠端連線後出現空白畫面
Ans: 這是因為 XRDP 與 Gnome 套件有衝突,解決方法只能將桌面程式改成 XFACE,步驟如下:

sudo add-apt-repository ppa:xubuntu-dev/xfce-4.10
sudo apt-get update
sudo apt-get install xfce4

echo xfce4-session >~/.xsession
sudo service xrdp restart 
Tutorials



VNC

Ubuntu 9/11
sudo apt-get install ubuntu-desktop --no-install-recommends
sudo apt-get install  vnc4server

編輯 .vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session & # support for GNOME
startkde $ #support for KDE
Lubuntu

編輯 .vnc/xstartup

/usr/bin/lxsession -s Lubuntu -e LXDE
CentOS

CentOS 6:

yum groupinstall Desktop
yum install tigervnc tigervnc-server

設定 VNC 密碼

vncserver

編輯 ~/.vnc/xstartup

# 移除註解
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

設定開機後自動啟動

/etc/sysconfig/vncservers

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1280x1024"     #這行可不加
chkconfig vncserver on

CentOS 5:

# Install
yum install vnc-server

# Set the password for vnc
vncserver

/root/.vnc/xstartup

xsetroot -solid grey
vncconfig -iconic &
gnome-session &   # 加這行
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & # 註解這行
#twm & # 註解這行

重啟 vncserver

vncserver -kill :1
vncserver

畫面解析太小

vncserver -geometry 1280x960
Learning




NX free edition

官網:https://www.nomachine.com/download 

安裝

下載 3 個安裝檔

sudo dpkg -i nxclient_3.5.0-7_i386.deb
sudo dpkg -i nxnode_3.5.0-7_i386.deb
sudo dpkg -i nxserver_3.5.0-9_i386.deb

Windows 用戶端

下載 NX Client for Windows

 

 

 

X2Go

特色

X2Go Server

sudo apt-add-repository ppa:x2go/stable
sudo apt-get update
sudo apt-get install x2goserver x2goserver-xsession
sudo apt-get install x2gomatebindings
sudo apt-get install xfce4 xfce4-terminal
sudo apt-get install gnome-icon-theme tango-icon-theme

X2Go Client

sudo apt-add-repository ppa:x2go/stable
sudo apt-get update
sudo apt-get install x2goclient

Learning

 

Guacamole

Apache Guacamole is a clientless remote desktop gateway. It supports standard protocols like VNC, RDP, and SSH.

Home: https://guacamole.apache.org/ 

Installation

With Docker

docker-compose.yml:

version: "3"
services:
  guacamole:
    image: jwetzell/guacamole
    container_name: guacamole
    volumes:
      - ./postgres:/config
    ports:
      - 8880:8080
volumes:
  postgres:
    driver: local

Login with the default credentials of:

More available extensions:

Usage:

docker run \
-p 8080:8080 \
-v </path/to/config>:/config \
-e "EXTENSIONS=auth-ldap,auth-duo" \
jwetzell/guacamole

Authentications

Google two-factor

With docker-compose

version: "3"
services:
  guacamole:
...
    environment:
      - EXTENSIONS=auth-totp
...

SSH

SSH-Key Authentication

# Generate the private key and public key
# NOTE: -m PEM is required for Guacamole
ssh-keygen -t rsa -b 4096 -f ~/.ssh/root@guacamole -C "root@guacamole" -m PEM

複製與貼上

預設環境遠端主機的文字可以複製,然後在本地端作貼上;不過,本地端文字無法複製後在遠端主機作貼上,解決方法如下:

在遠端主機的畫面,按下 Ctrl + Alt + Shift,會彈出 Guacamole 選單,將本地端文字貼在選單裡的 Clipboard,回到遠端主機,直接執行貼上即可。


Learning


Learning

Webtop

Meet Webtops A Linux Desktop Environment In Your Browser

SPICE (Proxmox VE is required)

The SPICE project aims to provide a complete open source solution for remote access to virtual machines in a seamless way so you can play videos, record audio, share usb devices and share folders without complications.

Kasm Workspace

Kasm Workspace Community Edition - Kasm Workspaces CE is a no-cost version of the Professional/Enterprise container streaming platform for individual users, non-profit organizations, and businesses wanting to test the platform. Workspaces CE has nearly all the same features as the paid versions with community based support.