Setting up NX Server in OpenSuse(XFCE) 12.2

Hi guys,

I am using OpenSuse 12.2 with XFCE desktop environment.

I have installed the freenx from repositories and tried to start the nxserver with the command nxserver --start.After executing the command it says it has started but immediately when I check with --status command it shows nxserver is stopped.

Can anyone give me the link or post the procedure on HOW TO INSTALL AND CONFIGURE NXSERVER.

I have followed numerous but none of them are working to me.

Thanks in advance.

On 01/12/2013 05:26 PM, nishanth9042 wrote:
>
> Hi guys,
>
> I am using OpenSuse 12.2 with XFCE desktop environment.
>
> I have installed the freenx from repositories and tried to start the
> nxserver with the command nxserver --start.After executing the command
> it says it has started but immediately when I check with --status
> command it shows nxserver is stopped.
>
> Can anyone give me the link or post the procedure on HOW TO INSTALL AND
> CONFIGURE NXSERVER.
>
> I have followed numerous but none of them are working to me.
>
> Thanks in advance.
>
>

To my knowledge there is no working freenx server for 12.2… not yet anyhow.
My solution was to go back to 12.1.

You need to read and follow one of these Article guides I would suggest.

Setting up NX server (part I: FreeNX): https://forums.opensuse.org/content/125-setting-up-nx-server-part-i-freenx.html

Setting up NX server (part II: NoMachine NX): https://forums.opensuse.org/content/126-setting-up-nx-server-part-ii-nomachine-nx.html

Thank You,

I remember that Gnome and probably XFCE didn’t work until I added -norender to the AGENT_EXTRA_OPTIONS_X. It indeed affected 12.2 and not 12.1 and Gnome or Xfce but not KDE. But the bug has been fixed in the latest NX agent, which is available in my repo

# zypper info NX

Information for package NX:

Repository: PTA
Name: NX
**Version: 3.5.0-121.1**
Arch: x86_64
Vendor: obs://build.opensuse.org/home:please_try_again
Installed: Yes
Status: up-to-date
Installed Size: 9.0 MiB
Summary: Proxy System for X11
Description: 
NX provides a proxy system for the X Window System.


You need this version of the NX agent. Then it works with or without -norender, in Gnome and Xfce sessions.

Notice that if you install FreeNX from my repo with freenx-setup, you should be able to open a XFCE session directly by choosing “CDE” as desktop in NoMachine client, thanks to this change in /usr/bin/nxloadconfig


# grep "^COMMAND_START_CDE=" /usr/bin/nxloadconfig
COMMAND_START_CDE=**startlxde**

It’s a “goodie” :wink:

What is your repository URL and what I need to install from your repository.

Just follow the links James posted earlier. Replace 12.1 with 12.2 in the URL given in this article (I wrote these 2 articles).

If you search the forum, you will also find threads where this issue has been discussed. I also thought it was broken until somebody gave me the solution. Later, I received a bug report mentionning that the bug had been fixed in the latest NX agent released by NoMachine. Thus I updated the package and it solved the problem (at least that particular one).

These are the steps I have followed to install Free NX from please_try_again repository.

1.I have added Please_try_again repository through zypper
2.I have installed Free NX package from this repository
3.Executed this command

             #freenx-setup

which took the default settings.

4.Finally I tried to start nxserver with this command

             #nxserver --start

and while checking the status of the nxserver it shows nxserver is stopped.

I guess you’re almost done.

Try these commands:

# **systemctl status freenx-server.service**
freenx-server.service - FreeNX Server
          Loaded: loaded (/lib/systemd/system/freenx-server.service; enabled)
          Active:** inactive (dead)** since Sun, 13 Jan 2013 06:48:39 -0800; 4s ago
         Process: 29724 ExecStopPost=/usr/bin/nxserver --cleanup (code=exited, status=1/FAILURE)
         Process: 29672 ExecStop=/usr/bin/nxserver --stop (code=exited, status=0/SUCCESS)
         Process: 1415 ExecStart=/usr/bin/nxserver --start (code=exited, status=0/SUCCESS)
         Process: 965 ExecStartPre=/usr/bin/nxserver --cleanup (code=exited, status=1/FAILURE)
         Process: 941 ExecStartPre=/usr/bin/freenx-server-check-setup.sh (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/freenx-server.service

# **systemctl start freenx-server.service**

# **systemctl status freenx-server.service**
freenx-server.service - FreeNX Server
          Loaded: loaded (/lib/systemd/system/freenx-server.service; enabled)
          Active: **active (exited)** since Sun, 13 Jan 2013 06:49:07 -0800; 5s ago
         Process: 29724 ExecStopPost=/usr/bin/nxserver --cleanup (code=exited, status=1/FAILURE)
         Process: 29672 ExecStop=/usr/bin/nxserver --stop (code=exited, status=0/SUCCESS)
         Process: 29927 ExecStart=/usr/bin/nxserver --start (code=exited, status=0/SUCCESS)
         Process: 29873 ExecStartPre=/usr/bin/nxserver --cleanup (code=exited, status=1/FAILURE)
         Process: 29870 ExecStartPre=/usr/bin/freenx-server-check-setup.sh (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/freenx-server.service


**# /usr/bin/nxsetup --test**

----> Testing your nxserver configuration ...
Warning: Invalid value "NX_LOGFILE=/var/log/nxserver.log"
         No logfile will be kept.

  Warnings occured during config check.
  To enable these features please correct the configuration file.

<---- done

----> Testing your nxserver connection ...
**HELLO NXSERVER **- Version 3.2.0-73 OS (GPL, using backend: 3.5.0)
<--- done

**# find /var/lib/nxserver/home/.ssh -ls**
426486    4 drwx------   2 nx       root         4096 Jan 13 06:49 /var/lib/nxserver/home/.ssh
426498    4 -rw-r--r--   1 nx       root          979 Nov 22 15:06 /var/lib/nxserver/home/.ssh/known_hosts
393850    4 -rw-------   2 nx       root          675 Oct 24 17:16 **/var/lib/nxserver/home/.ssh/authorized_keys**
393850    4 -rw-------   2 nx       root          675 Oct 24 17:16 /**var/lib/nxserver/home/.ssh/authorized_keys2**
407757    4 -rw-------   1 nx       root          601 Oct 24 17:16 /var/lib/nxserver/home/.ssh/server.id_dsa.pub.key
426488    4 -rw-------   1 nx       root          668 Oct 24 17:16 /var/lib/nxserver/home/.ssh/client.id_dsa.key

the output of /usr/bin/nxsetup —test is

----> Testing your nxserver configuration …
Error: Invalid value “NX_HOME_DIR=/var/lib/nxserver/home”
Warning: “/usr/lib/cups/backend/nxipp” is not executable.
Users will not be able to enable printing.
Warning: “/usr/lib/cups/backend/smb” is not executable.
Users will not be able to enable printing.
Warning: Invalid value “COMMAND_START_KDE=startkde”
Users will not be able to request a KDE session.
Warning: Invalid value “COMMAND_START_GNOME=gnome-session”
Users will not be able to request a Gnome session.
Warning: Invalid value “COMMAND_SMBMOUNT=/sbin/mount.cifs”. You’ll not be able to use SAMBA.

Errors occured during config check.
Please correct the configuration file.

Also could not find home in /var/lib/nxserver

Only the error is relevant. And that you don’t have a warning about invalid COMMAND_START_CDE shows me that you used freenx-setup indeed. :wink:

I’m not sure why you don’h have /var/lib/nxserver/home, since it is nx user’s home directory. This user should have been created as well as his home directory.

# grep nx /etc/passwd
nx:x:126:126::**/var/lib/nxserver/home**:/usr/bin/nxserver

If you don’t have an nx user or his home directory is invalid, the nx server is not going to work for sure.
I don’t know what you have done before. Did you try to install another port of FreeNX or NoMachine NX (which ‘nx’ user has another home directory) ? Or didn’t you execute freenx-setup as root?

First thing to do is to check if you have an nx user already. If so, I would delete this user and run freenx-setup again. Try this first and see if you got the nx user created!
If it doesn’t help, I would uninstall FreeNX (you don’t need to uninstall the NX agent) and clear the directory /etc/nxserver (as well as /var/lib/nxserver if it exists), then install FreeNX again using YaST or zypper (but from my repo) and run freenx-setup again.

yeah I have deleted and then re installed freenx but didn’t work.

OUTPUT of freenx-setup is

  • allowing AuthorizeKeysFile2 back
    Setting up /etc/nxserver …done
    Generating public/private dsa key pair.
    Your identification has been saved in /etc/nxserver/users.id_dsa.
    Your public key has been saved in /etc/nxserver/users.id_dsa.pub.
    The key fingerprint is:
    31:e1:6e:fe:57:f9:99:04:a6:3e:9c:b8:43:33:f5:7e root@linux.site
    The key’s randomart image is:
    ±- DSA 1024]----+
    | . |
    | . . |
    | + |
    | . o . o |
    | S . + … |
    | o + . .o. |
    | o * o…o|
    | + =… E.|
    | .+… . |
    ±----------------+
    Setting up /var/lib/nxserver/db …done
    Setting up /var/log/nxserver.log …done
    Setting up special user “nx” …
  • writing AGENT_EXTRA_OPTIONS_X (fixes Gnome crash)

And does

 /usr/bin/nxsetup ---test

give the same output as before?
It looks like you have an nx user now.

Please post the output of:

# grep nx /etc/passwd

and

# find /var/lib/nxserver/home -ls

both commands as root.

OUTPUT of /usr/bin/nxsetup --test is

----> Testing your nxserver configuration …
Error: Invalid value “NX_HOME_DIR=/var/lib/nxserver/home”
Warning: “/usr/lib/cups/backend/nxipp” is not executable.
Users will not be able to enable printing.
Warning: “/usr/lib/cups/backend/smb” is not executable.
Users will not be able to enable printing.
Warning: Invalid value “COMMAND_START_KDE=startkde”
Users will not be able to request a KDE session.
Warning: Invalid value “COMMAND_START_GNOME=gnome-session”
Users will not be able to request a Gnome session.
Warning: Invalid value “COMMAND_START_CDE=startlxde”
Users will not be able to request a CDE session.
Warning: Invalid value “COMMAND_SMBMOUNT=/sbin/mount.cifs”. You’ll not be able to use SAMBA.
/usr/bin/nxloadconfig: line 595: strings: command not found
Warning: Invalid cupsd version of “/usr/sbin/cupsd”. Need version 1.[2345].
Users will not be able to enable printing.
/usr/bin/nxloadconfig: line 624: strings: command not found
Error: Could not find 1.5.0 or 2.[01].0 or 3.[012345].0 version string in nxagent. NX 1.5.0 or 2.[01].0 or 3.[012345].0 backend is needed for this version of FreeNX.

Errors occured during config check.
Please correct the configuration file.

linux:~/Desktop # grep nx /etc/passwd
nx:x:102:1000::/var/lib/nxserver/home:/usr/bin/nxserver

and

linux:~/Desktop # find /var/lib/nxserver/home -ls
find: `/var/lib/nxserver/home’: No such file or directory

The explanation is obvious now. You have an nx user, but his home directory has not been created.
The reason is that this nx user has not been deleted but his home directory was by the function createnxuser (which actually does not create the nx user but deletes his home directory). I agree that it sounds weird, but see the comment in the script:

function createnxuser {
# Running nxsetup with existing nx user doesn't work on openSUSE
# Thus we only use this function to delete the nx user yet.
#if (! $GROUPMOD nx 2>/dev/null) ; then
#	echo "- creating nx group"
#	setnxgid $NXGID ; groupadd -g $NXGID nx
#fi
#setnxuid $NXUID
#echo "- creating nx user"
rm -f $nxetc/{users,passwords}* /var/log/nxserver.log
rm -fr $nxhome $nxsess 
# useradd -r -c "$nxfing" -d $nxhome -s $nxssh -u $NXUID -g $NXGID nx
# mkdir -m 755 $nxsess
# mkdir -m 700 -p $nxssh $nxsess/{closed,failed,running}
# chown -R nx $nxhome $nxsess 
}


Before running freenx-setup again, you have to delete the nx user manually with:

# userdel nx

When it doesn’t work the first time, it’s kind of tricky.

Also I assume that you ran freenx-setup as root? Did you? You have to run everything as root as this point.

You might have a look at this post: FREENX - PTA Repos - Unable to connect

Yes I have deleted the user nx and then tried to run freenx-setup but the same problem occured.I am running all these commands as root.

Then nxsetup is not able to write to /var/lib and create the nx user home directory on your system. I don’t know why.
At the end, freenx-setup (my script) just executes nxsetup (included in FreeNX package) by running this:

if  "$NXSETUP" ] ; then
	case $os in
	ubuntu|linuxmint)  "$sshkeys" ] || $nxkeygen ;;
	archlinux|mandrivalinux)  "$sshkeys" ] && nxsetup --install $sshkeys ;;
	*)
		id nx &>/dev/null && createnxuser
		**nxsetup --install $sshkeys**
	;;
	esac

	printf "
"
	 "$CUSTOMNODE" ] && patchnode || extraopts
	 -f /usr/lib/cups/backend/ipp ] && chmod 755 /usr/lib/cups/backend/ipp
	 -f $skey ] && createNXsession
fi

This command (in red) should create the nx user and its home directory /var/lib/nxserver.
I don’t know why it failed to create this directory. But this is the reason why the nx server doesn’t work for you.

:\

You could add a line (in blue) in the script to echo the command. It will tell us at least if this command is going to be executed.

if  "$NXSETUP" ] ; then
	case $os in
	ubuntu|linuxmint)  "$sshkeys" ] || $nxkeygen ;;
	archlinux|mandrivalinux)  "$sshkeys" ] && nxsetup --install $sshkeys ;;
	*)
		id nx &>/dev/null && createnxuser
		**echo nxsetup --install $sshkeys**
		**nxsetup --install $sshkeys**
	;;
	esac

	printf "
"
	 "$CUSTOMNODE" ] && patchnode || extraopts
	 -f /usr/lib/cups/backend/ipp ] && chmod 755 /usr/lib/cups/backend/ipp
	 -f $skey ] && createNXsession
fi

Either something is missing earlier and this command doesn’t get executed, or it is executed but nxsetup doesn’t create /var/lib/nxserver.
But if I didn’t introduce a new bug in the script last time I updated it (which is of course always a possibility), something may be different on your system. I don’t get it yet.