Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Ubuntu Mantic #190

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
109 changes: 66 additions & 43 deletions aws/aws-how-to/instances/launch-ubuntu-desktop.rst
Original file line number Diff line number Diff line change
@@ -1,78 +1,105 @@
Launch an Ubuntu desktop on EC2
===============================
Launch and connect to an Ubuntu Mantic desktop EC2 instance
===========================================================
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this to 'Launch an Ubuntu Mantic desktop on EC2'. We want to try and minimise the number of words used, while still conveying things accurately. We want the title to include important words to help with SEO, but at the same time we don't want it to be too long or unwieldy to read.

Such decisions are quite subjective, but that's okay since the whole documentation process is quite iterative and we'll keep improving things in the future.


To create an Ubuntu desktop environment on your EC2 VM, you can use TightVNC as your remote desktop server and Remmina as your local desktop client.
Use the xrdp server and Remmina to connect to an AWS EC2 instance of Ubuntu Mantis.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This start sounds a little too much like an instruction rather than an introduction. The whole how-to guide is basically a set of instructions, but it is usually nice to have an introductory statement before the actual steps begin. It could be something along the lines of what we are trying to achieve and an overview of how we are going to do that. Your statement is exactly that, but could you try to make it sound less like an instruction? Also you missed the 'Mantis' :)

.. Note::
Select and configure Ubuntu Mantic
----------------------------------
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description in this section & in the next section needs to be more detailed, especially because there are quite a few screen changes happening during the process. Although we assume that the reader is familiar with the system, while giving instructions we still have to ensure that all steps are mentioned (as precisely as possible) and there is minimum room for confusion. So we need to stick to a specific flow and mention options/choices as and when required within the flow.

We can use screenshots if something is not obvious or is difficult to find, but in general we prefer to minimise their use.


Both the remote EC2 instance and your local machine are assumed to be running Ubuntu 16.04 or greater.
Open AWS Marketplace and search for Ubuntu Mantic. Subscribe and agree to the Terms and Conditions. Select Launch Instance to configure.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Include the link for the search as in the discourse post, it helps.
  • Don't capitalise unless required. It could be required in some cases such as if it is a brand name or if we are referring to an UI element. But if its an UI element, then we also use its appropriate formatting. So e.g. if it's a button use :guilabel: along with the exact wording of the button.

Select a region closest to you. For exapmple, if you're in the ``UK EU-West-2`` would be a good option. Click :guilabel:`Continue to Launch Through EC2 Instance`.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Select a region closest to you" sounds like a requirement, which it is not. They could ideally select any region that they want. So we try to avoid such suggestions in how-to guides where the user is expected to have some prior experience with the system and can independently take basic decisions. On the other hand, such a suggestion would be ideal in the case of a tutorial.

typo: 'exapmple'

Install Ubuntu desktop and TightVNC on your VM
----------------------------------------------
Give your instance a name. Mantic requires least two cores and at least 8gb RAM, which should be the default option. The default volume space of 8gb is the minimum required, however, more space will be required to install applications.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Give your instance a name" is most probably too basic a command for people used to launching instances. Also think if it is a required step. If the UI provides some default name, it won't be a required step. (Again this would be definitely needed in a tutorial, but not so much in a how-to guide.)

"Mantic requires least two" - This seems to imply that because it is Mantic, it needs those resources. The post doesn't say Mantic, it mentions Ubuntu desktops in general. So we should be very careful when we change statements, we don't want to inadvertently add wrong information or miss any information. Also you missed an 'at' there before 'least'.

Change gb to GB (with 'gb' its not clear whether it is gigabits or gigabytes)

Try to avoid repetitions and use as few words as possible to get the message across. e.g here 'at least' and 'default' are used twice.

To install Ubuntu desktop and TightVNC server on your EC2 instance, SSH into it and run:
Create a security group
-----------------------

Select :guilabel:`Create Security Group`. Make sure the ssh tick box is selected to allow remote access.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 'SSH' instead 'ssh' everywhere.
The post gives details about opening the RDP port, which is missing here.

You can select an existing key pair if you already have one set up or create a new key pair. To create a key pair give it a name and Select ``RSA`` and ``PEM``. A Pem file will be automatically downloaded.

Launch the instance and connect to it either via ssh or the AWS Console.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to mention the use of EC2 Instance Connect.

Also this statement should be a part of the next section about Installing packages rather than creating a security group.

Install Ubuntu Desktop Packages
-------------------------------
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use sentence case for all titles. This style guide might be helpful in such instances.


.. code::
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some statement like - "Install Ubuntu Desktop and the Snap Store:"


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

Install and Configure RDP
-------------------------

Install the xrdp server.

.. code::

sudo apt update
sudo apt install ubuntu-desktop
sudo apt install tightvncserver
sudo apt install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
sudo apt install -y xrdp

Save the password created during the installation of the VNC server.
Configure xrdp to use SSL to get an encrypted connection.

.. code::

Configure the VNC server
------------------------
sudo usermod -a -G ssl-cert xrdp

On your VM, launch the VNC server to create an initial configuration file:
Set up a password for the Ubuntu user.

.. code::

vncserver :1
passwd

Edit the configuration file ``~/.vnc/xstartup`` to include:
Finally, restart the xrdp service.

.. code::

#!/bin/sh
systemctl restart xrdp

Configure the Ubuntu Session
----------------------------

export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
Connect to your instance using RDP to check the previous steps were succseful. Create a configuration script called ``ubuntu-session`` in ``/usr/local/bin/`` to run on RDP connections.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: succseful (Run PROJECT=aws make spelling on your local instance to catch the typos)
It might be a good idea to mention that on successful connection, you only see a vanilla Gnome desktop without the Ubuntu session.

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
.. code::

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

Add the following to the ubuntnu-session script.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

vncconfig -iconic &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
.. code::

#!/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

Kill and restart the VNC server:
Make the script executable.

.. code::

vncserver -kill :1
sudo chmod +x /usr/local/bin/ubuntu-session

vncserver :1
Update the session manager to use the new session configuration.

.. code::

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

Allow traffic on the VNC port
-----------------------------
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this and the following sections: Since we have set up the RDP server, and plan to use that, these sections and references to VNC are not needed. Just use a single consistent approach as mentioned in the discourse post.


To allow an external connection to the VNC server, you'll need to ensure that the relevant port of your VM is open. On your EC2 console, modify the inbound rules for your instance by adding an entry for TCP port 5901: ``Custom TCP Rule | TCP | 5901 | Custom | 0.0.0.0/0 | VNC Connect``

Ensure that the relevant port of your Mantic EC2 Instance is open. On the EC2 console, modify the inbound rules for your instance by adding an entry for TCP port 5901: ``Custom TCP Rule | TCP | 5901 | Custom | 0.0.0.0/0 | VNC Connect``

Install Remmina on your local machine
--------------------------------------

To access the Ubuntu desktop installed on your VM, use a remote desktop client like Remmina on your local machine. Install Remmina using:
Use a remote desktop client like Remmina on your local machine to connect to the Ubuntu Mantic Desktop. Install Remmina using:

.. code::

Expand All @@ -82,10 +109,6 @@ To access the Ubuntu desktop installed on your VM, use a remote desktop client l
Connect to your remote Ubuntu desktop
-------------------------------------

Launch Remmina, and choose the connection type as 'VNC'. For the connection string, enter your EC2 instance URL along with 1 as the port number, something similar to:

.. code::

ec2-54-172-197-171.compute-1.amazonaws.com:1
Launch Remmina, and choose the connection type as 'VNC'. Enter the instance ip address, which can be found on the EC2 console and port number 3389.

Select :guilabel:`Connect!` and enter the VNC server password saved earlier. This should give you access to the remote Ubuntu desktop.
Select :guilabel:`Connect!` and enter the VNC server password created earlier.
Loading