Most Linux machines do not have RDP enabled. Use SSH or install a desktop environment like xRDP.
To enable Remote Desktop Protocol (RDP) on an Azure Virtual Machine running Linux, you will need to install a desktop environment and an RDP server like xRDP. Here are the steps to do that:
Step 1: Create and Access Your Azure VM
-
Create the VM:
- Log in to your Azure Portal.
- Create a new VM, select the appropriate options for your needs (OS, size, etc.).
-
Access the VM:
- Once your VM is created, access it via SSH:
ssh your-username@your-vm-ip-address
Step 2: Install Desktop Environment and xRDP
- Update the package list:
sudo apt update
- Install a desktop environment (e.g., Xfce):
sudo apt install xfce4 xfce4-goodies
- Install xRDP:
sudo apt install xrdp
- Enable and start the xRDP service:
sudo systemctl enable xrdp
sudo systemctl start xrdp
Step 3: Configure xRDP
-
Add the xRDP user to the
ssl-cert
group:
sudo adduser xrdp ssl-cert
- Set Xfce as the default session for xRDP:
echo xfce4-session >~/.xsession
- Restart the xRDP service:
sudo systemctl restart xrdp
Step 4: Open Port 3389 on Azure Network Security Group (NSG)
- Go to the Azure Portal.
-
Navigate to your VM and select
Networking
underSettings
. - Add an inbound port rule for port 3389.
Step 5: Connect to Your Linux VM via RDP
- Open Remote Desktop Connection on your local machine.
- Enter the IP address of your Azure VM.
- Log in using your username and password created on the VM.
You should now be able to access your Linux VM using RDP.
Top comments (0)