Forum / NoMachine for Linux / Confusing results trying headless VPS setup with Centos6, xfce
- This topic has 10 replies, 3 voices, and was last updated 8 years, 9 months ago by kroy.
-
AuthorPosts
-
March 15, 2016 at 12:27 #10557mifagParticipant
Hi,
I’ve been trying to setup NX using new deployed Centos6 VPS. So basically trying to connect from my Windows Workstation to Linux VPS using xfce GUI.
I decided to go with NX after seeing some opinions on how NX is more secure(or could be made so)/functional than VNC.
So here’s what I’ve done:
0. Deployed new Centos 6 x64 VPS. It comes with command line only. I’m working under new sudoer user account (not root so sudo for everything)
1. Installed group “X Window System” “Xfce” using yum
2. Installed xorg-x11-server-Xvfb package using yum
3. Downloaded and installed NoMachine 5.1.9_6_x86_64.rpm
had no noticeable errors during this.
4. Downloaded and installed NoMachine 5.1.9_7.exe for my Windows workstation
5. Typed in VPS ip from Windows NoMachine client
6. Something seems to show up…wait…it’s some xfce default background and nothing else.
7. found https://www.nomachine.com/AR10K00710
Started following RHEL directions.
No errors while doing so…also I noticed nxnode was actually disabled previously, now enabled
8. Trying again…
Same thing. I can’t do anything. no login screen (well I’m logged in already I suppose) and no way I can interact there except that my mouse pointer is moving.
9. (now) I’m stuck.
% I don’t know whether this is noteworthy, but I made ~/.xsession with following content before step 5:
#!/bin/sh
exec /usr/bin/startxfce4
Any suggestions as to how I can proceed from here to bring up full xfce environment?
My goal here is to allow everything as-is in terminal environment (and ssh), only bringing up xfce (hopefully automatically) whenever I access using NoMachine client.
I hope I’m not wrong to assume this can be achieved.
Thanks.
March 15, 2016 at 15:47 #10566kroyContributorHi.
6. Something seems to show up…it’s some xfce default background and nothing else.
This is the default xfce session. You can change desktop command in NoMachine configuration. Find DefaultDesktopCommand in /usr/NX/etc/node.cfg and change value to /usr/bin/startxfce4. Line should look like this:
DefaultDesktopCommand “/usr/bin/startxfce4”
7. found https://www.nomachine.com/AR10K00710
Article was tested on CentOS 6 and it should work fine (maybe permissions nohup.out were denied for your user, thats why there was black screen). In Step 6 you should just change command to this:
DISPLAY=:0 nohup /usr/bin/startxfce4 &
March 16, 2016 at 09:33 #10579mifagParticipantYou are amazing!!
I can now actually see desktop environment. As I was posting, I was worried that NoMachine may just not support non-major package like xfce and the problem may be impossible to solve. My VPS was such low-end(<1gb ram, <20gb ssd) that the choice was either xfce or lxde, and the latter is unsupported for centos. Yet thanks to you I don’t have to abandon my current setup.
Just one more thing; do you know how to automate this initial setup for each reboot?
After reboot, I currently have to
1) ssh log on to remote server
2) AUTHFILE=$HOME/Xvfb-0.auth
3) Xvfb :0 -auth $AUTHFILE -screen 0 1024x768x24 &
4) DISPLAY=:0 nohup /usr/bin/startxfce4 &
5) sudo /usr/NX/bin/nxserver –restart
before I can use NoMachine from local workstation to see the gui environment. Failure to do so will only give me “Cannot find the default environment…” message window with the previously mentioned background.
What’s bugging me is 1) and 5) part…my putting these lines under .bashrc will still force me to log on ssh each time and especially enter password for 5) sudo part.
How would you automate this so that occasional/accidental reboot will not require reconfiguration?
Thanks.
March 16, 2016 at 12:35 #10582kroyContributorThe easiest way to create the desktop in your case is to create a new one with NoMachine option. After reboot just connect to the host with NoMachine. There should show: “Cannot detect any display running. Do you want NoMachine to create a new display and proceed to connect to the desktop?”, choose yes and it will create xfce session (make sure that DefaultDesktopCommand in /usr/NX/etc/node.cfg has value /usr/bin/startxfce4). Thats all.
Of course you can use mentioned by you commands (points 2, 3 and 4) to the system startup script, but remember that using an old cookie it is not recommended for host security.
March 22, 2016 at 09:09 #10635mifagParticipanthmm? I don’t know why but the reply I made last Thursday or so seem vanished? I think I saw the post was waiting moderation though. I guess I’ll just have to write up another if it can’t be recovered.
March 22, 2016 at 09:11 #10640BritgirlKeymasterThere are no further comments awaiting moderation from you. I double checked to make sure. That last one in the thread was from Kroy (above) and now the new one from you today.
March 23, 2016 at 08:10 #10654mifagParticipantOh, my bad then. I wrote something last week because I had trouble closing/relaunching the session but apparently I must have exited the browser without ever actually submitting it. Let me write it up again.
Thank you @troy I now reconfigured my vps using centos 7 using same procedure (I was ready to go back to version 6 if 7 gave me errors). Apparently installing nx and editing DefaultDesktopCommand in /usr/NX/etc/node.cfg were the only two things I needed to do for nx configuration. Very simple!
Now that I can connect to xfce session by creating window, however, I noticed unexpected behavior when exiting the session. So for example let’s first say I opened a new nx connection via new display option and do my work. I finish my work and then I want to close the GUI session by logout. It executes logout, but then I’m presented with black, blank screen instead of gracious exit of NX session. If I exit anyway and reconnect later, I’m faced with same black blank screen with top left corner briefly notifying my nx logon. I’m not asked to create new display, too. To fix this I had to kill some processes on ssh terminal. Note that I can disconnect while my xfce session is on and reconnect to see same session without a problem. The problem is when I wanted to close the xfce session(and thereby x windows processes altogether) by logout.
Am I not supposed to log out GUI session when using NX? I just wanted to unload GUI processes from memory when I’m finished using xfce session via NX.
If you have any suggestions for tweaking more config parameters or for the way I tried logout to fix this behavior, I’ll be happy to learn.
Thanks.
March 24, 2016 at 13:42 #10688kroyContributorWe reproduced the problem in our lab. We will take a closer look at it.
As a temporary workaround you can use command:
sudo /usr/NX/bin/nxserver –restart
instead of logging out.
March 25, 2016 at 08:55 #10701mifagParticipantGlad to hear you’ll be working on it. Please give update on the issue in this thread; I’ll keep a check on regularly.
For the command, do you mean I should type it in to terminal inside nx/xfce session or in a separate ssh session? If you meant inside nx/xfce session, should I do it like after closing all my other work, then substituting logout with nxserver -restart command?
March 25, 2016 at 10:45 #10718BritgirlKeymasterA Trouble Report has been opened and you are invited to sign up to the ‘notify me’ tool in order to receive notification of when a patch has been released. This thread will eventually be closed.
March 25, 2016 at 13:50 #10720kroyContributorIf you meant inside nx/xfce session, should I do it like after closing all my other work, then substituting logout with nxserver -restart command?
Exactly.
-
AuthorPosts
This topic was marked as solved, you can't post.