Launch Ubuntu Desktop Mantic Minotaur on EC2

Ubuntu Mantic Minotaur was released in October 2023, the latest and greatest Ubuntu release by Canonical so far. See what’s new in the Official Release Notes and the Deep Dive page.

Note: This guide also works for Ubuntu 24.04 LTS Noble Numbat

Let’s see how we can launch it on an EC2 instance on AWS using RDP for accessing it.

Step 1: Launch an Ubuntu Mantic Instance

Ubuntu Mantic is available on AWS Marketplace only, so you need to open the Marketplace, search for Ubuntu Mantic, and subscribe.

After subscribing and agreeing to the terms and conditions, you will have to wait for a couple of minutes before being able to launch it.

marketplace-subscription

Step 2: Launch the server

The suggested requirements to run Ubuntu Desktop are at least 2 cores and 8GB of RAM, but take into consideration that on remote instances without GPU, the video is being rendered using the CPU.

Regarding disk space, you can fit the whole installation on an 8GB volume, but it won’t be enough for your own applications, so make sure to make some room for your needs.

When selecting or creating a security group, make sure you are allowing SSH and RDP ports (21 and 3389 respectively). You can select the “create a security group” option, which will allow you to enable port 21, but you will need to add the RDP port later (either to the same security group or creating a new one and attaching it to the instance). You can also create a security group before launching the instance.

Step 3: Install Ubuntu Desktop and the Snap Store

You can connect either using SSH (using a SSH client such as PuTTY if you are on Windows or the terminal in Linux) or using Instance Connect on the AWS EC2 console, as shown in the next picture:

ec2-connect

After login, insert the following commands to install the Ubuntu Desktop packages.

sudo apt-get update && apt-get upgrade -y
sudo apt-get install -y ubuntu-desktop
sudo snap install snap-store --edge

This will download all the Ubuntu Desktop packages and dependencies, so it will take a while. Make sure you don’t get disconnected from the session while doing this step.

Step 4: Install and configure RDP

Install the xrdp server with the following command:

sudo apt-get install -y xrdp

And configure it to use SSL to get an encrypted connection:

sudo usermod -a -G ssl-cert xrdp

Finally, we need to set up a password for the Ubuntu user:

sudo passwd ubuntu

And restart the service:

sudo systemctl restart xrdp

Step 5: Configuring the Ubuntu session

At this point, you should be able to connect to your instance using RDP. If you do so, you will see a vanilla Gnome desktop without the Ubuntu session, so we need to create a configuration script that will be run on RDP connections.

Using Nano or your favorite text editor, create the following file:

sudo nano /usr/local/bin/ubuntu-session

Insert the following content:

#!/bin/sh

export GNOME_SHELL_SESSION_MODE=ubuntu
export DESKTOP_SESSION=ubuntu-xorg
export XDG_SESSION_DESKTOP=ubuntu-xorg
export XDG_CURRENT_DESKTOP=ubuntu:GNOME

exec /usr/bin/gnome-session --session=ubuntu

And make the script executable:

sudo chmod +x /usr/local/bin/ubuntu-session

Finally, we need to update the session manager to use our new session configuration:

sudo update-alternatives --install /usr/bin/x-session-manager x-session-manager /usr/local/bin/ubuntu-session 60

Step 6: Connect to your instance

Open your favorite RDP client and connect to your instance. You can get the IP address from the EC2 console. The connection port is 3389.

I am using Remmina, since I’m on Ubuntu.

1 Like

There’s a minor typo on the first line, it should say October 2023, not October 2024; other than that this is well written & easy to follow :slight_smile:

1 Like

Thanks for the feedback!

First of all a huge thank you. There are various guides on internet about how to do it but yours is the only that works. Tested on 24.04
There are just some minor typos like some sudo missings but at the end desktop works.
The only thing I would like to point out is how to increase a bit screen resolution, being so small is difficult to operate easily.

1 Like

Thanks so much for the feedback! If you notice specific corrections we can make to improve the guide, please let us know—your input would be greatly appreciated. Regarding the screen resolution, I understand it can be a bit tricky. The resolution is actually configured on the client side. For instance, I use Remmina on Ubuntu, which has a button to enable dynamic resolution adjustment.

Great! Here my suggestions

1 - Improve apt command and add missing sudo
sudo apt update && sudo apt upgrade -y
sudo apt install -y ubuntu-desktop
sudo snap install snap-store --edge

and

sudo apt install -y xrdp

2 - Passwd command doesn’t work as is on an EC2 since it requires original ubuntu user password (don’t know if it’s empty or not), better:
sudo passwd ubuntu

3 - Missing sudo
sudo systemctl restart xrdp
and
sudo update-alternatives --install /usr/bin/x-session-manager x-session-manager /usr/local/bin/ubuntu-session 60

4 - Note that it works also for 24.04

5 - Add remmina settings to set better resolution
General - Resolution - Custom - Set higher your preferred resolution

1 Like

Thank you, I updated almost all of the suggestions. The reason why in this example I use apt-get instead of just apt is because it works better on automation scripts. I usually run all of these commands in a cloud-init user script on boot (it is the same reason why I forgot to add some sudos). I’ll investigate a little further about the best way to set up the resolution and I’ll update the tutorial as soon as I have an alternative.

Thanks for the feedback!

1 Like