PDA

View Full Version : 12.04 Server - Gnome - NoMachine 4



pietrob71
November 5th, 2013, 09:41 AM
I've rented a VPS with ubuntu 12.04 server 64bit and I would like to obtain a server with an ubuntu desktop and the possibility to connect to it with NoMachine 4.

I've googled a little bit and I've found some tutorials that help me to reach my goal.

So I do this:


apt-get update
apt-get install gnome-desktop

wget http://web12.nomachine.com/download/4.0/Linux/nomachine_4.0.362_1_amd64.deb
dpkg -i nomachine_4.0.362_1_amd64.deb


Now, the server start without desktop enviroment and when I need, I connect to the server with ssh shell and type this 4 commands:


xauth -f /var/run/Xvfb-0.auth add :0 .d41d8cd98f00b204e9800998ecf8427e
xauth add :0 .d41d8cd98f00b204e9800998ecf8427e
Xvfb :0 -auth /var/run/Xvfb-0.auth -screen 0 1280x1024x24 &
DISPLAY=:0 /etc/X11/Xsession gnome-session &
/etc/init.d/nxserver restart

After this I use my NoMachine client to connect to the desktop enviroment of my server, and all works fine.
I have some questions and I hope someone can help me to optimize my configuration:

Is correct to use Xvfb or there's an alternative way?
How can I avoid to launch commands through ssh shell and automate them at the boot? I've tried to make a /etc/init.d/script and launch it as service:

!/bin/bash
xauth -f /var/run/Xvfb-0.auth add :0 .d41d8cd98f00b204e9800998ecf8427e
xauth add :0 .d41d8cd98f00b204e9800998ecf8427e
Xvfb :0 -auth /var/run/Xvfb-0.auth -screen 0 1280x1024x24 &
DISPLAY=:0 /etc/X11/Xsession gnome-session &
but it seems doesn't works and I can't to connect with my NoMachine client.
I've installed NoMachine, but it doesn't start at boot and i'm forced to start/restart it through ssh shell. Any idea?
If I decide to start the desktop enviroment only when I need it, how can I terminate it when I've finished?


Any suggestions are appreciated

Thanks in advance

Pietro Beccegato

TheFu
November 6th, 2013, 08:41 PM
I do not use the NoMachine server, so can't help with that at all.
However, the FreeNX server works very nicely with NoMachine client v3.5.x. I was unable to figure out how to make the v4.x clients connect to the FreeNX server. I felt stupid, but no xvfb is needed, no xauth, just connect to an xterm, and run any window manager of choice.

Here's my startup:

#!/bin/bash

. ~/.bashrc

if [ -f ~/.config/openbox/lxde-rc.xml ] ; then
openbox --config-file ~/.config/openbox/lxde-rc.xml &
else
openbox &
fi
sleep 2
xterm -sb -fg green -bg black &
xterm -sb -fg green -bg black &
keepassx &
thunderbird &
firefox &
I manually run that if the machine has been rebooted. Otherwise, I reconnect to a running session and all is just as I left it.

Sorry I haven't got a clue about your specific setup, but you did ask for _any suggestions_.

cybergalvez
November 8th, 2013, 10:21 PM
x2go is based on nx3 and works well