Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Running X programs remotely (from a windows machine)
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Fez
n00b
n00b


Joined: 16 Sep 2004
Posts: 3

PostPosted: Thu Sep 16, 2004 9:26 pm    Post subject: Running X programs remotely (from a windows machine) Reply with quote

I wasn't sure if I should put this in this forum or the networking one, but it seemed to fit here a little better...

I installed 2004.2 yesterday and got most things working nicely. X.org, GLX, KDE, quake3, etc. I only have one monitor and I'd like to be able to control the Linux box through my windows machine (while leaving the Linux machine in another room with no monitor).

What does it take to get this sort of thing working? I found something called RealVNC, but I'm not sure if that is what I need. Any help would be appreciated.
Back to top
View user's profile Send private message
dethmetaljeff
n00b
n00b


Joined: 16 Sep 2004
Posts: 4

PostPosted: Thu Sep 16, 2004 9:51 pm    Post subject: Reply with quote

Try this. Ive never used it, but these are the directions I got from my graphics professor for running X apps on the lab machines. Its windows software, so the fact that it is a trial version is easily circumventable im sure.

Quote:

One of the better packages for exporting X-windows programs to windows machines is X-win32 5.4 You can download a trial version
from http://www.starnet.com/ (you really only need a trial version
since it runs long enough to test your programs).
Run X-Win32 after you installed it and make sure its in your taskbar. Next find out your ip address by running cmd from start->run, and typing ipconfig. This will give you your 4 number ip address.
Next, go into your linux box. Make sure you are in bash shell (or any other shell that supports export command, or just run "bash"). Enter the following:
export DISPLAY=YOUR_IP:0

so for example export DISPLAY=123.234.212.122:0

Then run your programs (try xterm or netscape)
Back to top
View user's profile Send private message
rjs
Tux's lil' helper
Tux's lil' helper


Joined: 30 Jul 2004
Posts: 146
Location: Oriel College, Oxford

PostPosted: Thu Sep 16, 2004 10:08 pm    Post subject: Reply with quote

If I understand you correctly, you want to be able to open up a window on your Windows computer and login into your Linux box and then run X apps in Windows?

You mentioned VNC: VNC is a remote desktop program. Basically you start up a VNC client on one machine (your Linux box) and then connect to that VNC server using a client on your Windows machine. What the server does is very frequently sends an image of the desktop to the client which displays it on your machine (this is a very simple explanation, but you get the idea). The client interprets mouse and keyboard signals from the local machine and forwards them to the VNC server which translates them to the desktop it is serving.
Problem with VNC is that it can get really slow at redrawing the desktop with any kind of additional network load, and it doesn't have the same power as using X forwarding like I will describe now.

Simply using Putty to connect via SSH won't do the trick because it doesn't allow X forwarding. What you need is a program like Hummingbird (this is the only one I know of, there are probably more) that acts as an X server on a Windows computer.

Here is the link, the one you need is at the top of that page:

http://www.hummingbird.com/products/nc/index.html

Now I managed to get this software for £10 from the University computer shop, but I have no idea how much it would cost in reality. Then again there are always ways round trial versions...

Robbie
Back to top
View user's profile Send private message
zarg
n00b
n00b


Joined: 11 Jun 2004
Posts: 9

PostPosted: Thu Sep 16, 2004 10:12 pm    Post subject: Reply with quote

I have used Cygwin/X before with XDMCP. This basically allowed me to use the desktop (like KDE or Gnome) from a windows machine.
_________________
A sober man's secret is a drunken man's speech
Back to top
View user's profile Send private message
Mben
Guru
Guru


Joined: 29 Mar 2004
Posts: 465
Location: New York, USA

PostPosted: Thu Sep 16, 2004 11:51 pm    Post subject: Reply with quote

i use tight vnc (vnc with better compression)

Code:

emerge tightvnc


as the user you want to run x programs as:
Code:

vncserver

give it a password
i cant remember if you have to re run it after you get it set up or not

then edit
~/.vnc/xstartup
to start a window manager if you want one

then from the windows machine:

open a web browser and go to http://host:5801 for display 1. the port number increases by one for each display. this way you can have multiple vncservers running. this meathod requires java on the windows machine though. if you want you could use a vncviewer from http://www.tightvnc.com/ and give it host:display

a vncserver can be killed with
vncserver -kill :1
to kill display 1

good luck. in the client you can change the compression if you dont have much bandwith just click the options button
Back to top
View user's profile Send private message
Fez
n00b
n00b


Joined: 16 Sep 2004
Posts: 3

PostPosted: Fri Sep 17, 2004 1:12 am    Post subject: Reply with quote

Mben wrote:
i use tight vnc (vnc with better compression)

...

then edit
~/.vnc/xstartup
to start a window manager if you want one


Thanks a lot. This was very easy to get working. In fact I'm typing this post through VNC right now. The X-win server solutions would probably have been more "correct" and less bandwidth intensive, but this was the simplest to set up.

A couple quick questions:

1) How can I make the server run on system startup (without the need for anyone to login to the system)?

2) How can I make KDE start when I login remotely? I tried editing the ~/.vnc/xstartup and replacing the lines there with "startkde", but I'm not sure if that is the correct procedure.

3) Has anyone had success with tunnelling this through SSH? It's probably not needed since it's only transferring over a local network behind a firewall, but it would be nice to have.
Back to top
View user's profile Send private message
Mben
Guru
Guru


Joined: 29 Mar 2004
Posts: 465
Location: New York, USA

PostPosted: Fri Sep 17, 2004 1:56 am    Post subject: Reply with quote

system startup: not sure you may be able to put something in /etc/conf.d/local.start but i dont know how to run it as a user.

kde:
make your ~/.vnc/xstartup look like this:
Code:

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startkde &

it probabily didnt work for you because you left out the &

ssh tunneling:
it should work though i havent tried it. you need port 5801 for the http server or port 5901 for the vncviewer (and possibly 6001 but im not sure).
it works well over my pptp vpn. but should over ssh too though again im not sure exactly how.

good luck
Back to top
View user's profile Send private message
Mben
Guru
Guru


Joined: 29 Mar 2004
Posts: 465
Location: New York, USA

PostPosted: Fri Sep 17, 2004 1:58 am    Post subject: Reply with quote

also:
if you are low on bandwith try passing -geometry WxH to vncserver
Back to top
View user's profile Send private message
deprave
n00b
n00b


Joined: 14 May 2004
Posts: 63
Location: Flint, Michigan

PostPosted: Fri Sep 17, 2004 12:29 pm    Post subject: Reply with quote

Cygwin/X with XDMCP is the best solution ssh -x boxen
much better then vnc IMO, Definitly check out this option it was realy nice for me when I was looking for the same solution as you, its alot faster then vnc you can run windowmaker in a window on your windows box and launch x apps on your linux box right on your windows box :)
Back to top
View user's profile Send private message
gen2doggy
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2004
Posts: 75

PostPosted: Fri Sep 17, 2004 1:33 pm    Post subject: Reply with quote

You may also want to look at this topic if you like VNC.

https://forums.gentoo.org/viewtopic.php?t=72893
This is a great howto, credit to the chap that wrote it.

HTH and good luck!
Back to top
View user's profile Send private message
davidblewett
Apprentice
Apprentice


Joined: 15 Feb 2004
Posts: 274
Location: Indiana

PostPosted: Fri Sep 17, 2004 1:35 pm    Post subject: Reply with quote

rjs wrote:
Simply using Putty to connect via SSH won't do the trick because it doesn't allow X forwarding.


This is not true. You have to enable it in the Putty options menu, but it's rather easy. I use the programs by www.nomachine.com (NoMachine), specifically NXServer on the linux box and NXClient on the windows box. NXClient includes an X Server, which you need to have on the windows side. Both are in portage. The client is free, but the Server is free to try. There is an opensource version of both called FreeNX, but I didn't have as much success with it last time I tried.
_________________
No guilt in life, no fear in death
this is the power of Christ in me
From life’s first cry to final breath
Jesus commands my destiny
-- Newsboys, "In Christ Alone", "Adoration: The Worship Album"
Back to top
View user's profile Send private message
b-douze
n00b
n00b


Joined: 15 Sep 2004
Posts: 27
Location: Montpellier (FR)

PostPosted: Fri Sep 17, 2004 3:25 pm    Post subject: Reply with quote

I'm also using CygWin. It's working great for me. (And it's free)
Back to top
View user's profile Send private message
gen2doggy
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2004
Posts: 75

PostPosted: Fri Sep 17, 2004 3:29 pm    Post subject: Reply with quote

i cant seem to use any windows based x servers

im behind a corporate firewall :(

shot in the dark follows...
is there anyway around this? - i guess it doesn't work because there's no way to set DISPLAY to my machines IP because my remote machine cant actually see the pc i am sat at.

vnc only for me - though it works excellently if i tunnel through ssh and use compression (gnome, with no background and indubstrial theme)
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Fri Sep 17, 2004 3:35 pm    Post subject: Reply with quote

Just to add to the confusing: I used both cygwin and tightvnc at my work. From those two tightvnc was much faster/more responsive than cygwin xforwarding (also tightvnc was much faster than normal vnc). The vncviewer that you can download for windows also works better than the webbased/java one.
Back to top
View user's profile Send private message
davidblewett
Apprentice
Apprentice


Joined: 15 Feb 2004
Posts: 274
Location: Indiana

PostPosted: Fri Sep 17, 2004 3:39 pm    Post subject: Reply with quote

You can use Putty to connect to a remote SSH server through most firewalls, if they have proxies. It's in the proxy config section. For NXServer, all I had to was create a port forward from the local machine's port 22 to the remote server's port.
_________________
No guilt in life, no fear in death
this is the power of Christ in me
From life’s first cry to final breath
Jesus commands my destiny
-- Newsboys, "In Christ Alone", "Adoration: The Worship Album"
Back to top
View user's profile Send private message
gen2doggy
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2004
Posts: 75

PostPosted: Fri Sep 17, 2004 3:53 pm    Post subject: Reply with quote

ah haa i got it working, using xwin32 and i had to set x11 forwarding in the putty options

it's unusable though it's 100 times slower than vnc!
Back to top
View user's profile Send private message
davidblewett
Apprentice
Apprentice


Joined: 15 Feb 2004
Posts: 274
Location: Indiana

PostPosted: Fri Sep 17, 2004 3:58 pm    Post subject: Reply with quote

NX works great for me. It's only marginally slower than being at the machine itself, and my upstream bandwidth is only 256kbps.
_________________
No guilt in life, no fear in death
this is the power of Christ in me
From life’s first cry to final breath
Jesus commands my destiny
-- Newsboys, "In Christ Alone", "Adoration: The Worship Album"
Back to top
View user's profile Send private message
gen2doggy
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2004
Posts: 75

PostPosted: Fri Sep 17, 2004 4:04 pm    Post subject: Reply with quote

hmm i couldnt get FreeNX working at all, I'll see if i can try an evaluation version of the commercial version
Back to top
View user's profile Send private message
+O!
n00b
n00b


Joined: 20 Jun 2004
Posts: 40
Location: Belgium

PostPosted: Fri Sep 17, 2004 4:13 pm    Post subject: Reply with quote

b-douze wrote:
I'm also using CygWin. It's working great for me. (And it's free)


And you can do some neat tricks.

For instance with x2x : I had an old laptop with linux standing on the right of my windows PC monitor. With x2x you can move the cursor to the right, out of the 'windows screen' and into the 'linux screen' (and back). This allows you to control the linux PC through Windows keyboard and mouse, with copy and paste between the 2 machines !
With cygwin you can have the Linux PC display the apps on the windows pc pretty much like they are windows apps, each app in a 'windows window' : this seams to be a nice howto : http://hpc.me.utexas.edu/docs/help/tuts/cygwin_guide.pdf

Sometimes I just start a second x server like this :
Code:
X :1 &

Then I start a windows manager :
Code:
openbox -display :1 &

or you could run it from the remote linux PC (I'm not sure all network administrators will like this...)
Then I start an xterm :
Code:
xterm -display :1 &

Now you have an x server running in a "windows window".
In the xterm I start a ssh to the remote PC :
Code:
ssh - l [i]username [/i] -Y -C [i]remote ip or hostname[/i]
Log in to the remote pc and start applications :
[code]xeyes &[/code]
This way I can have plenty of apps running without the taskbar getting to crouded.  (Windows doesn't have multiple desktops, so I use this instead)

I do a lot of VNC stuff to but this will definitly work faster !  The only thing you need is a ssh daemon running on you Linux pc (like openssh) and cygwin (with all the X stuff installed) on you're windows PC.  You don't even have to run X on the Linux PC, so that will save valuable computer resources !

_________________
Nature doesn't need to be improved,
it need's respect ...
Back to top
View user's profile Send private message
+O!
n00b
n00b


Joined: 20 Jun 2004
Posts: 40
Location: Belgium

PostPosted: Fri Sep 17, 2004 4:16 pm    Post subject: Reply with quote

Oops, and there's no edit function here :(

Let me correct that last bit :

Sometimes I just start a second x server like this :
Code:
X :1 &

Then I start a windows manager :
Code:
openbox -display :1 &

or you could run it from the remote linux PC (I'm not sure all network administrators will like this...)
Then I start an xterm :
Code:
xterm -display :1 &

Now you have an x server running in a "windows window".
In the xterm I start a ssh to the remote PC :
Code:
ssh - l [i]username [/i] -Y -C [i]remote ip or hostname[/i]

Log in to the remote pc and start applications :
Code:
xeyes &

This way I can have plenty of apps running without the taskbar getting to crouded. (Windows doesn't have multiple desktops, so I use this instead)

I do a lot of VNC stuff to but this will definitly work faster ! The only thing you need is a ssh daemon running on you Linux pc (like openssh) and cygwin (with all the X stuff installed) on you're windows PC. You don't even have to run X on the Linux PC, so that will save valuable computer resources !
_________________
Nature doesn't need to be improved,
it need's respect ...
Back to top
View user's profile Send private message
gen2doggy
Tux's lil' helper
Tux's lil' helper


Joined: 31 Jul 2004
Posts: 75

PostPosted: Fri Sep 17, 2004 4:24 pm    Post subject: Reply with quote

hmm no binaries of nx personal for gentoo, only for redhat e.t.c
:(
Back to top
View user's profile Send private message
davidblewett
Apprentice
Apprentice


Joined: 15 Feb 2004
Posts: 274
Location: Indiana

PostPosted: Fri Sep 17, 2004 4:35 pm    Post subject: Reply with quote

NX is in portage. You can
Code:
#emerge nxserver-personal


It uses the Red Hat RPM's I beleive. I really hope FreeNX improves quickly, as it would be the ticket. All of the nx compression pieces are open source, it's only the user/session management part that is closed source.
_________________
No guilt in life, no fear in death
this is the power of Christ in me
From life’s first cry to final breath
Jesus commands my destiny
-- Newsboys, "In Christ Alone", "Adoration: The Worship Album"
Back to top
View user's profile Send private message
Boris27
Guru
Guru


Joined: 05 Nov 2003
Posts: 562
Location: Almelo, The Netherlands

PostPosted: Mon Oct 11, 2004 12:56 pm    Post subject: Reply with quote

If you use X forwarding with SSH over the internet, enable compression. Speeds things up tremendously.
_________________
we are microsoft, lower your firewalls and surrender your pc's. we will add your biological and technological distinctiveness to our own. your culture will adapt and service us. resistance is futile.
Back to top
View user's profile Send private message
Slinger
Apprentice
Apprentice


Joined: 14 Dec 2002
Posts: 230

PostPosted: Mon Oct 11, 2004 7:12 pm    Post subject: Reply with quote

Don't forget to enable x11forwarding = yes in your sshd_conf file.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum