# X11 over network

## Rmanen

Is it possible to run a gentoo box with X11 "headless"? I use it as a download box and could do without the xtra crt in my already crowded room:) anyways, All i want is to be able to run azureus on my gentoo box, while commanding it on my winXP pc

Thanks

----------

## beandog

Of course.  Its mostly a matter of correct USE flags.

----------

## Rmanen

how would I go about doing this then?

----------

## beandog

emerge -pv <whatever program you want installed>

Look at the USE flags.  Take out what you don't want in /etc/make.conf

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=2

----------

## Rmanen

I dont see how this helps me, what im trying is to establish a remote desktop(running from gentoo) over a network, to a win XP pc. Which winxp compatible program could i use for this?

----------

## j-m

Forward it over SSH (see /etc/ssh/sshd_config - X11Forwarding). As for the client, it depends on OS you want to use...   :Wink: 

----------

## beandog

 *j-m wrote:*   

> Forward it over SSH (see /etc/ssh/sshd_config - X11Forwarding). As for the client, it depends on OS you want to use...  

 

oh, Im sorry man ... I completely misread your first post. I thought you wanted to run a headless box, period.

Anyway ... yah, x11 forwarding over SSH or use VNC.

----------

## Rmanen

sooooo anyway, changed #X11Forwarding no to X11Forwarding yes, do i need to change any other values? as for the client, any good hints/tips on which to use?

Edit: I installed PuTTy, I cant find how to get the Gentoo GUI over ssh???

----------

## fatlip

I am stuck in the same boat at the moment. Any help would be most welcome   :Smile: 

----------

## N@t5

You need to install an X server in XP, such as cygwin/X.  Run "xhost +<gentoo  bpx's hostname>" from an xterm in XP.  In Putty, go to the Tunnels section and enable X11 Forwarding.  After that, everything should "just work"

----------

## fatlip

OK, I did exactly as you suggested but when I execute xterm I get....

```
X connection to localhost:10.0 broken (explicit kill or server shutdown)
```

This was in a Putty Session logged in as root (I know,I know)  :Rolling Eyes: 

I am running the SSHD server on a different port than the default which shouldn't be a big problem. 

Am I missing a setting somewhere that won't allow this?

----------

## Rmanen

hey i just got the exact same error message, also logged in as root  :Very Happy: 

----------

## N@t5

Sorry I wasn't a but clearer about that.  Don't run the xterm over ssh, run it from cygwin.  The xhost command is what will give your ssh session access to the X server

----------

## Rmanen

What's cygwin?

EDIT: Google found it for me  :Smile: 

EDIT2: Cygwin doesnt recognize xhost as a valid command???

----------

## Rmanen

all installed etc.... i get error message: xhost: unable to open display ""

Am i being very noob?

----------

## Rmanen

KICK*

Does anyone have an answer?

----------

## fatlip

I am still messing around with it. I am sure you figured out that the default install of Cygwin did not install the X related commands. I re-installed with the X options and now am getting close to having this working!

Man..... the frustration!

```
Greg@tool ~

$ xterm -display 192.168.0.6:0.0 -ls

Xlib: connection to "192.168.0.6:0.0" refused by server

Xlib: No protocol specified

xterm Xt error: Can't open display: 192.168.0.6:0.0
```

This is where I am now. Any input?

----------

## fatlip

Ok... I am one step closer. 

Open Cygwin.

```
Greg@tool ~

$ ssh -Y -l root -p 2233 192.168.0.6
```

(I had to specify -p 2233 because I run it on a different port)

That is one step closer.

----------

## Rmanen

im reinstalling the entire cywin/X prog, so ill have to wait for about half an hour to try it

----------

## j-m

Have a look at:

https://bugs.gentoo.org/show_bug.cgi?id=70585

https://bugs.gentoo.org/show_bug.cgi?id=70813

https://bugs.gentoo.org/show_bug.cgi?id=69925

----------

## Rmanen

hmz im no further yet, i still get:

```
xhost: unable to open display ""
```

I can't really make sense out of the bug reports tho (first time linux user)

----------

## j-m

 *Rmanen wrote:*   

> hmz im no further yet, i still get:
> 
> ```
> xhost: unable to open display ""
> ```
> ...

 

Try this in /etc/security/pam_env.conf:

```

REMOTEHOST      DEFAULT=localhost OVERRIDE=@{PAM_RHOST}

DISPLAY         DEFAULT=${REMOTEHOST}:0.0 OVERRIDE=${DISPLAY}

#XAUTHORITY     DEFAULT= OVERRIDE=@{XAUTHORITY}

```

If this does not work yet, comment out the DISPLAY line...

----------

## Rmanen

nope same prob

----------

## fatlip

Tried your suggestions. Still fails. 

```
 $ xterm -display 192.168.0.6:0.0 -ls

xterm Xt error: Can't open display: 192.168.0.6:0.0
```

Arghh...

----------

## j-m

OK, try commenting out everything in the file.

If it does not fix the problem, I cannot help you. Report your problems to https://bugs.gentoo.org/show_bug.cgi?id=70585 then.

----------

## Rmanen

ok just to be clear, what should i be typing in where?

(just trying to create some order in the topic)  :Very Happy: 

----------

## j-m

Well, if commenting out all the lines does not help, then copy any relevant error messages like those shown in https://forums.gentoo.org/viewtopic.php?p=2079662#2079662

This bug really needs to be fixed.   :Mad: 

----------

## fatlip

There is an open bug report on this. 

https://bugs.gentoo.org/show_bug.cgi?id=70585

I guess we aren't the only ones having this problem! And it's a big one.

Thanks for your help j-m.

----------

## Jas-Nix

 *Rmanen wrote:*   

> ok just to be clear, what should i be typing in where?
> 
> (just trying to create some order in the topic) 

 

This is what I did and it works great.

1.  Install Cygwin make sure that X gets installed as well.

2. Start Cygwin and type "startx"   then in the new shell type "xhost +"

3. Type ssh -Y -C user@linuxbox.com,  when you are connected to your linux box type "export local.computer:10.0"

4. Close connection with linux box.

5. Setup Putty to connect to your linux box.  under the "Tunnels" make sure "Enable X11 forwarding" is checked.

6. Connect to your linux box using Putty, type "xclock" to test and make sure it's working.  If you see a clock you should be able to open any application on your windows box just by typing it's command.

----------

## fatlip

You are the man! It works! Are you sure you are a N00b?   :Laughing: 

Thanks man!

----------

## Jengu

The xhost problem is that you need to run:

```

xhost +your.ip.add.ress

```

On the host machine. This gives that machine permission to establish X connections on the host. Although I'm not sure this is necessary when tunneling through ssh.

And cygwin is the way to go to access from XP.

----------

## Rmanen

hey Jas-Nix, you own! remind me that if i ever meet you irl i buy you a beer  :Very Happy:   seriously, thanks

----------

## Jas-Nix

No problem guys I'm glad I could help.

----------

## rolypoly

I've just setup something very similar.

I'm connecting from a linux box to a HP-UX box. SSHD is running on the HP-UX box and I can successfully start an application on the HP-UX box and have it displayed on my linux box.

But, I thought I'd use Ethereal to monitor the network and check that it is actually encrypting everything... And it's *not*.  :Evil or Very Mad: 

I know it should be, and I'm going to investigate fixing it because it's probably something I missed, but all I'm saying here is,  just because you manage to run xclock or some other application remotely, don't assume it's being forwarded securely!

If everything is being tunneled through ssh, then the ethereal trace should just show lots of ssh packets. The trace I took, started off with just ssh packets until I opened an x-window application, at which point the trace showed lots of x11 packets on port 6000.

Once again, don't assume all the traffic is being encrypted just because the window opens on your machine and you logged in via ssh. Check it out and use a protocol analyser (like ethereal) to confirm it is being encrypted.

BTW, you don't need a complete install of Cygwin/X, you can use Xming which is just the X component. Much less to download and install if you don't need the rest of the Cygwin environment  :Very Happy: 

Just my 2c.

----------

## mahir

well its strange i got freeXer for my X windows systems..

and i got 2 systems, fc3 and my lovely gentoo

but the freeXer connects direcly with no probs to the fc3 system but

the gentoo deoesnt work

i get this problem

```
mahir@jt ~ $ gaim

Xlib: connection to "192.168.1.120:0.0" refused by server

Xlib: Invalid MIT-MAGIC-COOKIE-1 key

(gaim:16941): Gdk-CRITICAL **: gdk_display_get_name: assertion `GDK_IS_DISPLAY (display)' failed

** (gaim:16941): WARNING **: cannot open display: unset

```

----------

## hijjt

you can use NX server from nomachine, it is really fast and well suited to this application. it actually runs over ssh. It is easy to configure (much easier than cygwin).

----------

## rolypoly

NX might be a bit much to run a single application. Doesn't NX serve an entire desktop rather than just individual apps?

I use NX to connect from work back to my home PC, and it works really well  :Smile: 

Certainly I'm not in a position to install NX on our HP-UX box, while I do have OpenSSH installed, so should be able to tunnel everything through SSH. Network bandwidth isn't an issue as we're conected via a 100Mbps switch.

I guess I'll just have to keep playing with it till everything goes through ssh...

----------

