Technology3 min read

Easily remote desktop to Linux VPS with RDP/VNC

Abhishek Ahlawat

By Abhishek Ahlawat โ€” FEBRUARY 10, 2023

Founder of StudyTonight and a MERN fullstack developer. Writes about JavaScript, web development, Linux, and tech.

#linux#howto

Summarize this article using AI

Cloud Computing services like AWS, Digital Ocean, Azure, Linode, etc. provides us a secure way to access the remote machine with SSH. It enables you to open a shell or a command line interface and run commands. Which is great to do every posible thing with CLI, access files, forward ports, etc. Often, you want to access the GUI to perform certain tasks.

In this tutorial, we will start with a basic command line interface or shell to setup a remote desktop environment.

If there is a firewall running on your system which does not allows public connection to ports. Please disable it temporarily while following through this tutorial and enable again after finishing this process.

Update packages

Firstly, we need to update and fix broken packages by using the following command:

$ sudo apt update -y && sudo apt --fix-broken install -y

Setup a desktop environment

A desktop environment is required to use/access Graphical User Interface (GUI). There are many desktop environment such as Gnome, XFCE4, KDE, etc. We recommend a light desktop environment, XFCE4.

Install xubuntu-desktop or xfce4-desktop:

$ sudo apt install xubuntu-desktop

Install Remote Desktop Protocol (xrdp)

RDP is a remote desktop method and its client comes pre-installed by default in Windows operating systems. We need to install RDP server in the Linux server with this command:

$ sudo apt install xrdp -y

Edit XRDP configuration script:

sudo nano /etc/xrdp/start-ws.sh
# remove last two lines and add:
startxfce4

Make sure that xrdp and xrdp-sessman services are running:

$ sudo systemctl start xrdp && sudo systemctl start xrdp-sessman

Conclusion

In this tutorial, we have used a SSH connection access to newly deployed VPS server. Then we install GUI (desktop environment) and Remote Desktop into it with xrdp server.

Spotted something outdated or wrong?

Liked this? See more StudyTonight posts in Google results.

Add StudyTonight as a preferred source
Next questLIVE OPSStep 2 / 3

Practice real incidents in the browser

System Design Ops โ€” put out fires, ship fixes, and stack XP. Reading done. Time to play.

Play System Design
  • +XP

    Every sim

  • Incidents

    Live ops

  • Ranks

    Climb up

Read next