[FreeNX-kNX] Printing to Windows client from FreeNX server session

Fabian Franz FabianFranz at gmx.de
Fri Nov 9 22:16:02 UTC 2007


> Hello,
> 
> More info on this issue. This is what I get when I try a smbclient in  
> the FreeNX server.
> 
> Receiving SMB: Server stopped responding
> session request to 127.0.0.1 failed (Call returned zero bytes (EOF))
> Receiving SMB: Server stopped responding
> session request to 127 failed (Call returned zero bytes (EOF))
> Receiving SMB: Server stopped responding
> session request to *SMBSERVER failed (Call returned zero bytes (EOF))

This is what happens exactly when a SMB request (smbclient) is made to a CIFS resource. (port 445 on Windows)

Samba distinguishes internally between SMB and CIFS via a hardcoded port==445.

I had started negotiations with Samba, but forgot about the issue again - oops.

You can set SAMBA_MOUNT_SHARE_PROTOCOL=smbfs and open up the 139 port on Windows XP (SP2 or later). (0.7.1)

Then it should work again.

For all other cases (CIFS) we have two possibilites:

- Fork off samba or use the smbprint from NoMachine.com, which can be given a cifs or smb parameter.

- Use my old work to have a userspace port redirection from 445 to whatever port we use in that session for samba, which should hopefully work.

In the long term I would prefer a change in smbprint of course, but for the short term version the hack could be working.

It would go like that:

- Compile and copy the library from http://svn.berlios.de/svnroot/repos/freenx/nx-utils/nxredir/ to e.g. /usr/NX/lib/libnxredir.so.0

- Configure exporting of NXSESSIONID

- Create /usr/lib/cups/backend/nxsmb as follows:

#!/bin/sh

NXSAMBA_PORT=$(cat "$HOME/.nx/C-$NXSESSIONID/scripts/mport")
export NXSAMBA_PORT

DEVICE_URI=$(echo "$DEVICE_URI" | sed "s/:$NXSAMBA_PORT/:445/")
export DEVICE_URI

LD_PRELOAD="/usr/NX/lib/libnxredir.so.0 $LD_PRELOAD"
export LD_PRELOAD

# invoke the program with the args given
exec /usr/lib/cups/backend/smb "$@"

- Make it executable:

$ chmod a+x /usr/lib/cups/backend/nxsmb

- Change nxnode to add printers with backend nxsmb instead of smb

Then samba _should_ use CIFS. You can of course also play around yourself via using the above commands with the redir command.

This way evcn smb:// should work in konqueror (started after the library was preloaded) and besides it being a hack I wonder why I haven't yet added it as an optional service directly.

cu

Fabian



More information about the FreeNX-kNX mailing list