xhost howto?

Hi there. Here’s the situation. I have a brand new installation of suse 11.2 x86_64 with Gnome. I installed nx client/server/node from NoMachine NX - Download: NX Server for linux Evaluation without problems. But when I try to run the nx client, nothing happens, if I try to run it from konsole I get

nxclient: cannot connect to X server :0.0

googling around I found out the problem is with “xhost” command. So if I execute

xhost +

before trying to run the client, the client then starts up ok. However if I reboot pc, I have to repeat the procedure, which is a bit annoying. Therefore I would like to permanently allow connection to my X from specific hosts (but for now just the localhost) and not from all (which is what I did executing “xhost +”). If I do.

xhost+localhost
xhost+192.168.15.40

that doesn’t help, the nxclient still doesn’t start. So my question is, how can I permanently add access to X from my localhost for nxclient? Any suggestion much welcome :slight_smile:

Hi
Your running Desktop effects? Try disabling? I use a script in my
~/bin directory to start the client;


#!/bin/bash
xhost +
/usr/NX/bin/nxclient --session \
"/home/<username>/.nx/config/<nx-host>.nxs"
xhost -

Change the username and host for your requirements and then save for
example as nx-host along with chmod 700 nx-host


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.42-0.1-default
up 4 days 3:26, 2 users, load average: 1.43, 0.61, 0.34
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

thanks malcolmlewis, will try to disable effects and report back

Hi
Your running Desktop effects? Try disabling? I use a script in my
~/bin directory to start the client;
Code:

#!/bin/bash
xhost +
/usr/NX/bin/nxclient --session
“/home/<username>/.nx/config/<nx-host>.nxs”
xhost -

Change the username and host for your requirements and then save for
example as nx-host along with chmod 700 nx-host
Disabling effects doesn’t help, however your script is a good tip, so I did copy it and adjusted a little bit. The “major” change I did is to change the lines

xhost +
xhost -

with

xhost +local:
xhost -local:

, because from what I read arround, the “xhost +” allows connection from everywhere to my pc, which is not what I want for security reasons, not even for the time the nx client is running. Therefore the “local:” switch enables only non-network local connections to my pc, which I find more secure, please correct me if I’m wrong :). Thanks again for the script :slight_smile:

Hi
It can either be host or username :slight_smile:

Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.42-0.1-default
up 5 days 4:41, 2 users, load average: 0.11, 0.33, 0.25
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

Hi
It can either be host or username
I’ve read about that too, but haven’t seen an example of “username” usage, can you write an example please, thanks

Hi
Have a look at the manpage :wink: You could use for example;


xhost + inet:<username>@
<username>@ (unix.<UID>@) being added to access control list


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.42-0.1-default
up 6 days 10:17, 3 users, load average: 0.09, 0.16, 0.16
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

Hi
Have a look at the manpage You could use for example;
Thanks for this, I’ve read the manual, but obivously didn’t get it, how to use it for specific username, thanks again.