GOAD
  • Installation
    • Setup Ubuntu Server 22.04
    • Install VirtualBox & Vagrant
    • Install git and HomeLab Setup
    • Ansible Install & Playbook
    • Ansible Playbook
    • More Commands
    • Install VPN Server PrintUNL
  • Page 1
Powered by GitBook
On this page
  1. Installation

Setup Ubuntu Server 22.04

PreviousInstallationNextInstall VirtualBox & Vagrant

Last updated 1 year ago

Server Requirements

  • CPU: 4C/8T

  • the lab take environ 77GB (but you have to get the space for the vms vagrant images windows server 2016 (22GB) / windows server 2019 (14GB) / ubuntu 22.04 (502M))

  • the total space needed for the lab is ~115 GB (and more if you take snapshots)

Steps To Install and Configure XRDP on Ubuntu 22.04

Before you start to install xrdp on Ubuntu 22.04, you need to log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do this, you can follow our article the .

Now follow the steps below to complete this guide.

Installing Desktop environment on Ubuntu 22.04

XRDP server is designed to control only desktop systems. The Desktop environment is not available on Ubuntu by default. You need to add a to your system.

First of all, update and upgrade your local package index with the following command:

sudo apt update && sudo apt upgrade 

Install Tasksel Utility

Then, install the Tasksel utility to install a Desktop environment on Ubuntu 22.04 with the following command:

sudo apt install tasksel -y 

Now you need to launch the Tasksel with the following command:

tasksel 

You will see the package configuration:

Find the Ubuntu desktop by using the arrow keys. Press space to select it and then press tab to select ok and hit enter to install the Ubuntu desktop.

Now you need to set your system boots into the graphical target. You can use the following command:

systemctl set-default graphical.target 

Then, you need to reboot your system to apply these changes.

reboot

After that, Let’s start to install XRDP Remote Desktop on your server.

Install XRDP Remote Desktop Server on Ubuntu 22.04

The XRDP packages are available in the Ubuntu 22.04 default repository. To install it you can use the following command:

sudo apt install xrdp -y 

When your installation is finished, verify that you have installed it successfully with the following command:

sudo systemctl status xrdp 

In your output you should see:

Output
xrdp.service - xrdp daemon
Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
Active: active (running) 
Docs: man:xrdp(8)
man:xrdp.ini(5)
Main PID: 3108 (xrdp)
Tasks: 1 (limit: 2273)
Memory: 1.2M
CGroup: /system.slice/xrdp.service
└─3108 /usr/sbin/xrdp

This means that the XRDP on Ubuntu 22.04 is active and running.

Let’s start to configure XRDP.

Configure XRDP on Ubuntu 22.04

From the installation, XRDP added a user named “xrdp”. The xrdp session uses a certificate key file “/etc/ssl/private/ssl-cert-snakeoil.key”.

You need to add the xrdp user to the “ssl-cert” group with the following command:

sudo usermod -a -G ssl-cert xrdp 

Now you need to edit the /etc/xrdp/startwm.sh file. Open the XRDP file on Ubuntu 22.04 with your favorite text editor, here we use vi:

sudo vi /etc/xrdp/startwm.sh 

Add the following commands before the commands that test & execute Xsession:

Unset DBUS_SESSION_ADDRESS
Unset XDG_RUNTIME_DIR
...
if test -r /etc/profile; then
. /etc/profile
fi

Unset DBUS_SESSION_ADDRESS
Unset XDG_RUNTIME_DIRUnset

test -x /etc/X11/Xsession && exec /etc/X11/Xsession
exec /bin/sh /etc/X11/Xsession

When you are done, save and close the file.

To apply these changes restart XRDP on Ubuntu 22.04 with the following command:

sudo systemctl restart xrdp 

Change power settings so the server does not go to sleep and shuts off while inactive

Ubuntu desktop environment
Initial Server Setup with Ubuntu 22.04
Desktop environment