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.
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:
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.