My desk from a phone or a tablet
GNOME remote desktop on two Linux boxes from two phones and a tablet: a headless session on the box nobody sits at, a mirrored screen on the one I do, and the sizes that make a desktop readable on a phone.
I can open the desktop of either of my Linux boxes from a phone or a tablet and carry on with what was already running there. Both boxes run GNOME on Ubuntu 26.04 and both use GNOME’s own remote desktop, but in two different ways, because I sit at one of them and nobody sits at the other. The devices connect over the private network with aRDP as the client.
The box nobody sits at
The home box has to answer when nobody is logged in at it, and that ruled out the obvious setting. Desktop Sharing, the switch in GNOME’s settings, runs inside my login session. I logged out at the machine and the server stopped with the session.
Remote Login is the system-level version and works with nobody logged in. It also put the login screen in front of me on every connection, and its hand-over from the login screen to my session broke in the phone’s client.
What works is a headless session. The template unit [email protected], enabled for my user, has GDM start a desktop for me at boot with no screen attached, and remote desktop serves that session. I connect and I’m on the desktop, with whatever I left open. On 26.04 the unit as shipped failed with “Failed: The connection is closed” and exit status 70, until I gave it a drop-in that turns DynamicUser off and runs it as root.
A headless session has no monitor, so it takes whatever size the client asks for. aRDP can’t follow the device’s screen: it offers the native resolution or a custom one. So each device has its own custom size in the shape of its own screen:
| Device | Screen | Desktop it asks for |
|---|---|---|
| Phone | 2484 x 1116 | 1656 x 744 |
| Phone | 2400 x 1080 | 1600 x 720 |
| Tablet | 1920 x 1200 | 1600 x 1000 |
That’s two thirds of native on the phones, which fills the screen and leaves the text big enough to read. The tablet’s is closer to native and its text comes out about 1.2 times larger.
It’s one client at a time. When the tablet connected while a phone was in, it took the session over and the desktop resized from 1656 x 744 to 1600 x 1000. One phone negotiates H.264 with the server and the other doesn’t.
The box I sit at
This one shares its real session, with Desktop Sharing in mirror-primary mode, so a client sees the primary monitor and only that. The primary is 3840 x 2160, which is 16:9, and the phones are about 20:9, so the phone shows the whole monitor with bars down the sides. aRDP has no stretch, and the custom size does nothing in mirror mode.
The other mode is extend, which adds a virtual monitor sized to the client. It filled the phone. It also left the top bar and the dock on the real screen, so the phone got a bare desktop, and adding the virtual monitor reset the real ones: both 27 inch 4K monitors lost their rotation and dropped from 74.6 Hz to 60 while I was working on them. It went straight back:
gsettings set org.gnome.desktop.remote-desktop.rdp screen-share-mode mirror-primary
Since then, anything about how the desk looks on a phone gets fixed in the phone’s client and the desk’s own display settings are left alone.
Mirroring the primary monitor has one real limit: windows on the other two monitors can’t be reached. I wrote a small script that makes another monitor the primary one through gdctl, keeping every monitor’s mode, position, scale and rotation so the windows don’t move. Mutter forgets the change at the next log-in. So far I’ve only run it in Mutter’s verify-only mode, which accepted all four targets.
When a terminal is enough
For terminal work I skip the desktop. Each device has Termux with ssh to both boxes, and tmux on the box keeps the session there for the next time I connect, from whichever device that is. mosh is installed as well.
Featured projects
-
Apple News API
Publish articles and live coverage to Apple News from PHP, with the whole Apple News Format built from objects.
-
GitHub Auditor
Health, access and activity reports for more GitHub and Bitbucket repositories than you can keep in your head.
-
PrintMD
Markdown in, and a designed PDF, Word or PowerPoint file out. Its PDF service runs on your own computer.
-
Where Should I Live
Which city would leave you best off? Cities ranked by take-home pay, living costs, visas and the way you live.
-
Solar Calendar
Thirteen months of exactly four weeks, with the year starting on the first Monday on or after the spring equinox.
Latest writing
-
Many sessions at once, and what still needs me
Fifteen coding-agent sessions across two Linux boxes, one session that watches the rest, what it may answer for me, what it never may, and why a yes it passes on gets checked against what I typed.
-
61 public repos of agent tooling, none installed, six ideas kept
One author, 61 public repositories of coding-agent tooling: what I checked before any of it got near my Linux boxes, why none of it was installed, and the six ideas I built my own way.
-
Rules a coding agent cannot talk its way round
The hook that reads every command a coding agent wants to run on my Linux boxes: what it refuses, the 27 proofs that its tests fail when a rule is taken out, and the four lines every report opens with.
-
What my Linux boxes check every hour
What the hourly health check on my two Linux boxes looks at, the numbers it warns on, and the time it failed every hour over a socket that was fine.