Log in

No account? Create an account
04 March 2009 @ 10:21 am
No Machine Wrapper for XFCE/Fluxbox or whatever  
I have been wondering about this, and I finally got it to work, thanks so some tips from multiple sites.

The No Machine (NX) client allows you to choose between five types of UNIX desktop sessions: KDE, GNOME, CDE, XDM and "custom." In the first four cases the session startup is invoked via the normal route (like "startkde") and the NoMachine X server is destroyed when the session exits. In the case of a custom session, however, NoMachine doesn't know when your program has finished (it may have put itself in the background) so the X server stays running and you have to terminate the NoMachine session manually.

Make a wrapper script, save it as /usr/NX/bin/nxwrapper, and then make it executable (chmod 755). The script:
# Script origianlly found here:
# http://iain.cx/nx/nxwrapper.html

nxnode=$(ps -o ppid= -p $PPID)
nxagent=$(pgrep -P $nxnode -u $USER -x nxagent)
exec kill $nxagent

This should take care of killing the X server after your session is completed.

To start an XFCE session, for example, you would use nxwrapper xfce4-session as the command to run. From the wizard, select "custom," then "Settings..." Check "Run the following command," and enter in /usr/NX/bin/nxwrapper /usr/bin/xfce4-session (or whatever the path is for your desktop GUI, flux box would be /usr/bin/startfluxbox). Then select "New Virtual desktop" and Save.

(Anonymous) on February 20th, 2010 06:30 pm (UTC)
Worked for my XBMC 9.11 linux box
I wanted to use fluxbox on NX to do maintenance on my media Linux box.

Thanks this worked great.

(Anonymous) on February 18th, 2011 09:52 pm (UTC)
fluxbox bad
All I can say is thank god for this page. However fluxbox and xdm don't work as there is a disconnect / terminate bug. Just about any other WM works I think. I use openbox with tint2 and wmdrawer in the upper right. Just use /usr/bin/openbox-session and you're good. Also disable direct draw in advanced setting for multiple monitors on windows or else refresh bug. Tested on debian squeeze stable with windows xp 64 client.