Remote Desktop in a browser


Walter Wang has a collection of remote desktop products at http://www.remotespark.com/. His RDP client for Android is, in my view, easily the best of a wide crop of such tools. But his greatest tool is the Spark Gateway. The gateway presents a remote desktop in a browser. No need for anything to be installed. The restriction is that it works by painting on an HTML5 <canvas/> element which means the browser you use must support HTML 5 and Web Sockets. Chrome certainly works but HTML 5 support across browsers is inconsistent at the moment. For example Spark Gateway can work when used from the iPad browser but not when used from the Android Honeycomb browser.

Spark Gateway

The first thing to note is that the Spark Gateway is just that – a gateway. The browser doesn’t connect directly to an RDP server – how could it as RDP is binary protocol and web sockets only supports text? Instead the browser connects to a service which *does* create and connect to an RDP session. The connection to the service from the browser is via a web sockets connection – which means that web socket support by the browser is critical. The Spark Gateway translates RDP to a proprietary text protocol which is transmitted over web sockets and rendered by JavaScript.

The gateway is implemented using Java and runs bound to a configurable port. The script to start and stop the daemon could do with improving. So here’s my version of a script so the xrdp daemon can respond to status|start|stop|restart and force reload service commands. Before the script can be used, the variables at the top of the script may need to be changed.

The gateway is not without its problems which I’m sure will be resolved over time. Probably the the most constraining one for me is that any one gateway supports a licenced number of web connections. I have 9 servers and remote desktops so I cannot have a Windows open for each with a single gateway installation. The solution is to have a gateway on each remote machine which is a little cumbersome and may present problems mapping drives (to be tested).

Remote Desktop and Linux

A remote desktop server is built into Windows but not Linux. However there’s a great open source project called xrdp which makes an X11 desktop support the RDP protocol. I followed the installation instructions and it “just worked”. Now I’m able to access desktops from Microsoft’s Remote Desktop client, from Walter Wang’s Android RDP implementation and via the Spark Gateway. Fantastic. This allows me to access all Windows server and Linux desktops using one client per platform.

The small gripe I have about xrdp is that it does not come with an adequate init.d script for Ubuntu/Debian. So here’s my version of a script so the xrdp daemon can respond to status|start|stop|restart and force reload service commands. Before the script can be used, the variables at the top of the script may need to be changed.

Spark Gateway and Linux

Being written in Java the Spark Gateway works perfectly well on Linux. The small thing to watch out for is that Java applications don’t normally run as a service. Java applications might run under Tomcat or JBoss, etc. However this adds considerable complexity to the installation so the Gateway runs as a service on Windows or a Daemon on Linux by using the Apache project commons-daemon. On Linux common-daemon is jsvc.exe. While the use of Java does not require any compilation, the common-daemon project does. Compiling the common-daemon project is not intrinsically difficult but it does use JNI. So when compiling jsvc the compiler needs to be able to include jni.h from the JDK (thats JDK not JRE). I found that the java home directory is not the same location as the JDK which lead to compile errors. To work around the problem the commons-daemon configuration step had to be run using the –with-java flag and using it to reference the JDK root directory.

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Be the first to leave a comment!