Documentation
    Amazon Web Services
    Microsoft Azure
    RapidAPI
    APILayer
Last Update: 2024-03-01

Amazon Linux 2 with GUI Desktop


Table of Content


Launch Amazon Linux 2 with GUI
Connect to GUI (RDP and VNC)
Connect to your instance via SSH
Deploy files on your VM remotely
Manage VNC Server
Troubleshooting

Launch Amazon Linux 2 with GUI

Navigate to our listing page on the AWS Marketplace and click 'Continue to Subscribe'.

On the subsequent page, review and accept our terms by selecting 'Accept Terms'.

Once the subscription process is complete, select 'Continue to Configuration'.

Choose the region where you wish to deploy the virtual machine, then click 'Continue to Launch'.

On the final page, select the instance type you wish to use (the recommended instance type is pre-selected) and review the other launch options. Then, click 'Launch'.

After launching, you can view your instance in the EC2 Management Console.

Connect to your Linux instance via RDP or VNC


Access the EC2 Management Console (ensure to be in the correct AWS region) to retrieve the public IP address of your virtual machine. For the VNC connection, use the instance ID as the password (e.g. i-0a85cdce733efbb08). The username to use is 'ec2-user'.

Open 'Remote Desktop Connection' and connect by using the public IP address of your virtual machine.

When prompted, enter 'ubuntu' as the username and the instance ID of your virtual machine as the password (please refer to the previous steps).

Connect to your VM via SSH


Please see the official documentation for detailed instructions on how to connect to a virtual machine with SSH.

Go to the EC2 Management Console and select the virtual machine to obtain its Public IPv4 address.

Open a Command Prompt / Terminal window and navigate to the directory where your created .pem key file is located. You can connect to your VM with the user 'ec2-user' by executing the following command:

ssh -i <name-of-key-file.pem> ec2-user@<public-ip>

Deploy files on your VM remotely

Download and install WinSCP or any other SCP client of your choice.

Choose 'SFTP' as the file protocol and enter the public IP address of your instance, using 'ec2-user' as the username.

Click on 'Advanced'.

In the left-side menu, select 'Authentication'. Under Authentication parameters, select the key file you created when you launched the virtual machine. When prompted, convert the .pem key file to PuTTY format.

Close the Authentication window by clicking on 'OK', and connect to the virtual machine by clicking on 'Login'.

Manage VNC server


When you reboot your instance, a cron job script automatically starts the RDP and VNC services. To update this script, connect to the terminal via SSH and log in as 'ec2-user'.

The startup script is located at /home/ec2-user/.vnc/startup.sh. To edit the script, type:

nano /home/ec2-user/.vnc/startup.sh

If you wish to change the display size of the desktop, for example, you can add the desired X and Y dimensions using the -geometry parameter to the vncserver :1 start command.

After making your changes, save the file by pressing Control+O, then exit nano by pressing Control+X. Finally, reboot the VM using:

sudo reboot

Troubleshooting

Resolving RDP/VNC Connection Issues

Encountering difficulties with RDP/VNC connections to your virtual machine can be frustrating. To address these issues effectively, ensure you're using the correct credentials and IP address as outlined in the "Connect to GUI (RDP and VNC)" section.

It's important to note that the RDP/VNC server on the virtual machine is configured to restart with every system reboot. Therefore, restarting the virtual machine might resolve any connectivity problems you're experiencing. If, however, the connection issues persist and cannot be resolved, you may need to consider deploying a new virtual machine.

Additionally, be aware that certain local networks—particularly those within corporate environments—may impose restrictions on network traffic, including blocking ports commonly used for remote connections, such as SSH (port 22), RDP (port 3389), and VNC (port 5901). Prior to attempting an RDP/VNC connection to your virtual machine, verify that your internal network policies do not obstruct these ports, ensuring a seamless connection process.

How to Utilize the Clipboard for Copy & Paste Operations

Most RDP and VNC clients are designed to integrate with your system's clipboard, enabling straightforward copy (Ctrl+C) and paste (Ctrl+V) functionality. This feature allows you to copy text or files on one end and paste them on the other without any complex procedures.

Using "Remote Paste" Feature: Some clients offer an enhanced feature known as "remote paste." This option can usually be found within the client's settings or preferences menu. When enabled, it optimizes the process for copying content from your local system to the virtual machine, ensuring smoother and potentially faster transfers.

Steps for Effective Copy & Paste:

For Text:

  1. Select the text you wish to copy on your local machine.
  2. Press Ctrl+C to copy the text to the clipboard.
  3. Switch to your RDP or VNC client window where the virtual machine is running.
  4. Press Ctrl+V to paste the text within the virtual machine environment.

For Files:

  1. Highlight the file(s) on your local system that you want to transfer.
  2. Use Ctrl+C to copy the selected file(s).
  3. Move to the virtual machine via your RDP or VNC client.
  4. Press Ctrl+V to paste the file(s) into the desired location on the virtual machine.

Troubleshooting Tips:

Clipboard Not Working? If you encounter issues with the clipboard functionality, first ensure that clipboard sharing is enabled in your RDP/VNC client's settings. This setting is crucial for copy-paste operations to work across your local system and the virtual machine.

File Transfer Fails? Ensure that the client and virtual machine both support file transfer via clipboard. Some setups may require additional configuration or support only text copy-paste by default.

Performance Issues: For large files or slow connections, consider using dedicated file transfer protocols or services instead of clipboard operations for a more reliable and efficient transfer process.