Use the MATE desktop environment provided with Amazon Linux 2
The MATE desktop environment
Complete the following procedure to use the MATE desktop environment.
To configure Remote Desktop Protocol (RDP) connections and set up a password
-
Use the following describe-images
command to get the ID of the AMI for Amazon Linux 2 that includes MATE in the AMI name. aws ec2 describe-images --filters "Name=name,Values=amzn2*MATE*" --query 'Images[*].ImageId' --output text
The following is example output:
ami-0abcdef1234567890
-
Launch an EC2 instance with the AMI that you located in the previous step. Configure the security group to allow for inbound TCP traffic to port 3389. For more information about configuring security groups, see Security groups for your VPC. This configuration enables you to use an RDP client to connect to the instance.
-
Connect to the instance using SSH. Run the following command to set the password for
ec2-user
.[ec2-user ~]$
sudo passwd ec2-user -
Open an RDP client on the computer from which you will connect to the instance (for example, Remote Desktop Connection on a computer running Microsoft Windows). Enter
ec2-user
as the user name and enter the password that you set in the previous step.
To disable the MATE Desktop Environment on your EC2 instance
You can turn off the GUI environment at any time by running one of the following commands.
[ec2-user ~]$
sudo systemctl disable xrdp
[ec2-user ~]$
sudo systemctl stop xrdp
To enable the MATE Desktop Environment on your EC2 instance
To turn the GUI back on, you can run one of the following commands.
[ec2-user ~]$
sudo systemctl enable xrdp
[ec2-user ~]$
sudo systemctl start xrdp