Documentation

    Amazon Web Services

    Microsoft Azure

    RapidAPI

    APILayer

Last Update: 2024-05-03

Ubuntu with GUI Desktop


Table of Content


Launch and Configure Ubuntu with GUI Desktop
Connect to GUI (RDP and VNC)
Connect to your instance via SSH
Deploy files to your VM remotely
Manage VNC Server
Troubleshooting

Launch and Configure Ubuntu with GUI Desktop

Go to our listing page on Azure Marketplace:

Click on 'Get it now' to initiate the launch dialogue.

Enter a username. Please note that using one of the following reserved keywords will lead to a non-functional GUI: root, daemon, bin, sys, sync, games, man, lp, mail, news, uucp, proxy, www-data, backup, list, irc, _apt, nobody, systemd-network, uuidd, messagebus, systemd-resolve, tcpdump, _chrony, sshd, polkitd, rtkit, avahi, lightdm, pulse, saned, colord, xrdp, gnats, syslog, lxd, dnsmasq, landscape, pollinate, usbmux, systemd-timesync, tss, systemd-coredump, cups-pk-helper, geoclue, gdm, fwupd-refresh

Review the settings and create the virtual machine.

The username for RDP/VNC is the username you set. The password is the vmId of your virtual machine. You can find the vmId on the overview page of the virtual machine after clicking on "JSON View."

Optional: By default, the VM network ports for SSH and VNC are open to the public. You can restrict access (e.g., only allow access from your local IP address) under selected VM -> Network settings.

Connect to your Linux instance via RDP or VNC


Please refer to the 'Launch and Configure' section above before proceeding with this part. For the RDP/VNC connection, you will need the username you created in the Azure portal, as well as the Virtual Machine ID (vmId) for your password.

Obtain the public IP address of your Virtual Machine:

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

When prompted, enter the username and password you specified during the setup of the virtual machine (refer to the 'Launch and Configure' step above).

Connect to your Linux VM via SSH


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

Open a Command Prompt / Terminal window and navigate to the directory where you have saved the .pem key file, which was created in the Azure portal. You can connect to your VM using the username specified during the virtual machine creation process by executing the following command:

ssh -i <name-of-key-file.pem> <username>@<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, along with the username you specified when launching the virtual machine.

If you opted for password authentication, enter the specified password. Alternatively, if you wish to use a private key file (.pem) that you generated, you can add it by first clicking 'Advanced' and then selecting 'Authentication' from the left-side menu.

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 your created user (for the purposes of this documentation, 'azureuser').

The startup script is located at /home/azureuser/.vnc/startVNC.sh. To edit the script, type:

nano /home/azureuser/.vnc/startVNC.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.

"Failed to execute default Web Browser."

In recent versions of Ubuntu 24.04, Mozilla Firefox is not set as the default web browser in the GUI. This results in an error when clicking on the browser icon on the desktop.

To resolve this issue, open the "Default Applications" app, select Mozilla Firefox as the default browser, and then click 'Close'.