Rian's Really Good Technoblog!

NX: Great Thing or The Greatest Thing

by rian on Nov.03, 2009, under Infrastructure, Remote Access

If you’re like me and have more than one machine to worry about, you’ve no doubt tried to remotely access one from the other.  There are times when you just can keep getting up to go over to the other machine just to enter some command or see how something’s running.  Then there are times when one machine is in a colocation closet in San Francisco, and you’re living in, say, Japan, like I was.  Or maybe your mom can’t get the 12:00 to stop blinking on her VCR (and she still has a VCR), and now she’d like you to figure out why “the Internet is broken.”

RDP, VNC, ABC…

Well, if you’re lucky, you can use something like the Windows Remote Desktop (RDP), which, generally speaking, can give pretty good results if you’ve got a nice fast connection with very low latency.  You might also have access to something like PCAnywhere, GoToMyPC, or some other proprietary solution.  Likewise, they’re able to be optimized to get pretty reasonable results.

If you’re unlucky, you’re managing a Linux box, and the best that you could hope for was VNC.  I’m not sure what I’m missing about VNC, but it has generally sucked.  I mean, it’s great that it works at all, but I’ve tried Tight, Ultra, Vine, etc., and they’re all laggy and clunky.  It’s one of those things where it’s just annoying enough that I throw up my hands and go all command line on their asses.

That’s fine too, but the truth is, my ADD likes to have twenty things going at once, and it’s just very nice to have a desktop that lets me run process, file, or resource monitors and terminals for one machine on one and all those things for another machine on a separate one.  VNC lets me do it, but the performance, particularly over a sub-optimal connection, is not spectacular– unusably so often.

And The Angels Descended from Heaven…

Some time ago, I read about NX.  This was one of those cases where I noticed the mention of something one day, and the next day it was everywhere.  I had no clue what it was, and, frankly, I was too set in my ways to check it out.  Finally, about a year or so ago, I decided to look into it.  It turned out that it was a remote access system that was something between VNC and remote X-Windows.  Finally, I pulled down NoMachine’s “Free Forever” Linux edition and installed it on my servers at the colo and the client on my Mac laptop.

Yoiks! Before too long, I was running a desktop over a long-distance net connection (on top of a VPN, to boot), and it performed like I was sitting in front of it– with the obvious exception of any kind of large graphics or video, there’s only so much you can do to compress graphics.  But my monitors and terminals reacted to my input almost instantaneously.  This was a huge step forward for me and anyone involved in the remote administration of Linux boxen.

I haven’t even touched the NX network facilities that allow for nodes to be defined, to distribute applications between those nodes, and then to nest them together on the client, but I use it constantly in the most basic remote desktop configuration. I hope to delve into those additional features to configure myself some aggregated remote desktops for different networks (assuming I understand those features correctly).

How It Works: Taking X Back to Its Roots

NX works by re-discovering the original nature of X-Windows.  X was developed as a network-based protocol.  It’s far less integrally tied to the operating system than, say, Windows.  The operating system runs the apps and outputs to an “X server”, a separate application responsible for rendering that output.  Usually, that X server is running on the same machine, and it appears to simply be a desktop environment no different than a Mac or Windows.  But, by changing the display variable, X can output to any arbitrary X server, whether it’s local or across the world.  The X server does the heavy lifting of drawing the output to whatever machine it’s on.

The problem is that X doesn’t do a very good job dealing with the world as it is.  It doesn’t handle compression of the, sometimes fat, data stream.  It doesn’t adapt to different bandwidths.  It isn’t very smart about “differential” analysis of the action on screen (i.e., only include in the data stream that which has changed on the screen and leave the rest.)

NX does all that and does it amazingly well.  I have to color-code my desktops so that I can tell them apart on my Linux workstation– my daily use desktop.  I rarely have that problem with RDP or VNC.  It’s pretty obvious that that’s what you’re looking at in those cases since you usually have to cut display parameters so far back that the display looks like a bad 1990 animated GIF.  With NX, the display looks nearly identical to my local display.  All without much impact at all on my local resources.

OK, Now I Start Whining

Of course, NX isn’t perfect.  I had some trouble getting my headless servers setup to work with it without causing a mad avalanche of installation to get Gnome or KDE working, but XFCE was quick to install and works great.  Like most things Whateverix, there’s a fairly high noodle factor to get it optimally set up, but thus far, on Fedora, Ubuntu, and Debian distros, it’s worked nearly flawlessly.  And that includes clients for Windows and Mac.

There aren’t too many things you can say that about.  I’ve become quite accustomed to things just not working quite right– most anyone who had the misfortune to install Ubuntu’s Jaunty release with, let’s say, an ATI graphics card can likely attest to that.  Mine installed to a black screen, required the installation of pre-release drivers from an unsupported repository, filled my logs with propeller-headed nonsense about BARs and MMIOs, and just generally was a turd.  But that’s another story…

My point is that NX, for me at least, has been one of those almost entirely pleasant, worthwhile experiences that has definitely made my work easier and more pleasant.  Imagine that.

Commercial Vs. Open Source

Now, there’s NX and there’s NX… ever a fan of open source, I tried to install FreeNX rather than the commercial version from NoMachine.  Sadly, it was immediately apparent that there’s some internal squabble about libraries (I’m running 64-bit Linux) or Something-Else-I-Don’t-Care-About, and it simply wouldn’t install correctly.

Faced with a perfectly functional (and free, as in beer) version from NoMachine, I wasn’t about to spend yet another day trying to decode the passive-aggressive oneupmanship that can be open source “support” (‘RTFM n00b!’).  Now, I should say that I think open source is the cat’s pajamas.  I contribute money when I can’t contribute time, but there is a tendency in the community to think that most users or low-level kernel driver engineers.  I’m not.  I’m just a big doofus who likes the stuff.  Honestly, I’m pretty far down the geek path, but one can only dedicate so much time to getting their tools to work.  Ya know?

Give It a Shot

So, if you’re someone who wants to remotely access a Linux box, and you’ve been dissatisfied with your options so far, give NX a whirl.  You’ll need to download the Client, Node, and Server packages for the server.  The client requires only that package.  Install those guys and (at least in my case) little or no server-side configuration was needed.  It just worked “right out of the box”.  Poke around and check out the options. They also claim to support Citrix, RDP, and VNC, though, again, I haven’t had the inclination nor time to check those out yet.

It’s secure (runs over SSH), relatively easy to setup (at least by Linux standards), and free for Linux.  Do it.  You can thank me later.

:, , , , ,

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...