Thursday, May 26, 2016

Linux remote desktop woes

I've often tried to get a remote-desktop solution to work on Linux as smoothly as remote desktop works on Windows, but this has long been an area where Linux simply isn't up to the task.

To clarify things, by "remote-desktop solution" I mean connecting to a remote Linux workstation for the purposes of being able to work e.g. from home. There are of course other use-cases which have other requirements and possibilities.

There are lots of articles online which cover the topic of "best remote desktop solutions on Linux", so go ahead and google it.

Requirements? Well, I have a few:
  • Cross-platform on the client side. I want the flexibility of using any OS to connect.
  • It has to use a encrypted connection.
  • It has to be able to connect to the physical desktop, i.e. the same screen as is displayed on the monitor physically connected to the machine.
  • Performance. It needs to be "fast enough", which is a very subjective measure.
  • When connecting to the remote Linux machine, the client should automatically resize the remote (physical) screen to the native size of the client's screen. The remote Linux machine will often have multiple monitors, but the client will typically not.
  • I should be able to connect to the machine and login using the same credentials as when I'm at the machine.
When I say that "Linux is simply not up to the task", I mean that there is no standard way included in all Linux distributions which fulfills my requirements out-of-the-box. Yes, there are a number of different solutions (e.g. ssh tunnels), but none of them qualify for "out-of-the-box".

NoMachine is a novel concept where your physical desktop is streamed as a compressed video-stream, as opposed to sending logical drawing operations and compressed bitmaps as e.g. VNC does. (Disclaimer: this is the impression I got when using NoMachine, but I may be wrong). Despite claims of being blazingly fast, I wasn't impressed with the performance, at least not when I compare it with RDP on Windows. Also, it never was able to resize the remote screen despite claims to have support for that.

I've made several attempts at getting x11vnc to work, but I've always given up due to bad performance and that it requires many manual steps to get everything working. However, I recently gave it another try and actually managed to get something which almost was acceptable:
  • Starting the server as "x11vnc -find -nopw" makes it automatically find my physical desktop even when logging in remotely via ssh.
  • Setting up a putty ssh tunnel is of course annoying, but with a Typically my brain goes like this: "Hm, I need to work from home today. I'd like to work on my Linux laptop, but I left it at work.
    little fiddling you can automate almost all of it.
  • Performance-wise it was better than I remember it. Maybe this is due to improved broadband connection at home.
  • Using "xrandr -s 1920x1080" (on the remote machine, after connecting) successfully managed to resize the screen to the client's native resolution. Not exactly "automatic", but better than nothing. Also, it is really annoying that I need to manually reconfigure my monitors when I get back to work.
So now I have two options for working from home. One is to fiddle around with x11vnc, putty, and xrandr in order to be able to work in a nice and friendly Linux environment. Or two, connect quickly and directly to my Windows machine at work and suffer the torment of having to work on Windows.

Actually, there is a third choice. Bring my laptop home with me, but since I don't have VPN access on my Linux machine, that means I'm limited to offline development. Which of course sometimes can mean improved productivity.

    No comments: