Posted by George Wright
Wed, 30 Jan 2008 06:41:00 GMT
I’ve finally got a package ready for Mac OS X to use. I’ve been working on 10.4.11, so it’s untested on Leopard, but it works just fine over here. Bugs include the actual QtNX window freezing if anything goes wrong and other random breakages.
The package is fairly nifty - the user interface is a statically linked Qt binary and has barely any dependencies. In the qtnx.app directory is all the NX stuff you need - nxauth, nxssh, nxproxy etc, as well as the default key to login with and many other things. The client does not need to be installed and should just run from inside the dmg image!
The only requirement is that you have X11 from Apple installed, as the client calls “open -a X11” in order to get an X server to use, as packaging X11 seems to be beyond the scope of this, especially given that Apple have made X11 more integral to OS X since the release of Leopard.

QtNX on OS X - Working!
For those of you who want to try it out, I’ve uploaded a zip of the DMG image here (6.8MB, md5sum is eaca6a99b72206554b419bff7a0a1dd1).
As usual, comments are most welcome via email.
Posted in NX | 6 comments
Posted by George Wright
Sun, 27 Jan 2008 22:36:00 GMT
A picture says a thousand words:

QtNX on Windows
OK, so I cheated a little and this is actually using the Cygwin packaged XWin server, but it’s a significant step. Now I just need to write a few functions to invoke NXWin.exe and setup the relevant Xauthority file, then it should be pretty much finished!
Posted in NX | 5 comments
Posted by George Wright
Sun, 27 Jan 2008 00:08:00 GMT
Edit
These instructions have been confirmed not to work. While they may allow NXWin to compile, the buildsystem fails with lots of linker errors… Still scratching my head about how to fix this, but for now I’ve contacted NoMachine about it.
It turns out NXWin isn’t set to compile by default on Cygwin. Anyway, I finally managed to get it to compile inside the nx-X11 tree with a little patching to the source code, and I figured I’d better blog about it for anyone else who is interested in this, and also so that in the inevitable outcome where I forget how I did it, I can fall back on this blog.
First off, you need to edit config/cf/host.def and set the following:
#define NXWinServer YES
#define XWinServer YES
The XWinServer define is probably not needed, but as this machine’s quite a slow compiler I’m not going to change it and see, as contrary to popular belief I don’t like sitting around watching stuff compile.
However, the real fun starts when trying to compile NXWin itself. Turns out it’s broken - I have no idea why, or even how NoMachine themselves compile it, but I had to patch a few lines in various files before it would compile.
The following are the changes I made in programs/Xserver/hw/nxwin:
NXwindow.c:3537
Line should be:
pWin = SaveSetWindow(client->saveSet[j]);
NXdispatch.c:228-229
Lines should be:
volatile char dispatchException = 0;
volatile char isItTimeToYield;
NXdispatch.c:871
Line should be:
result = AlterSaveSetForChildren(client, pWin, stuff->mode, FALSE, TRUE);
NXevent.c:215
Comment out the struct for HotSpot
winmsg.h:74
Comment out the enum for MessageType
You can then just go ahead and compile with make World.
Most of the inspiration for these little patches were taken from the dix/ server.
This, obviously, isn’t ideal, but there’s a dire lack of any documentation for NX on Windows. I know that NoMachine use Cygwin to compile their stuff, but it all seems very hacky (which, to be honest, is the general impression I get of Cygwin) and unpolished.
If anybody who actually knows how to build the NX packages on Windows is reading this, if they could contact me and let me know what the preferred method of compiling NX’s open source components is I’d be most grateful.
Posted in NX | 1 comment
Posted by George Wright
Mon, 21 Jan 2008 21:22:00 GMT
So in the process of learning about cygwin/mingw/qt in order to port qtnx to Windows, I concluded that the easiest way would be to compile nxcl using cygwin (which, luckily, compiled with no changes at all), and then to compile Qt inside cygwin and then compile qtnx inside cygwin, linking to both Qt and nxcl.
Turns out getting Qt 4 to compile inside cygwin is a non-trivial task. Thankfully, however, the LyX guys have done most of the work. It just needed a minor alteration to the source, though, otherwise a linker error occurred during compilation of Qt/Win 4.3.3.
In src/corelib/codecs/qtextcodec.cpp, there is an #ifdef block starting on line 528. You just need to add
&& !defined(Q_CYGWIN_WIN)
to stop the Asian codecs from being compiled in; there’s probably a better solution to this, but I don’t see this as being particularly problematic. After that you can follow the instructions in the LyX wiki and link to Qt just fine.
From this you can probably tell that I now have QtNX compiling inside cygwin on Windows. Well, yes, it works, but I haven’t yet tested whether it will actually connect to any servers. Theoretically, it should so long as I set the PATH properly to point to the directory where nxssh and nxproxy are, and hopefully all should just work fine! I may need to append “.exe” to the binary names in nxcl though, but all in all I think it should be fairly trivial from now on (so long as nxproxy behaves as expected and doesn’t start making annoying noises about X11 and Win32).

Gratuitous QtNX on Windows screenshot
Posted in Computing, NX | 6 comments
Posted by George Wright
Tue, 08 Jan 2008 07:41:00 GMT
I must say that I’m very impressed with Trolltech’s attention to detail for their cross platform work; qtnx compiled (almost) without a hitch on OS X. After hacking around a few build system problems and linking issues, I managed to get qtnx to compile and link (it took ~5 minutes!), producing this particularly nice result:

QtNX on 10.4.11 (Intel)
I’m having a bit of trouble with working out how to create a sensible buildsystem for the Mac. If anyone’s got any experience with qmake on OS X then please drop me a line; in particular, I’m looking out for ways in which qmake can define what platform I’m on so I can have #ifdef’d sections of code for each platform, as well as using things like pkg-config on platforms where it exists and whatever equivalent there is on OS X. In fact, hooking qmake into Xcode for this could be ideal.
I haven’t tested if this actually connects yet; I haven’t got round to compiling the open source NoMachine dependencies (nxproxy, nxssh, nxcompsh) but it shouldn’t be too hard to get it all working nicely (I hope!).
Posted in NX | 8 comments
Posted by George Wright
Fri, 04 Jan 2008 15:39:00 GMT
Today I start working for DeFuturo Ltd on creating a cross platform NX client (GPL, of course) in Qt for their Desktop on Demand service. I must say I’m really happy to be working again on C++/Qt as GTK was starting to get to my head a bit!
The ultimate goal of this project is to create a cross-platform client which can execute directly after downloading without the need to install it anywhere. However, at the moment I’m simply working on getting an open source client working for Linux, OS X and Windows.
Yesterday I committed a version of QtNX that I’ve been hacking for the past couple of days which has now had its backend code updated to use Seb James’ nxcl client library instead of my ageing nxclientlib. I have confirmed that this works with nxproxy 3.1.0 and nxssh 3.1.0 for connecting to a NX 1.5.0 server, and I assume it works with NX 2.x and 3.x servers as well, but I don’t have access to any for testing at the moment. I will be working over the coming weeks on getting this to work with OS X and cygwin on Windows, as well as hopefully doing some code cleanups at the same time.
All in all, I’m very pleased with this work and this should lead to some very nice and exciting changes in the NX client world!
Posted in KDE, NX | 4 comments