In my quest to remotely access my work PC I’ve tried 2 solutions. xpra and x2go. Why not VNC or NX, or teamviewer (urgh)? Well these 2 provide something others don’t. They embed remote application windows to your current system seamlessly. Just like X forwarding but better in terms of performance. Actually they leverage the underlying X system but optimize the data transfer. I don’t know much about details though. I want to quickly talk about my experience with both of them.
Winswitch / xpra
First I discovered xpra. It’s great. You start remote applications inside an xpra session with this command:
xpra start :7 --start=firefox
“:7” is a display number you can chose, I’m not sure now, but if you don’t specify the number it gives you one automatically.
In the remote system, to connect to the above started application you run:
xpra attach ssh:user@remotepc:7
Yes, xpra can work over ssh. You can use TCP/IP as well. But assuming you have already configured ssh above command will just work and will be secure.
One caveat of xpra is that, you cannot connect to the already running applications. You have to start the application inside an xpra session.
One thing I love is that you can start and connect to a remote application with one command:
xpra start ssh:user@remotepc --start=firefox
Xpra has a lot of options and features that I won’t try to describe here. But before I get to the x2go I have to talk about Winswitch.
Winswitch is a GUI application, that uses xpra under the hood for systems running X. For my purposes it provides a GUI interface to the xpra. By GUI interface what I mean is a system try menu. But it’s extensive and intuitive to use. Once you setup a connection to a remote device (winswitch must be installed and winswitch_server running), you can start applications with ease.
Winswitch also makes it easy to share and swap remote applications from different PCs. You can see which PC is connected to which sessions (remote application). You don’t have to stop your session. Once you try to connect from other device, current session is ended and remote application window moves to the other application.
Winswitch/xpra combo was exactly what I was looking for. Only thing missing is ability to connect to the already running applications. But my work PC doesn’t have a monitor, so I always connect remotely. It’s also possible to always run applications inside a winswitch session and connect to them via winswitch, on your local PC. So that you can later on connect remotely. This way you don’t have to quit and restart your applications, you can continue working seamlessly.
Except performance. That’s why I went looking for an alternative and found x2go.
x2go is an alternative to the winswitch. I don’t know if it’s possible to use from command line directly like xpra is used. It provides a very similar set of features and interface to the Winswitch/xpra combination. It’s limitations are similar. You can’t connect to an already running application, you have to start it as an x2go session. (When you start an application via X2GO it also appears on main desktop, but I’m not sure this is the actual behavior or was a bug.) It also, works over ssh. Its usable interface is also a menu. This menu provides a mean to start applications on the remote device similar to Winswitch does. But it doesn’t give you an idea of who is already connected, or it doesn’t provide detailed information about running sessions, such as statistics.
X2GO has some minor integration problems. Menus and tooltips appear on the wrong place and even on the wrong monitor! I also have occasional problems with keyboard layout switching.
Comparison of Winswitch/xpra and x2go
In short, they are very similar. They provide similar feature sets and similar interface. I liked Winswitch interface more. Although its somewhat more cluttered I found it more intuitive. X2go client has a similar menu interface but I found its initial connection window confusing at first. But to be honest, both of these applications are supposed to stay out of sight so their interface isn’t much importance.
And we come to the performance. Winswitch/Xpra provides a reasonable performance on LAN operation. I’ve only tried Emacs (GUI) and firefox. I haven’t tried heavy operation like video watching. It’s usable. Typing in editor isn’t as snappy as I want but its usable. Average latency (reported by winswitch itself) is 250ms. Some might call this barely usable. Especially for LAN operation. Also you get occasional blurring. By the way xpra provides various encoding options, I’ve tried all of them. I couldn’t improve the performance.
X2go on the other hand is another story. It’s just great on LAN operation. You can barely notice any latency. I could easily fool passerbys that this is an application running locally. It’s just great and exactly what I’m looking for.
For WAN operation my scenario was a little bit excessive. I was at home (in Turkey) connecting to my office which is like 20km distance, but over a VPN connection to US East Coast. Yeah. Almost a round trip around the world. But my aim was to compare two options anyway. So, Winswitch/xpra is still bad. It is so bad, it’s practically unusable. It’s just garbage. I can barely type before window freezes and it disconnects eventually. x2go on the other hand was much better compared to xpra, it was barely usable. I think latency was close to 1 second. But I can see myself using it for short tasks. And if I was in US connecting to Turkey I don’t think it would be this bad, which is a more probable scenario. Update: I’ve tested X2GO with direct connection to my office from home, it was pretty good I would say. Latency is noticed but it’s very usable.
By the way, one thing that annoyed me was initial connection latency of both applications. For some reason they are both bad. Somehow xpra is faster to connect but x2go takes 4-5 seconds even on LAN operation before the remote window appears. In WAN case, xpra was still connecting somewhat earlier than x2go which took more than 10-15 seconds to connect.
I think I will stick to the x2go for the moment. But I will follow the improvements to the xpra, because I like Winswitchs interface more.
3 responses to “A quick comparison of XPRA and X2GO”
[…] my many googlings I came across a blog post of Hasan Yavuz Özderya, who made a comparison of XPRA and X2Go. It was the first time I heard of […]
“By the way, one thing that annoyed me was initial connection latency of both applications. For some reason they are both bad.”
Yeah, it’s X protocol — since X’s network protocol was designed assuming LAN, like 1 to maybe 10ms latency, there are many many back-and-forth messages on X application startup… by many I mean 100s to 1000s of round trips. I’m sure x2go and xpra both address this but they are after all compressing and optimizing X, so they’re likely cutting 100s of round trips down to dozens.