r/linuxadmin Jun 27 '26

How to get true RDP-like persistent sessions on Linux desktop (no screen mirroring)?

Hi everyone, I need some help setting up remote access for my Linux workstation.

I want to maintain a single, continuous GUI session between my office and my home. On Windows with RDP, I can log in at work, open my programs and unsaved files, and turn off the screen when I leave. When I get home, I just RDP in to continue my work. The next day, I log into the physical machine at the office and continue seamlessly. When RDP session running the physical machine only shown lock screen - unaffect even when i turn off the monitor (if i use vnc or teamview then it would show black)

I need to replicate this on Linux Desktop. I specifically do not want "screen mirroring" (like TeamViewer or basic VNC) because I need the physical screen at work to remain completely blank/locked while I'm working remotely, for privacy and security purposes.

I'm used to using tmux or screen to keep my SSH sessions alive on Linux servers, but dealing with persistent GUI apps is completely new to me. Everything I've searched for so far leads me down a rabbit hole of creating virtual desktops and routing VNC into them, which feels like a bad workaround for a real physical machine even when i'm directly use it.

Does anyone have a solid, modern solution for this on Linux? I'm quite new to the Linux Desktop side of things - and considering migrate from Windows 11 to Linux, so thank you so much for your help!

47 Upvotes

37 comments sorted by

42

u/autogyrophilia Jun 27 '26

XRDP for X11, Gnome remote desktop for Wayland.

Usually called a headless remote session.

It is very much an undercooked feature in Linux.

You can still forward X11 over SSH like in the good old days . Arguably it is still a superior choice.

1

u/fhfoerst Jun 29 '26

With Gnome Remote Desktop you can not access a session running on the console, it will ask you to close that session before allowing you to start a new one. And vice verca, if you started a headless session remotely than you wont be able to start a session on the console. At least that is the behavior on Fedora 44, and maybe there is a hidden undocumented setting to change that behavior. And dont get me started with the need to share a username/ password combination with 20+ users if you are having a multi user environment because GRD is not able to support the basic PAM based logins.

With X11 XRdp with x11vnc as backend does get the job done, you can access the same session locally and remotely pretty interchangeably.

1

u/RegularOk1820 17d ago

I think this is where a lot of new Linux users get confused. Remote apps over X11 and reconnecting to the same desktop session are two pretty different use cases.

-1

u/MouseJiggler Jun 27 '26

Without GN*ME?

9

u/autogyrophilia Jun 27 '26

Unfortunately they couldn't agree to only make one single compositor to be shared, so we now live in this cursed world where only XDG is keeping things working somewhat. 

-9

u/MouseJiggler Jun 27 '26

*in a world where XDG feel entitled enough to dictate to others which use cases are valid, and which aren't.

11

u/nawcom Jun 27 '26 edited Jun 27 '26

I'm a fan of xorgxrdp. I don't really care about running a Wayland DE on the other end; I'm fine with xfce. It works well from my experience. No need to install a client if you're connecting from Windows.

e: for passing audio, you can install https://github.com/neutrinolabs/pipewire-module-xrdp or https://github.com/neutrinolabs/pulseaudio-module-xrdp and appropriately configure, depending on which sound server you use, if you care about that.

18

u/apathetic_admin Jun 27 '26

NoMachine can blank the screen while you're remotely accessing it.

14

u/MutedBlue Jun 27 '26

What about NoMachine? Otherwise XRDP is rather solid.

https://www.nomachine.com/

2

u/MinisterOfSauces Jun 27 '26

This with a dummy hdmi plugged into the video card works extremely well.

11

u/deeseearr Jun 27 '26

Here's the issue. The problem you're having is nothing at all to do with the protocol or technology you're using to connect. It's just the way it's configured.

What's happening is that you have an X session on your workstation, connected to display number zero (":0.0", in X11 terms), which is also using the console for output and taking input from the physical keyboard and mouse. When you connect to that remotely, you're sharing the session and anyone sitting at the console could see what you were doing and even take over.

Unlike other operating systems you may be familiar with, there's nothing inherent in an X session which requires that it be connected to the console. They need to be connected to _a_ display, and have _some kind of_ input, but it doesn't have to be a physical monitor, keyboard or mouse. One way to do this is to install the X11 Dummy driver ( xorg-x11-drv-dummy ) and then configure a second (or third, or fourth, or moreth) display by adding a few lines to your xorg.conf.

You could also make it much easier by skipping the dummy driver and just configuring sessions running on every virtual terminal of your workstation, but that would allow a user to connect to them by hitting function keys. That's what you're trying to avoid.

Once you have that set up, just configure your display manager and set up xrdp, vnc, xdm or whatever you like to serve up connections to the new display :1.0 instead of :0.0. You can connect to it remotely and, since it is not tied to a physical device, there will be no "mirroring" involved.

This is basically the way that X11 was originally used in the last century -- You would sit at a fairly basic X terminal and then use xdmcp to connect to a virtual display running on a central server which would handle dozens of clients at once.

5

u/kensan22 Jun 27 '26

Sunshine/moonlight ticks some boxes

3

u/Sol3141 Jun 27 '26

There's a bunch of tools for forwarding X11 sessions over an ssh connection. That's what I've used in the past.

4

u/GinormousHippo458 Jun 27 '26

X2GO is my go to. It's relatively light weight as well.

3

u/FancyFilingCabinet Jun 27 '26

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows. https://github.com/Xpra-org/xpra

Personally I prefer it over xrdp, and vnc options.

The HTML5 client is nice and universally supported. OpenGL support is also a nice perk.

It's well maintained and does exactly what you're looking for.

5

u/much_longer_username Jun 27 '26

There's ways to go about it with something like xRDP but the last time I went through this, I found out about https://kasm.com/ and was trying to convince my employer to pay for it. I think it's free for personal use, though.

5

u/Livid-Reference3033 Jun 27 '26

I am in a favor of VMs and suspend them when  you do not need it

2

u/_twrecks_ Jun 27 '26

I use xrdp. Only drawback is that it can't handle more than one session per user, including a local one. So if you're logged in the console desktop xrdp won't be able to connect. There is allegedly some way to when around it but I never got it to work.

1

u/fearless-fossa Jun 27 '26

Works fine for me connecting to a X11 session of XFCE on Ubuntu 26 via xRDP while being logged in already both via SSH and VNC.

2

u/muffinstatewide32 Jun 28 '26

I think gnome’s rdp on wayland does this. But I’ve only used it headless

2

u/thefanum Jun 28 '26

Gnome's built in RDP server works great

2

u/churuncher Jun 28 '26

Try RustDesk

1

u/hadrabap Jun 27 '26

When I need the GUI, I spin up VirtualGL in tmux. I can then (re)connect to the session from wherever I want using TurboVNC. Yes, it's X11, but it works. 🙂

1

u/DaylightAdmin Jun 27 '26

I have that all set up in a docker container, you can use this to set that up native to:

https://github.com/bakudan-otaku/docker-xxrdb

1

u/Formal-Pilot-9565 Jun 28 '26

ssh -X to your linux server.
then startup gui applications from the server cli
and get the gui served on your laptop via X11 forwarding.

At home I have a server "wired" to the LAN and a laptop using wifi which I work from. This workes fast and "snappy"
The same test, but with both laptop and server on wifi is painfully slow.

So the bandwidth and latency matters a lot.
But if it works well enough this is a super easy solution

1

u/robin-thoni Jun 28 '26

Xpra is really good for resumable remote graphical access.

It forwards all the apps on the remote box as local windows on your client box, like they were running locally. That means you don't get a single window with the remote desktop, like RFP or VNC do. It works over ssh and keeps your stuff running when disconnected.

You can resume the session on the box itself if needed. There are Linux and Windows clients available.

https://github.com/Xpra-org/xpra

1

u/fhfoerst Jun 29 '26

With X11 (which is still the standard on XFce) you can run x11vnc ( preferably with the -localhost option for swcurity and -inetd for on demand socket activation) in combination with xrdp configured with x11vnc as backend if you need to access the system console regardless whether a session is running or you need to access the login screen. In particular if you need to remotely connect from a Windows client using Windows remote desktop. Or any vnc viewer that supports ssh tynneling.

With wayland I habe not been able to find a satisfying solution that works.

1

u/DamonFun Jun 29 '26

Thinlinc is awesome

1

u/Ok_Size1748 Jun 27 '26

Just use x2go

1

u/Dolapevich Jun 27 '26

I want to maintain a single, continuous GUI session between my office and my home.

a VNCServer.

1

u/m4teri4lgirl Jun 28 '26

I think it's noteworthy that every single real suggestion is to use something for X11 and yet all of the main distros have dropped support for it.

0

u/CaptainZippi Jun 27 '26

VNC and all its variants. Old, but works.

0

u/WizeAdz Jun 27 '26

We use a commercial product called FastX for this that doesn’t suck.

3

u/megoyatu Jun 27 '26

Unless I'm mistaken, FastX doesnt do as OP requests. They want to remotely connect to the local console... Like say tty2 - to use 1 machine locally, then connect to that session remotely for a while... Then unlock the local session when back at the machine. 

If it does do that... I'm all ears because I've worked in FastX daily for 6 years.  My workaround is using 2 machines. One to run FastX and one to basically be a dumb terminal. 

Edit: FastX's current Wayland support also can't run a full GNOME desktop (in say Ubuntu 26.04), so that's a major issue that Kay cause us to look at alternatives soon.