Hostwinds Tutorials
Search results for:
Table of Contents
Tags: Cloud Servers, Windows
Remote Desktop Protocol (RDP) allows you to connect to and manage a remote computer as if you were sitting in front of it. While RDP is commonly associated with Windows systems, you can also use it to connect to Linux machines.
In this tutorial, we'll walk you through the process of setting up and using RDP to access a Linux machine from Windows.
Before we begin, let's confirm the following:
Windows uses the RDP protocol by default, so you'll need to install an RDP server on your Linux machine. A popular option is xrdp.
sudo apt update
sudo apt install xrdp -y
On CentOS or Fedora, use::
sudo yum install epel-release -y
sudo yum install xrdp -y
3. Start and Enable xrdp
Start the xrdp service:
sudo systemctl start xrdp
Enable it to start on boot:
sudo systemctl enable xrdp
4. Check the Status
Verify that the service is running:
sudo systemctl status xrdp
Different desktop environments (e.g., GNOME, KDE, XFCE) require specific configurations. Here's a common approach:
1.Check Installed Desktop Environment:
If unsure, use the following command to determine your desktop environment:
echo $XDG_CURRENT_DESKTOP
2. Configure xrdp to Use the Desktop Environment
sudo nano /etc/xrdp/xrdp.ini
Ensure it references your preferred desktop session. For example:
exec=startxfce4
Replace startxfce4 with the command for your desktop environment (e.g., startgnome or startkde).
3. Restart the xrdp Service:
sudo systemctl restart xrdp
Ensure that your Linux machine's firewall allows RDP traffic (port 3389 by default).
1.Open the RDP Port
sudo ufw allow 3389
sudo firewall-cmd --permanent --add-port=3389/tcp
sudo firewall-cmd --reload
2. Verify the Open Port:
sudo netstat -tulpn | grep 3389
For more information on Linux ports, check out 5 Ways to Check Open on Linux.
Now that the Linux machine is ready, it's time to connect from Windows.
If your Linux desktop isn't loading through RDP, it may be due to a variety of factors, but a few simple checks can help you quickly identify and resolve the problem. Here are some of the more common issues you might come across:
Using RDP to connect from Windows to a Linux machine is a convenient way to manage your systems. Now you can seamlessly switch between operating systems, leveraging the best of both worlds.
If you have any questions or run into issues, feel free to ask for help or consult the documentation for xrdp and your Linux distribution. Happy remote accessing!
Written by Karlito Bonnevie / April 27, 2022