Blog/Cooking up a basic remote desktop with xRDP and Fedora 38

From ~esantoro

So recently I found myself in the office (don't even get me started...) and I needed to access one of my personal email accounts. I only had my iPad (as a private device - and yes I'm keeping it, more details in a future post) and i didn't have that account configured on the iPad. If only I could access my laptop (ad home) remotely...

Remembering (again) the old classic I swapped my MacBook for an iPad+Linode I decided to see into what I could do to get a remote desktop working on my iPad.

I did some tinkering and got something usable, in this page I'll be describing what I've achieved and (to a limited extent) how to replicate it.

Once again, this article is mostly for my own future fruition, so don't expect much replicability. I'll be working on Fedora 38, because that's my OS of choice currently

NOTE: as of today, this will be a work-in-progress article (because it's pretty late right here).

Desiderata

Here are the goals for this project:

  • Persistent session
    • My work session should not be stopped by disconnections and reconnections
  • Should be able to run the usual (or generic) Linux apps without much fuss

Yeah so basically I want a Linux desktop, without necessarily bringing my laptop with me. File access is not a problem, I have ways to get data synced across systems.

Ingredients

The ingredients for this will be:

  • A Fedora 38 Linux system.
    • I'm experimenting on an Intel NUC, I guess any system will do (even virtual machines)
    • A normal desktop installation is the starting point.
  • xrdp & tigervnc
    • xrdp is probably optional
    • I remember using xrdp with a windows "server" and getting audio too, that would be cool to get
  • xfce
    • most likely any other environment would work -- but i like xfce

Quick notes

Quick notes here, to improve later.

The following packages are needed:

  • xrdp
  • xorgxrdp
  • tigervnc / tigervnc-server

Configuration:

  • define a display number for your user
    • add something like :2=username to /etc/tigervnc/vncserver.users
  • enable the vnc server service for that display number
    • systemctl enable vncserver@:2
  • define a vnc password for that user
    • (running as the user "username"): vncpasswd
  • set a session name (and maybe the preferred geometry) in /etc/tigervnc/vncserver-config-defaults
  • Set autorun=Xvnc in /etc/xrdp/xrdp.ini
  • Set port=5902 for the Xvnc session type in /etc/xrdp/xrdp.ini

Some early experience report

So I've got some early comments about two aspects:

  • Latency & usability when using this setup (both at home in the same network and remotely from the office through a vpn)
  • Usage with an external display connected through an USB-C to DisplayPort adapter

Latency and usability

Before i write further, I must clarify that my typical usage does not involve 3d stuff and latency-sensitive applications.

I mostly do email and web browsing (reading articles, home banking, watching youtube videos and stuff) and the usual hobby development/sysadmin stuff (linux shell, emacs, compilers & interpreters and stuff like that).

Also, my iPad does not have the newer M1/M2 processor.

In this sense, this setup has been surprisingly usable. Image quality is okay and lag is very acceptable.

Annoyances

There are some annoyances, mostly due to Apple being Apple:

  • Function keys just don't work: F1-F12 are ignored on the ipad and there seems to be no way of using them. The RDP client I'm using does seem to offer an on-screen keyboard that can show all function keys and do the usual combos (Alt-F3 for example, etc). It'd be nice if Apple just let us use our keyboards. I'm using a bluetooth keyboard that lacks nothing in particular so it's mildly annoying.
    • I guess this will get more annoying as I use this setup more and more
  • Some random keyboard combination don't work
    • random example: CTRL-backspace to delete a whole word.
    • shift+end (to select until the end of the line) doesn't seem to work either
  • Mouse scrolling is inverted and there seems to be no way of fixing that.
    • i was able to fix that by enabling inverted scrolling in the xfce settings.
    • i should probably also lower the scroll speed
  • On the ipad I'm currently using, that doesn't have the M1 cpu, multi tasking does not seem to be a possibility. Either you're in the remote desktop, or you're doing something else. Maybe this does get better with new M-series processors from Apple?

Niceties

I'm using the RDP client from Microsoft, and it's very good.

  • The on-screen keyboard can be shown with touching a button on the display and seem to have all the necessary keys (including function keys) and is capable of doing keyboard combination (eg: ALT+F3)
  • The display works as a touch screen, meaning i can move the pointer on the remote desktop with my finger, do a single click with a single tap on the ipad display and a double click with a double tap on the ipad display. Right click on the remote desktop is implemented via two-fingers tap on the ipad display.
    • Seems like i can use the whole ipad as a 10 inches touchpad?
  • When connected to an external display, the remote desktop is shown only on the external display but the ipad display shows the aforementioned tools (on-screen keyboard, mostly) and keeps working as a touchpad
  • it seems it's possible to do scrolling (eg: in web pages) using two fingers
  • when no keyboard and mouse are detected, the client will offer the full on-screen keyboard (which includes the qwerty keyboard besides just the function keys)
    • i've typed this and the above line using that keyboard and while not the most comfortable of the setups, it's okay-ish: i can type without looking much at the keyboard but inserting non-letters is not ergonomic at all.
    • essentially it's usable as a last resort
  • battery life is nice

Bringing this further: open questions

I wonder what's the limit here.

  • If i get a cellular-enabled iPad, could I get remote access to my linux desktop from anywhere?
  • can i get remote audio (in and out) to work?
  • Would it start making sense to consider having my desktop in a public cloud?
    • pros:
      • better connectivity and bandwith
      • could scale instance type up or down when i need it
    • cons
      • cost of the instance
        • can it be lowered via long term commitment ?
        • when compared to a laptop, does it make financial sense?
          • (spoiler: no because second hand laptops are cheap and the ipad alone is not)
      • need to cook something to shut down the instance and bring it back up when i need it
      • not sure i could do all the kind of network traffic i usually do
  • when using it connected to an external display, how good/usable is the on-screen keyboard?
    • if i know i'll have a display available, can i not bring the keyboard with me?
      • results of a brief test: the keyboard is barely okay but usable
    • can i get away without a bluetooth mouse?
      • results of a brief test: yes, if you have patience (not a lot, but quite a bit, and it takes some getting used to)
  • how good usable is the remote desktop with the ipad alone, without external display, mouse and keyboard?
    • the keyboard is barely okay but usable
    • the mouse is usable via the display acting as a touchpad
    • the on-screen keyboard will cover contents of the remote display, so you might end up not seeing what you type
    • as soon as you connect either a keyboard or a bluetooth mouse, the full qwerty keyboard is gone
  • how much bandwidth does this setup consume?
    • that is... given a daily p50/p99 how much bandwidth i'd day on a daily basis in a mobile data plan if i wanted to live off the ipad alone as a mobile device ?

Sneak peek

How it appears, practically...
How it appears, practically...


To be continued :)

Further notes, a few months in

Some additional notes:

  • by manually building and installing https://github.com/neutrinolabs/pipewire-module-xrdp I can get the following things working:
    • audio out forwarded from the remote host and played on the ipad
    • audio in from the ipad to the linux system
  • I can also mount an ipad folders on the remote linux system, could be useful to move files easily
  • I had no luck with forwarding the ipad webcam, not sure if that's even supported