You are not logged in.

#1 2004-12-12 16:25:42

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

How do I forward X to Windows through SSH?

I've been looking around quite some time now, but I don't seem to find a complete guide on how to run X apps from my server on a client running Windows.

The situation:

server
My computer at home, running Arch, X.org 6.8.something and an sshd

client
Any Windows computer, running Cygwin/X

I'd like to be able to ssh into my Arch-box and start X apps, but have the output of the X apps be shown on Windows (tunnel X through ssh).

Like I said, I've installed Cygwin/X, it seems to work: I can ssh into my Arch-box from Cygwin/X, but I can't run any X apps since I don't know where to export what $DISPLAY settings.

Could anyone give me a brief run down of commands I have to execute on both the server and client?


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#2 2004-12-12 20:19:48

colnago
Member
From: Victoria, BC
Registered: 2004-03-25
Posts: 438

Re: How do I forward X to Windows through SSH?

Hello,

Edit your arch server /etc/ssh/sshd_config so it contains this:

X11Forwarding yes

Restart ssh (/etc/rc.d/sshd restart), then make a file in your windows cygwin home directory ~/.ssh/config like this:

ForwardX11 yes
ForwardX11Trusted yes

Maybe you wont need the 'ForwardX11Trusted yes' line.

If you tend to switch users, put this into your server  ~/.bashrc...

export XAUTHORITY=~/.Xauthority

Offline

#3 2004-12-12 21:28:32

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: How do I forward X to Windows through SSH?

Thx for the info!

After I edited the files you told me to, I logged into my box from Cygwin

ssh -X -p y fubar@mybox.com

When I try to run a program like XMMS, I get a critical error about $DISPLAY. So I changed the $DISPLAY to localhost on the server. It took me a few minutes to figure out this wouldn't work since "localhost" on the server means the server's own address. I then changed $DISPLAY on the server to the client's IP

export DISPLAY=clients.ip.address:0

If I now try to run an X prog, I get this:

Error: Can't open display: clients.ip.address:0

How do I startx on the Windows-client then?


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#4 2004-12-13 04:30:43

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: How do I forward X to Windows through SSH?

make sure you have X started under cygwin. It has to have an X server running on the client to talk to.

http://tech.ait.iastate.edu/kula/cygwin/
http://x.cygwin.com/docs/ug/configure.html


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2004-12-13 15:21:57

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: How do I forward X to Windows through SSH?

I would suggest the following:
Get the Cygwin/X server up and running (startxwin.bat) - I would suggest rootless of multi mode...
Download putty ( http://www.chiark.greenend.org.uk/~sgtatham/putty/ )
When configuring putty, go to Connection>SSH>Tunnels and check the "Enable X11 Forwarding"
Connect, and voila!

It's pretty simple to setup...

Offline

#6 2004-12-13 18:18:27

sud_crow
Member
From: Argentina
Registered: 2003-06-30
Posts: 545

Re: How do I forward X to Windows through SSH?

Isnt TightVNC (or RealVNC) faster ?? And it can be used through SSH with Putty too...


Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux

Offline

#7 2004-12-13 20:04:30

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: How do I forward X to Windows through SSH?

FUBAR wrote:
export DISPLAY=clients.ip.address:0

If I now try to run an X prog, I get this:

Error: Can't open display: clients.ip.address:0

How do I startx on the Windows-client then?

Here's the deal.  With a normal X server, you can specify the full ip and not even worry about SSH.  SSH secures the communication and allows you to not open extra ports to the world.  With X11 forwarding over SSH, you specify the X server as localhost, and SSH handles the forwarding from the host to the client.... that is, SSH is smart enough to say "you want to connect to the localhost, but I'm an ssh session... so that means connect to the client"

try setting DISPLAY=localhost:0.0

Offline

#8 2004-12-13 22:52:47

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: How do I forward X to Windows through SSH?

Thx for the suggestion. I'll try them as soon as possible, unfortunately my USB stick has died on me. :cry:


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#9 2004-12-16 22:10:29

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: How do I forward X to Windows through SSH?

Woohoo, this works great!

Look at me go!

ssh_x_forward_sm.jpg
(Click for bigger image - 321KB)

I'll write a little WiKi on this if I have time.


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#10 2004-12-16 22:22:07

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: How do I forward X to Windows through SSH?

congrats.
now for more nerdiness factor, use litestep instead of explorer for your desktop shell.
big_smile

*image removed because I lost it..*

As an added bonus, you get psuedo virtual desktops.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#11 2004-12-16 22:46:12

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: How do I forward X to Windows through SSH?

Mmmm, I don't know, that would make me the übernerd ... wink

I've tried Litestep before I got into Linux, but it was too much configging for me. And this is just a simple Win98 box to do stuff Linux can't (e.g. manage my Smartphone).

Nice desktop tho.


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#12 2004-12-18 15:03:02

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: How do I forward X to Windows through SSH?

Running Cygwin/X off a USB-stick wouldn't work (without a lot of hacking) since Cygwin/X only works if it's installed with the installer.

But, I found this nice project: just download and burn the .ISO and you can use the CD to run SSH tunnelled X programs on Windows-machines.

It works, slow tho since I've only got 384KBit upstream. Is there a way to limit the colordepth to be able to work with less lag?


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#13 2004-12-22 06:16:15

SavageMessiah
Member
Registered: 2004-03-20
Posts: 76

Re: How do I forward X to Windows through SSH?

Hey! I was wondering how to do this! I've got it working perfectly now. As soon as I get synergy set up, my windows and linux boxes will be working together almost seemlessly.

As for nerdiness, I think I've got you both beat. I'm running bblean and powerpro, with all sorts of consoley stuff in Console boxes (it's a prettyfication wrapper for windows' ugly boxes).

Imagine this and add X11 forwarding to it. tongue *Warning, dual monitor 1280x1024*

Offline

#14 2004-12-22 07:03:56

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: How do I forward X to Windows through SSH?

a bit too "busy" for me, but cool nonetheless
wink


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

Board footer

Powered by FluxBB