Remote Desktop Server
Install Graphical User Interface
Either XFCE or GNOME
Install XFCE (Light Weight) UI
xfce : light weight desktop environment
X11 (X Window System) : It provides the basic framework for a GUI environment
xorg : display server for the X Window System
While installation prompt choose "lightdm" as display manager, "gdm3" is mostly used in GNOME (.)
Install GNOME UI (Modern UI)
- Little heavier than XFCE. (Normally servers shouldn't have UI for performance)
- Other alternatives of UI Ubuntu Help
Setting
In file '/etc/X11/Xwrapper.config', change allowed_users to below value
Note: If no Xwrapper.config file create it or add xserver-xorg-legacy package
XRDP
Source Ref
- linuxize 18.04 xfce
- Ubuntu Community XRDP // works in desktop
- Missing Gnome Doc Fix //check last gnome tweak tool if left dock misses in desktop screen
- XRDP in GNOME 18.04 -19
- nakivo XRDP XFCE 18.04
- LinuxConfig Ubuntu 20.04 XRDP
- Xubuntu XFCE
c-nergy main script -> c-nergy 20.04 script //good
Steps
- Mostly exists in 20.04 (double check)
- if ubuntu 18.04 ref
- Allow port
- Install xrdp
- Check status
- fix SSL
- Policies
- Policies 2 (if ubuntu 20.04)
Note : Check executable permission exists for new polkit files created
- Fixing env variables in XRDP //add if xrdp doesn't works
/etc/xrdp/startwm.sh is the start up script for xrdp, it looks inside for /etc/X11/Xsession global or any user local session
Create user session info '.xsession' file (For XFCE UI)
- Create user session info '.xsessionrc' file (For XFCE UI)
- (For GNOME UI)
You can use a different session types for the gnome session: ubuntu,gnome-classic,gnome-fallback,ubuntu-2d
- Create user session info '.xsessionrc' file (For GNOME UI)
Note : check permissions on the files created in home directory
- Restart xrdp
Can adjust configuration in '/etc/xrdp/xrdp.ini'
(For GNOME UI) If side doc not visible in rdp
Note : check logs in user home directory (file starts with .), global logs ar /var/log/xrdp*
- If The new_cursors draws black background around cursor.
VNC RD
- Installing VNC Server (tiger vnc)
- create the initial configuration
- Output of above command
Note :
Some files created /home/{user}/.Xauthority, /home/{user}/.vnc must have permissions for {user}
In vncserver, :X is a display port that refers to 5900+X like 5901, 5902..etc
stop the VNC instance before configuring
- Configuring VNC Server , add following content in '~/.vnc/xstartup' file //for XFCE4
- Configuring VNC Server , add following content in '~/.vnc/xstartup' file //for GNOME (not tested)
- Give user permission to current created file or entire .vnc folder
- allow port 5901
- For custom config options for a user, create file '~/.vnc/config' & add necessary options
- Global config is in '/etc/vnc.conf' file
- In global config add following setting
- Create generic service file '/etc/systemd/system/vncserver@.service' & add following content (replace {} content)
Note : above is a generic service file for a user at port passed as param. ANy changes in service file - reload below daemon & service start, verify steps
- Reload daemon after new service creation
- Enable above service with port param @1, so final port will be 5900 +1 = 5901
- Start service
- Verify service
Output : Check service status must be active & running
Note: If service failed, check log at /var/log/systemd
- By default VNC is not an encrypted protocol, check source link to use putty for ssh tunnel port forwarding
Download VNC Cient
Github Release -> Binaries Note: Use vnc viewer in TigerVNC binaries. Can also try Real VNC instead tigerVnc client
- If port forwarding running, use 'localhost:5901' else 'ipAddress:5901' in vnc viewer
Ubuntu Client to Ubuntu Server
MINI PC (Headless) ISSUES
- Always have SSH enabled to PC, so worst case command line access is available to change settings..etc
VINO VNC Works only after login
Vino VNC Ubuntu //also x11 VNC details
Ubuntu desktop sharing uses VINO VNC SERVER, by default it starts after login.
Setup VNC: UI Settings -> Sharing (on) -> screen sharing (on) -> set up strong password access
Issue : if we reboot the machine remotely, RD is lost. Again remote machine with monitor must be logged in.
Temporary fix : Make auto login on reboot edit the FILE '/etc/gdm3/custom.conf'
AutomaticLoginEnable=true //EARLIER FALSEAutomaticLogin=yourusername //EARLIER COMMENTEDIt's temporary solution : remote access have secure password, but some one physically at machine can access data without authentication (although it locks screen after some time, insecure initially as some can hard reboot & access)
Permanent solution : (Look for) Run VINO VNC as service instead from UI settings or check x11VNC in above docs link alternatives
(optional) run if not accessed from windows
Low screen resolution
- Issue : Since headless (no connected monitors), default screen resolution is very low
- Install dummy driver
- Create a new file /usr/share/X11/xorg.conf.d/dummy-monitor.conf (instead xorg.conf in /etc/X11/xorg.conf), add the following code
Note : config docs
- In /etc/default/grub, check nomodeset exists
ISSUE : when u want to work with real monitor attached - just rename/ remove new file usr/share/X11/xorg.conf.d/dummy-monitor.conf else real monitor display wont work. Note: If real monitor exists then no need of above conf as low resolution problem doesn't exists
Other solution : Vesa driver instead dummy link, link2 But dummy driver is safe than other low quality generic video drivers
Permanent solution : (Look for) Configure both attached device & dummy monitor in xorg.conf //multi screen
More links
Wifi disconnects on PC frequently
RD unable to connect as device doesn't ping even if network exists
ISSUE : Power management config ref
Try disabling wifi power management by opening /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and changing
wifi.powersave = 2WIRELESS_POWERSAVE_DEFAULT (0), IGNORE (1), DISABLE (2), ENABLE (3)