Click here to Skip to main content
15,071,205 members
Articles / Hosted Services / Azure
Technical Blog
Posted 8 Aug 2020


2 bookmarked

Install a Desktop Environment GUI on Ubuntu Server in Azure

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
8 Aug 2020CPOL2 min read
Installing a desktop environment and setting up RDP to allow us to connect to our Virtual Machine
Here we look at: Installing the xfce desktop environment, installing and configuring Xrdp, and disabling the compositor

All the Linux server Virtual Machine images on Azure don’t come with a desktop environment, which is obviously usually the right thing to do with a server. There’s usually no need for a desktop environment as all operations can be done from the CLI via ssh. However, maybe you need a desktop environment for another reason. For example, setting up Azure Lab Services for class rooms, maybe those Virtual Machines need a desktop enviroment for lessons in your lab.

1. Install the xfce Desktop Environment

First, before we get started, let’s make sure that our VM is completely up to date by running apt-get update and apt-get upgrade.

sudo apt-get update 
sudo apt-get upgrade

Next let’s install xfce, xfce is a fairly lightweight but still very user friendly desktop environment. Of course, you can install Unity or KDE or whatever floats your boat, but to keep resources free for other operations, I’ve chosen to use a lightweight desktop environment.

The –no-install-recommends flag tells apt-get to not consider recommended packages to install, this ensures we only get the minimal packages neeeded to get xfce running.

sudo apt-get install -y xfce4 --no-install-recommends

2. Install and Configure Xrdp

Xrdp is an open source package that allows us to login to remote Virtual Machines using RDP (Microsoft Remote Desktop Protocol).

You can view the project on github.

Install Xrdp with apt-get

sudo apt-get install -y xrdp

Once it’s installed, Xrdp should start automatically, check that it is running by typing:

sudo systemctl status xrdp

Configure Xrdp

Xrdp uses the /etc/ssl/private/ssl-cert-snakeoil.key file, which is only readable by users that are members of the ssl-cert group

Add xrdp User to the ssl-cert Group

sudo adduser xrdp ssl-cert  
sudo systemctl restart xrdp

3. Disable the Compositor

The refresh rate on the RDP session is pretty slow, XFCE isn’t TOO bad (Unity & KDE were pretty un-usable for me), disabling the compositor makes it way better so I suggest doing just that.

You can disable the compositor via the GUI or via the terminal.


xfconf-query -c xfwm4 -p /general/use_compositing -t bool -s false


Run Window Manager Tweaks


Click on Compositor and click Disable.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United Kingdom United Kingdom
I have been working in software development for over 16 years, during that time I have worn many hats.

I have worked as a Software Engineer, Architect, Agile Coach and Trainer. I’ve created teams, I’ve lead teams, but my main goal is to help teams build great software and enjoy the process.

I help a whole range of businesses – from startups with just an idea who want to build a team to take that idea into reality and FTSE 100 businesses who need to optimise existing teams – I train, mentor and coach them to success.

If you happen to know of anybody who could benefit from results like this, then please go to my contact page and get in touch.

Owen Davies

Comments and Discussions

-- There are no messages in this forum --