A couple of options for remote access to desktop applications on a EC2 host.
Option 1: SSH with X11 Forwarding
Connect to the EC2 host using SSH with X11 forwarding enabled.
ssh -X 13.57.185.127
In the resulting session you should find that the DISPLAY environment variable is set.
echo$DISPLAY
With this in place you can launch an application on the remote host and it will show up on your local desktop. Try starting gvim (assuming that you have it installed).
Edit the RDP configuration file, /etc/xrdp/xrdp.ini, on the host. Note the entry for port, which will be important for making a connection. A minimal configuration might look like this:
💡 Setting crypt_level to none will help to make the remote session more responsive.
In the AWS Dashboard edit the Security Group for the EC2 instance and allow inbound TCP connections on port 3389.
Restart RDP.
sudo service xrdp restart
Choose the Window Manager for RDP connections. This involves changing the contents of a user’s .xsession file. You can copy the modified .xsession into /etc/skel/ so that it will be propagated into any newly created accounts. However, you’ll need to copy it manually into existing accounts.
Select one of the Window Manager options below (there are certainly other options too!).
How to connect EC2 using RDP. Go to EC2>Instances>Launch an Instance. Type 'Windows' as an instance name, and then select Windows as an Amazon Machine Image (AMI).
Open the Amazon EC2 console , set it to the stack's region, and choose Security Groups from the navigation pane. Choose AWS-OpsWorks-RDP-Server, choose the Inbound tab, and choose Edit. Choose Add Rule and specify the following settings: Type – RDP.
The following are common reasons why EC2 Instance Connect might not work as expected: EC2 Instance Connect doesn't support the OS distribution. The EC2 Instance Connect package isn't installed on the instance. There are missing or incorrect AWS Identity and Access Management (IAM) policies or permissions.
One reason for connection problems and other typical errors like 'remote desktop services is currently busy' can be an unstable internet connection. Also, the wrong credentials often cause lead to the remote desktop not being able to connect correctly.
There many nuanced differences between these services but the basic idea is that EC2 Instance Connect allows for a convenient and secure native SSH connection using short-lived keys while Session Manager permits an SSH connection tunneled over a proxy connection.
Amazon EC2 Instance Connect Endpoint (EIC Endpoint) allows a secure connection to the instances in a private subnet from the internet. It does not require a bastion host, internet gateway in VPC, a public IP address on the resource, or even any agent to connect to the resource.
Amazon RDS automatically sets up your related network settings to enable a secure connection between the selected EC2 instance and the RDS database. This connectivity automation improves productivity for new users and application developers.
An internet gateway enables resources in your public subnets (such as EC2 instances) to connect to the internet if the resource has a public IPv4 address or an IPv6 address.
Introduction: My name is Duane Harber, I am a modern, clever, handsome, fair, agreeable, inexpensive, beautiful person who loves writing and wants to share my knowledge and understanding with you.
We notice you're using an ad blocker
Without advertising income, we can't keep making this site awesome for you.