Posted
by
Unknown Lamer
on Wednesday April 03, 2013 @07:51AM
from the thought-no-one-used-that-feature dept.

New submitter Skrapion writes "One month ago, an independent developer submitted patches to the Wayland's Weston compositor which adds support for FreeRDP, an open-source remote desktop protocol. Now, after six revisions, the remote desktop code has been merged into the trunk. While remote desktop has been prototyped in Weston once before by Wayland developer Kristian Høgsberg, this is the first time Wayland/Weston has officially supported the feature. For a summary of why we can expect Wayland's remote desktop to surpass X.Org's network transparency, see Daniel Stone's excellent talk from Linux.conf.au."

For the past 10 years I have been repeatedly lambasted for complaining that RDP and ICA were superior to X11 transparency and VNC with seemingly nothing being done to address the issue. Naturally, this made me a clueless troll. Blah, blah blah.

Even better... watch the full video and you'll note that any version of X that isn't in a museum does not actually implement network transparency anymore (instead it's more of a network fallback to a less-capable graphics display).

You're misinterpreting... I was agreeing with you about X fanboys who always cry about "network transparency" when X hasn't been network transparent for years & years. Any modern X server is just shooting bitmaps over a network link in a less efficient manner than RDP.

I think what the poster was referring to is that client-side rendering is now the norm. This has brought us nice fonts and compositing, among other things. So yes, most X11 apps are just sending bitmaps to the server. No longer are modern X-based applications asking the server to render text and buttons and shapes for it. Yes this does decrease remote performance. And modern toolkits like GTK do require a lot of server round trips, which makes things hard to deal with over a high-latency link.

I remember running Xemacs over a modem and it ran great remotely, since it was mostly just asking the server to draw in its behalf. Worked very well, but compared to modern apps, was very ugly.

I think what the poster was referring to is that client-side rendering is now the norm.

Partly. Fonts are rendered client side, but can be composited server side just fine. Since X can cache bitmaps, a well written client will send the glyphs to the server as bitmaps, then send a list of bitmap IDs to composite. After the initial data dump it can go very fast.

And modern toolkits like GTK do require a lot of server round trips, which makes things hard to deal with over a high-latency link.

Exactly - xedit, xclac, xvim, all work great over the slowest link you will find in use anywhere. The trouble is the world has moved on. I am not sure sending bit-maps ( regardless of how clever your scheme of sending just the changed parts, compress etc is ), is the right way to go but the fact is the X11 programs most people are using most of the time these days don't get the benefits of X11 server side rendering features.

Sending bit-maps be it X11 doing it, RDP, or VNC is certainly the simplest thing to

And if an X application running on the client system is doing that, then, IMHO, the blame lies with the developer of the application and not X11.

So what you're saying is that X11 isn't network transparent, at least from the perspective of developers. And the example of inefficiency that you provided (drawing bitmaps) is something that all modern GUIs do extensively today. Your defense of X11 seems to be out of touch with the reality of modern GUI development. This is precisely why the people that actual

No. What he's saying is that X11 is still perfectly network transparent, but that the clients are using the protocol in a manner that only works well over very high bandwidth, very low latency links, like a local socket. The only time network transparency goes away is when you're using extensions like SHM or DRM, which typically means you're doing things like video playback, games, or other intensive rendering; tasks which will never function well over slow, laggy links.

What he's saying is that X11 is still perfectly network transparent, but that the clients are using the protocol in a manner that only works well over very high bandwidth, very low latency links, like a local socket.

So if you want your app to be reasonably usable over connections slower than LANs, you need to design your app in a very specific manner. That doesn't sound unreasonable, but it also doesn't sound transparent, which was my original point.

I think you have misunderstood the intent of the original post. The poster was not saying that X doesn't work over a network - as you have pointed out, anyone can easily prove that X technically works over a network. The point was that the efficiency of "network transparency" in X is no longer a reality. That is because the intent of X was that a request could be made to render a primitive, such as text, by providing a few parameters over X (networked or local) about the text that should be rendered and

1. As I told another poster, Network Forwarding != Network Transparency. You know how modern X servers operate over a network? By pushing a bunch of bitmaps in a less-efficient manner than RDP. I really don't care if some dusty design document from 1985 says otherwise, you're irrational wishes don't create a new reality. Unless you are a real fossil, I was probably doing X forwarding before you even new what Linux was, and I know much much more about its limitations than you do.2. If you're calling me a li

ou know how modern X servers operate over a network? By pushing a bunch of bitmaps

First yo umean xclients. And no, the cliend can still upload nice glyph bitmaps and then composite them using the bitmap IDs instead of using the old font mechanism, meaning the expensive bitmaps are sent once, not once per use.

This is excellent news and has changed my mind regarding Wayland. A successor to X11 really needs good remote control functionality, but it doesn't have to be done the way X11 did it. I now look forward to a future with Wayland.

The way X11 does forwarding is very handy and useful, and I make use of it fairly often. But as usual, there's more than one proverbial way to skin the proverbial cat.

X11 forwarding is great for high speed and low latency connections such as a lan. Using it on anything else is asking for trouble, because if you lose your connection, you lose your app. Perhaps an improvement can be made to X11 forwarding in the new path forward (wayland) to make it more like screen where you can attach and detach to a running X11 app from a networked endpoint.

Remote desktop using RDP is superior to X11 forwarding for lossy connections because once the screen is loaded, very minimal draw/drag/etc communications are sent between the server and client for updates, X11 is far more data intensive for screen updates. And of course if you lose your connection (which I frequently do, trying to RDP from my cell phone), you'll get your apps back when you reconnect.

Having both X11 forwarding and RDP is a great choice, and I hope something similar to my aforementioned improvement makes it into the app.

You already have multiple incompatible remote rendering back ends in X, it's just really hard to do in X. The reason the Unix mantra "do one thing well" is so important is because it allows you to swap out parts and innovate more easily.

What do you think X itself is? Pulseaudio is a sound server, allowing multiple sound sources to be multiplexed in software against one or more sound outputs, for outputs without the capability to perform hardware multiplexing. Xorg is a display server, allowing multiple image sources to be multiplexed in software against one or more display outputs. If you want to get really specific, you can reference the AIGLX extension for allowing the same thing to be done for OpenGL applications.

Using it on anything else is asking for trouble, because if you lose your connection, you lose your app. Perhaps an improvement can be made to X11 forwarding in the new path forward (wayland) to make it more like screen where you can attach and detach to a running X11 app from a networked endpoint.

I used NX for X11 over VPN. It works very well and I am able to resume where I left off if my VPN connection drops or I want to let something run overnight but don't want to remain online. NoMachine closed source their server at version 4.0, but FreeNX and Neatx took its place.

The problem is that the current implementation is effectively VNC done using the RDP protocol. That is it is just sending the changed areas of the screen. What is needed is something more like x11rdp. That is an X11 server that rather than talking to hardware spits out RDP protocol instead. Draw a rectangle on the X11 screen and the corresponding RDP gets spat down the line to the client. It is much much faster than VNC which is a total dog over slow links, rather like X11 being a total dog on links that don't have really low latency.

For the next 100 posts whining about how this isn't exactly like forwarding an Xterm over an SSH tunnel (think about how stupid that is for a second)... X IS NOT NETWORK TRANSPARENT

What? That a lie! 1985 sez X is network transparent!Well guess what: Modern versions of X are *not* network transparent anymore because to use any of the modern features of X that make using a modern Linux desktop even remotely enjoyable, you are breaking the classic backwards server-client paradigm of X. Sure, there's still a fallback mode for transferring data over networks, but lots and lots of modern features that you expect in a modern desktop GUI break in the process, which is *not* transparency, but is instead more of a network fallback.

Frankly, having tried to use both X and RDP over real connections using the real Internet, I'd take RDP any day of the week. I still remember the finger-pointing amongst developers of different projects when I pointed out that packets were being sent over the network each and every time my cursor blinked. Get over it guys, 1985 wasn't the be-all end-all pinnacle of graphics development.

Still don't believe me? How about clicking the link to Dan's talk about X where he says the exact same thing I just said. He's only been working on X development for over 10 years though, so I'm sure that some guy who sorta got X forwarding working over a gigabit link is much much more informed that he is....

In terms of "network transparent", what is meant is that a program doesn't care (it just communicates with whatever DISPLAY is set to) and the end user doesn't care. What the server does behind the scenes is irrelevant to how it's used.

If on Wayland, while you're in an SSH session to a remote machine you think..."hmm, I could really do with a couple of wterms" (or whatever the Wayland xterm equivalent is), or "I could really do with firing up wireshark", you can't just type "xterm" and be done then it's not network transparent to the user. If you then have to set up another session and do some desktop-style login (and the remote server has to be running some sort of GUI login manager or equivalent to handle it) then it's a lot less useful than what you get with X11 at the moment.

If on the other hand Wayland will allow the equivalent of ssh -X, then it doesn't matter how it's implemented, so long as the program running at the other end runs and doesn't care that the display is remote, and the user sees a window on their screen, then they have the functional equivalent however it's implemented.

``... you are breaking the classic backwards server-client paradigm of X.''

I found it hard to take much of your argument seriously when you wrote the above. "Client-server" does not mean "PC client running Windows-Windows server. The Wintel crowd pretty much co-opted the term "client-server" and when they encounter a case where "server" doesn't mean a Windows server, they go nuts.

Well it looks like you self-censored my post by not bothering to read past the first couple of lines and also censored an X developer who agrees with me and not you. So, aside from admitting that you are obscene, please list your evidence and credentials for why you are right and a guy who has been deeply involved in developing X for over 10 years is stupid....

The very fact that FreeNX exists is absolute proof that X has fundamental issues and you have admitted that those issues exist and that another layer of complexity needs to be added around X is a direct admission that X isn't cutting it!

You also lied in your original post when you said you forward over X and therefore X is transparent.

1. No you don't forward over X, you use a much more convoluted FreeNX setup.

2. Forwarding != Transparency. If you think it does, then FreeRDP is also network transparent! Mode

NX is just a proxy. I use X forwarding in conjuction with NX, it follows that I use X forwarding. There is nothing disingenuous about that. You might as well complain that I'm not using HTTP because I have a caching proxy.

I do agree that X forwarding is not perfect as it is, but it can be fixed by building NX into X, or into SSH, instead of throwing away the entire display system.

"Network transparent" means you can look at the bits over the wire and tell what it's doing. You can't do this with X nowadays, because nowadays it sends whole frame buffers instead of individual drawing commands. It's network opaque. Yes, X supports remoting, but it's not network transparent anymore.

The Wayland devs were definitely a little too obscure whenever the issue of remoting came up. They kept saying that remoting was out of scope with regard to Wayland, and technically, they were right, but it lead to a lot of misunderstandings.

Imagine if somebody asked "Does the Linux kernel support email?" Of course it doesn't; email is done way higher in the stack. There's not a single line of code in the Linux kernel that has anything to do with email. But you would be giving people the wrong impression if you said "Linux doesn't support email", and that's exactly what the Wayland devs were doing.

X11 remoting is much more powerful than many people imagine. Like you say, it allows remote applications to display their icons in the local system tray. It also allows remote connections to communicate with locally-running apps. For example (and sometimes this behavior is not what I want!), running firefox on a remote machine will first check to see if there's an existing firefox instance on the X server running, and communicate with it to open the url. So on the remote machi

That's a large gap in X, where audio is consider just completely unrelated to the remoting...

That's a curious gap--espacially now. X11 is capable of forwarding pretty much arbitrary data. One could quite easily imagine a deamon which ships pulseaudio data over X11.

Or, alternatively, I assume that you could forward the pulseaudio port over ssh while you do X forwarding as well. I don't see why that wouldn't work. Of course you'd have to make sure that programs attempt to connect to the right pulse daemon.

There are still a lot of remote desktop use cases where lack of sound support is pretty much irrelevant. Actually, I would go further and say that sound on a remote desktop is more likely than not COMPLETELY IRRELEVANT.

Most use cases that call for sound support stretch the abilities of ANY remote desktop implementation.

No, the clients on the remote machine will be talking to a different Wayland server, one that only sends RDP to a remote display.

Yes there is special code running on the remote machine, but even X forwarding requires xlib and the code that translates a socket connection to actual network packets to be running on the remote machine. And modern programs require freetype and cairo and libpng and lots of other code that you think of as "GUI" running on the remo

sounds like a nice improvement. as long as:* The interface is still the same. i.e. i ssh -X in to a machine, start a graphical program (evince or whatever), and it displays locally. I dont want to have to configure stuff, or start some additional server on the remote machine.* It works in mixed environments. I might be running wayland on my laptop next year. but some of the machines i log into a currently on Scientific Linux 5. I guess RHEL 7 will still be X11 based and i would not make bets about RHEL8.

Aside from one major security vulnerability (Microsoft Security Bulletin MS12-020), RDP has been rock solid and secure. But perhaps most interesting is that it performs the best. I've tried just about all the major remote desktop protocols out there. VNC, LogMeIn, WebEx, GoToMyPC, TeamViewer. None of them compare to RDP in terms of responsiveness and ability to hold up under excessive gateway saturation of an ISP connection.

Hi, I am Marc-Andre Moreau, founder and leader of the FreeRDP project. I was not directly involved with the FreeRDP Wayland backend.
First, definitely take this backend as a first step. There is a *lot* more than can be done in the future, and I can tell you it has the potential to make your best dreams come true in terms of remote desktop.
Here is a screencast I took about a month ago showing FreeRDP on Linux connecting to Windows 8 with RemoteFX, playing videos with sound smoothly:
http://www.youtube.com/watch?v=JUF8xPKBQJM [youtube.com]
Even if this is impressive at this point, it is just a fraction of what we're going after in the future. RemoteFX was introduced in RDP 7.1, and is what FreeRDP implements. It basically encodes everything on-the-fly for fast encoding on the server and fast decoding on the client. This means the videos played in that remote desktop session I've recorded are re-encoded to RemoteFX, they are not sent as H264. RDP also provides a functionality allowing the redirection of the compressed video stream for local decoding and playback, but from experience RemoteFX provides a better user experience.
RDP may be a protocol designed by Microsoft, it is part of the Microsoft Open Specifications. The long term goal of the project is not to make it a "FreeRDP to Microsoft" technology, but really to make it a "FreeRDP to FreeRDP" technology, where high quality clients and servers will be available for all platforms in existence. Like it or not, RDP is an extremely powerful protocol that has all the potential necessary to compete with leading commercially-supported alternatives, except that this one is open specification and open source with FreeRDP. We are also considering the possibility of defining our own community extensions to the RDP protocol to fill in the gaps left by Microsoft.
We currently have clients on Linux, Windows, Mac OS X, Android and iOS. We have servers (still in their early stage) on Linux, Windows, Mac OS X and now Wayland. All of this is available under the Apache license.
One common mistake about RDP is to compare only in terms of the core feature set, which is graphics remoting and input. RDP provides support for disk redirection, audio input and output redirection, multimedia redirection, smartcard redirection, printer redirection, usb device redirection, multitouch input, serial & parallel device redirection, etc. It has a very rich set of security features which we work very hard on supporting well (Network Level Authentication, TS Gateway, etc). As for graphics remoting, it is very elaborate in the RDP protocol, and it just keeps getting better with newer versions of the protocol.
The next step for us is to jump on RDP8 support, which will bring many new features such as a progressive graphics codec, dynamic adaptation based on changing network conditions, a high performance codec for anti-aliased fonts, support for multitransport (TCP + UDP), enhanced support for WAN and higher-latency/low bandwith environments, etc. All of this can be brought to all platforms with the FreeRDP project, for the benefit of all.
Brace yourselves, FreeRDP is coming.

THAT IS USELESS! You didn't show forwarded Xterms using the exact same perfect protocol that was cool in 1985! Your system is obviously bloated and inefficient compared to X11 and a complete waste of time!!/sarcasm

Much more seriously, thank you very much for your hard work and for pushing forward with implementing this technology in an open & cross-platform way. The video is fantastic!

Presumably RDP can handle rootless windows. VNC does not have that option at this moment. That means that RDP will work much like xforwarding and be usable over ssh, whereas with VNC you need to start a VNC-session and click around on the desktop to start programs.

RDP on windows at least outperforms VNC by a wide margin both on fast and slow network connections.

It should -- VNC is doing screen scraping. RDP is hooked in deep into the GDI and can see the underlying API calls. (Technically speaking, VNC could do the same thing, but doesn't.) Its a lot closer to how remote X works than VNC.

VNC is a rather inefficient protocol. It basically works by sending periodic screenshots of the host system to the remote one, whereas RDP sends just enough information to the other end to render the screen on its own. Basically it is just a hell of a lot more efficient on bandwidth and CPU usage.

Which makes the results more surprising. You should see some of the stuff that Keith Packard has spewed about X, especially the stuff about strings and atoms. He's basically set up very nice straw man to attack, but that is really all.

I'm always curious about this attitude: how does being a developer make you an expert on something. Does someone who builds a highrise know everything about the building once it's full of people using it? How does that logic work?

``Because I use X forwarding all the damn time. Mind you only on the LAN.''

I've used it on LANs. I've used it across my crummy IDSL link. And I've even used it on dial-up. Only when using very graphics intensive applications on dial-up did I find the performance awful (and, fortunately, I only needed to resort to dial-up during those rare times that the VPN access was down). Caveat: I'm not trying to play games via X11 connections which may be why it works well for me and so badly for the folks who are in favor of Wayland.

I find it amusing that some people are touting how wonderful the implementation of RDP is on Windows 2008 server. I need to access remote UNIX systems, not Windows servers. Those of us that use UNIX (almost exclusively or as exclusively as I can pull off) don't want something that is useful only for Win2008 Server systems. How will an RDP plug-in for Wayland accommodate UNIX/Linux desktops connecting to UNIX/Linux servers? Oh... I guess the people running UNIX servers will have to install a non-native layer to allow the Wayland folks access. That's just nuts.

(Personal opinion time: It seems there is a group of Linux developers who grew up developing for Windows and won't be happy until they've turned Linux into the Windows they would have liked to have seen. Too bad they never used UNIX/Linux as they were developing their programming skills.)

This depends on your method of X forwarding. NX does a pretty good job and isn't slow and is less "buggy" (well, you can't do GLX, but trying to do that via a VPN would be...evil...)- along with handling pretty low bandwidth links well.

Having said this, if RDP does a good enough job and Wayland untangles the whole POSIX desktop world, I'd say it's pretty much a win- esp. if I can do the RDP remoting over moderately low bandwidth links.

A few things :
- Microsoft RDP clients are pre-installed on every Windows based client since Windows XP/Server 2003. This means that a majority of non-slashdot-reading admins have all the tools they need to connect to it already installed.
- Microsoft RDP is a lot faster than VNC/X11 forwarding. For one, they do smart bitmap-caching. VNC is screen-shots only (using some sensing of what has changed on the screen to send the diffs), and X11 forwarding were pretty much just UI elements, which made interacting with certain applications difficult or ackward.
- Later RDP versions allow you to forward just specific applications, in addition to the entire workspace. I don't know if FreeRDP supports this feature yet, but it is built into the protocol.

Not all that familiar with the innards of RDP myself, but the obvious difference is that a bitmap may or may not be visible on the screen, only partially visible, or repeatedly visible. This would allow parts of the bitmap that are currently not on the screen to be sent once to the client and reused over and over again, allowing smoother screen draws and less bandwidth/latency on incremental changes.

Essentially, the client can request a bitmap representation of an element, or the native UI component. For example, common UI components are sent as UIElements and SkinParts. SkinParts can be sent as vector items (like gradients, lines, etc), or bitmaps themselves. So, for example if you run calc.exe, the client can request the app as a stack of UI elements (essentially, how the GDI plans on drawing the components to the screen). All the buttons, etc. are sent as a component package which describes how the element should look. If it uses a bitmap as a part of its chrome, it is sent as a separate SkinPart.

You can also get bitmap representations of components if the OS thinks it is too difficult to draw them (or the developer just threw a bunch of bitmaps together to represent common UI components). When this happens, calls into the GDI update the RDP server to let it know that a component of size X/Y at X/Y has updated. It's a lot smarter than VNC which has to watch the screen and updates the screen in a 1/x method.

X11 is a bit more primitive... It expects the UI components to be created and skinned by the client. This is really only useful/consistent if both the client and the server are running the same WM. Users of RDP get the same experience regardless of their client.

Caching the way a button looks, the way your titlebar looks, possibly down to each letter on the screen.,All these are stored Client-side by the Server's request, so instead of sending a 24bpp bitmap of the word "cat" (a few kb), it references a previous: "c.jpg, a.jpg, t.jpg" (which is only a few bytes). It also caches whole windows so a window move isn't expensive.

If you use a window manager and applications that use X primitives rather then drawing everything in bitmapped eyecandy the performance is much faster than RDP. All the anti X forwarding folks have never used the system as it was originally intended which is why we have to see it reinvented again... badly.

no, RDP forwards all the bits that have changed - now simpler versions of it will happily forward everything (eg VNC at least in early incarnations, and Microsoft's own RDP protocol) but Citrix did a load of work reducing the amount of screen that was transferred over the network. Microsoft since took that and built it into the kernel (or graphics bits that are in the kernel) so that it became even more optimised - after all, if the OS only redraws a small section, only that section needs to be transferred.

I have KVM installed on a server, I use virt-manager to play with it. I forward X over SSH to run virt-manager and have it display on my local machine. The server has no graphical output. You can feel free to substitute any program with a graphical output you like for virt-manager in my example.

For one, the programming language should naturally support the notion of doing stuff in a non-blocking way (C/C++ does not naturally support this; simulating this requires working with threads or tinkering with even more low-level machinery).

You what?

Unix has offered non blocking calls more or less since forever, and C was basically invented in order to write unix.

read() can operate in non blocking mode just fine. You might want to check the man pages for read() and select().

Sorry, but select() doesn't cut it. Using select, you are forced to write ugly event-driven code, with objects representing event-handlers, where all you want to do is run a bunch of snippets of code, where each of them executes as soon as the data is available.

And by the way, using select() you can't even wait for both a file descriptor and a semaphore simultaneously, but that is a different story.

Using select, you are forced to write ugly event-driven code, with objects representing event-handlers, where all you want to do is run a bunch of snippets of code, where each of them executes as soon as the data is available

How is it ugly? You can do what you want in a few lines of code with a base class, select and a std::unordered_map. With a small amount of care, you can also store a lambda in the derived class, meaning that you have a map of file descriptors to literally code snippits that get run on d

Sorry, but I want expressiveness without seeing all the ugly low-level stuff.

To go back to the original topic, Wayland needs to remove round-trip times to make the system faster and more responsive.How can a compiler decide to move code from the client to the server or vice versa if all the plumb-work gets in the way?

While Wayland may solve some mundane issues with the client-server nature of remote desktops, I think in general a completely different programming model is needed for client-server applications. For one, the programming language should naturally support the notion of doing stuff in a non-blocking way (C/C++ does not naturally support this; simulating this requires working with threads or tinkering with even more low-level machinery).

I expect we'll see more posts like this now that so many states have decriminalized weed.

What video did you watch? Was it made within the last few months? You do realize (if the video is covering Weston) that Weston is not only new but also a reference implementation and not intended for production use, right?

This has not a goddamn thing to do with why "Linux on the desktop has failed."