• Contact
  • About Me
  • Privacy Policy
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Solutions

Remote Desktop Access to Ubuntu 24.04 from Windows

neo by neo
May 27, 2025
in Solutions
0
Remote Desktop Access to Ubuntu 24.04 from Windows

Remote Desktop Access to Ubuntu 24.04 from Windows

0
SHARES
109
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

Remote Desktop Access to Ubuntu

Remote Desktop Access to Ubuntu 24.04 from Windows is a simple way to control your Linux system remotely. It lets you use Ubuntu through a familiar interface — straight from your Windows PC. This setup is useful for many reasons. For example, you might need to manage a home server, run Linux apps remotely, or access files on your Ubuntu machine while traveling. In this guide, you’ll learn how to install xRDP on Ubuntu 24.04. We’ll also set up XFCE, a fast and lightweight desktop environment that works well with RDP.

Step by step, we’ll go through the entire process. No complex tools. No confusing settings. Just a clean and efficient remote desktop experience.

Prerequisites

Before you begin setting up xRDP with XFCE on your Ubuntu 24.04 system, make sure you have the following:

  1. A running Ubuntu 24.04 system: This guide assumes you are using Ubuntu 24.04 Desktop or Server edition. Make sure your system is up-to-date.
  2. Root or Sudo privileges: You will need administrative access to your system to install packages and configure services. Ensure you have sudo privileges.
  3. Network access: Ensure your Ubuntu machine is accessible from the network. You’ll need to be able to connect to it from a Windows machine or any device with an RDP client.
  4. RDP client: On your remote machine, make sure you have an RDP client installed (e.g., Windows’ built-in Remote Desktop Connection, or any third-party RDP client like Remmina for Linux, or Microsoft Remote Desktop for macOS).
  5. Basic terminal skills: This guide requires basic knowledge of using the terminal to install packages, configure files, and run commands.

Option 1: Remote Desktop Access GUI Configuration

If you prefer using the graphical interface instead of the terminal, Ubuntu 24.04 also offers a built-in Remote Login feature. Here’s how to enable it:

Step-by-Step Instructions:

Step 1: Open Settings
Click on the system menu in the top right corner of your screen and select Settings or just Type Settings in Search box.

Ubuntu Settings
Ubuntu Settings

Step 2: Navigate to System > Remote Login
In the left sidebar, scroll down and click on System.
Then, choose Remote Login from the right panel.

ADVERTISEMENT
Ubuntu Remote Login

Step 3: Enable Remote Login and Enter Login Details
Toggle the switch to ON to enable remote desktop access.Under Login Details specify your username and password. In my case I am using Desktop Sharing and I put this information there.

Note the IP Address
Take note of your Ubuntu device’s IP address. You’ll need it to connect from your Windows machine. You can check in terminal with the command ip address

Step 4: Connect from the Windows to the Ubuntu Server

ADVERTISEMENT

Open Remote Desktop Connection on Windows and enter the IP Adress of your Ubuntu Server. In my case I am using Oracle VirtualBox Port Forwarding and connection profile looks like this:

Windows Remote Desktop Settings

Option 2: Remote Desktop Access Installation Script – Not recommended

Explanation of the Script

  • Step 1: The script starts by updating the package lists to ensure you’re getting the latest versions of the software.
  • Step 2: It installs the Xubuntu desktop environment (XFCE), which is lightweight and perfect for remote desktop use.
  • Step 3: The xrdp package is installed to allow RDP access to the Ubuntu system.
  • Step 4: The script configures lightdm as the default display manager, which is recommended for use with XFCE and xRDP.
  • Step 5: It adds the xrdp user to the ssl-cert group, which is required to access SSL certificates.
  • Step 6: It creates the .xsession file, which instructs xRDP to start the XFCE session when logging in via RDP.
  • Step 7: The script cleans up any old session data to ensure a smooth connection.
  • Step 8: The xRDP service is restarted to apply the changes made by the script.
  • Step 9: It ensures that xRDP will start automatically when the system reboots.
  • Step 10: If your firewall is enabled, it opens port 3389, which is required for RDP traffic.
  • Step 11: The script finishes by notifying you that the setup is complete and you can now access the system via RDP.
#!/bin/bash

# This script automates the installation and setup of xRDP with XFCE on Ubuntu.

# 1. Update the package lists to ensure we get the latest version of all packages
echo "Updating package lists..."
sudo apt update -y

# 2. [OPTIONAL] Install Xubuntu desktop environment (XFCE) for a lightweight and fast desktop experience
#echo "Installing Xubuntu desktop..."
#sudo apt install xubuntu-desktop -y

# 3. Install xRDP for remote desktop access
echo "Installing xRDP..."
sudo apt install xrdp -y

# 4. Set lightdm as the display manager (this works best with XFCE and xRDP)
echo "Setting lightdm as the default display manager..."
sudo dpkg-reconfigure lightdm

# 5. Add the xrdp user to the ssl-cert group to allow access to the SSL certificates
echo "Adding xrdp user to ssl-cert group..."
sudo adduser xrdp ssl-cert

# 6. Create the .xsession file to start XFCE for xRDP sessions
# This file tells xRDP to start XFCE when a user connects via RDP
echo "Creating .xsession file to start XFCE..."
echo "startxfce4" > ~/.xsession
chmod +x ~/.xsession  # Make sure the file is executable

# 7. Clean up old xRDP sessions (if any) to avoid conflicts during the new connection
echo "Cleaning up old sessions..."
rm -rf ~/.cache/sessions/*

# 8. Restart xRDP service to apply the new configuration
echo "Restarting xRDP service..."
sudo systemctl restart xrdp

# 9. Enable xRDP to start automatically on boot
echo "Enabling xRDP service to start on boot..."
sudo systemctl enable xrdp

# 10. Open port 3389 on the firewall (if UFW is enabled) to allow RDP traffic
echo "Opening port 3389 for RDP access..."
sudo ufw allow 3389/tcp

# 11. Setup complete!
echo "Setup complete! You can now connect to your Ubuntu desktop via RDP using your username and password."

How to Use the Script

Copy the script and save it to a file, e.g., install-xrdp.sh.

nano install-xrdp.sh

Make the script executable:

ADVERTISEMENT
chmod +x install-xrdp.sh

Run the script:

./install-xrdp.sh

About The Author

neo

See author's posts

ADVERTISEMENT
Previous Post

Fix “blk_update_request: critical target error” on Ubuntu Server with SSD (dev sdb, DISCARD Operation)

Next Post

Oracle VirtualBox: Port Forwarding in NAT Network Mode

neo

neo

Next Post
Oracle VirtualBox: Port Forwarding in NAT Network Mode

Oracle VirtualBox: Port Forwarding in NAT Network Mode

Follow Us

  • Trending
  • Comments
  • Latest
MikroTik: Export Configuration in Text File

MikroTik: Export Configuration in Text File

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Fortinet FortiGate Upgrade Path Tool

Fortinet FortiGate Upgrade Path Tool

Immich: Installation on Ubuntu 22.04

Immich: Installation on Ubuntu 22.04

NextCloud: Port Forwarding - Essential Ports for Smooth Functionality

NextCloud: Port Forwarding – Essential Ports for Smooth Functionality and Remote Access

Organizing and Managing Photos with Immich: Features I Use

Organizing and Managing Photos with Immich: Features I Use

Install Ubuntu 22.04 on Oracle VM Virtual Box

Install Ubuntu 22.04 on Oracle VM Virtual Box

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

MikroTik: Check Your Wireless Password

MikroTik: Check Your Wireless Password

Install SoftEther VPN Server on Ubuntu 24.04

Install SoftEther VPN Server on Ubuntu 24.04

Recent News

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

MikroTik: Check Your Wireless Password

MikroTik: Check Your Wireless Password

Install SoftEther VPN Server on Ubuntu 24.04

Install SoftEther VPN Server on Ubuntu 24.04

Timeshift on Linux: How to Create and Restore System Snapshots

Timeshift on Linux: How to Create and Restore System Snapshots

ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Browse by Category

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos

Recent News

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.