Jump to content

Remote X session


Guest anon
 Share

Recommended Posts

I have a remote server and im trying to either startx or create an X session on the server. First time i have tried to do this, and after three days of research, im still stuck.

I can start and log in through a term, cd / bla bla. funny enough, i can even view files using SFTP in Konqueror. But is their a way i can see the desktop etc? Looked at some remote x session pages through google, they all say something different. How does it work? is the x session on my box exported to the server? I tried startx on the server " no screens found"

BTW the server is redhat, not that it should make a difference?

Link to comment
Share on other sites

There are two ways to run a remote 100%-X session:

1)- login first on remote host (telnet), set the DISPLAY variable, and then run remote X programs;

2)- connect first to remote X session manager (gdm, kdm...), and then login graphically.

 

3) Alternatively, you can run a remote X session by adding a bit of SSH. This is the most secure solution.

 

4) Finally, you may use a remote display protocol, such as VNC.

 

Here's how:

Let's assume your address is 10.0.0.2, and you want to run X programs on 10.0.0.1

 

1)

$ xhosts +10.0.0.1

$ telnet 10.0.0.1

login: ....

password: ....

$ export DISPLAY=10.0.0.2:0

$ xterm &

 

2) First configure the server's display manager to accept XDMCP connections, then

$ X -query 10.0.0.1 :1

This time, you have the full remote desktop on another X vt (CtrlAltF7 is your first X display, numbered :0 ; and CtrlAltF8 is the second, numbered :1)

 

3) First make sure sshd is running on the server, then

$ ssh -X 10.0.0.1

login: ....

password: ....

$ xterm &

 

4) There are many ways to use VNC. Mandrake's DrakTermServ (or something like that) is based on VNC. I prefer XDMCP on a secure network, and SSH in all other cases.

 

Yves.

Link to comment
Share on other sites

theYinYeti

Thanks, but im still stuck. I prefer to only use ssh to login, have not tried telnet or vnc

Here's where i am. using xterm:

 ssh -X 213.232.94.69   

root@213.232.94.69's password: 

Last login: Tue Apr 22 23:43:47 2003

[root@dp-5003 root]# xterm &

[1] 1998

[root@dp-5003 root]#

After the above, it just opens up a new xterm, no gui login or x

Link to comment
Share on other sites

Yes. XDMCP is the only way to have the whole remote desktop. But maybe we can find another solution. Maybe this:

 

Start X locally (only X nothing else) on display :1, then go to a virtual console and export DISPLAY=:1 (the newly created X), then run ssh -X with remote user root, and finally when connected run gdm/kdm's chooser.

 

Does it work?

Link to comment
Share on other sites

did you make sure to set the originating computers IP to be permitted to start an x-session on the system you are on?

xhost +<ip or hostname>

then telnet to the remote system and

export DISPLAY=<ip of local system>

startx

 

assuming you don't have any graphical interface started on the second system. i could be way off here, but that's all that I need to do to start a session on a local system from a remote system.

Link to comment
Share on other sites

Start X locally (only X nothing else) on display :1, then go to a virtual console and export DISPLAY=:1 (the newly created X), then run ssh -X with remote user root, and finally when connected run gdm/kdm's chooser
Alternatively, you can ssh to the remote user you want to be (yourself), and then instead of running the chooser, you run the desktop you want: fluxbox, Gnome, KDE, whatever...

 

Yves.

Link to comment
Share on other sites

Yes. XDMCP is the only way to have the whole remote desktop. But maybe we can find another solution. Maybe this:

 

Start X locally (only X nothing else) on display :1, then go to a virtual console and export DISPLAY=:1 (the newly created X), then run ssh -X with remote user root, and finally when connected run gdm/kdm's chooser.

 

Does it work?

 

I get this far

# export DISPLAY=:1

[root@localhost me]# ssh root@213.232.94.69

root@213.232.94.69's password: 

Warning: No xauth data; using fake authentication data for X11 forwarding.

Last login: Wed Apr 23 17:59:55 2003

 

I also tried Tyme sugestion, but "no screens found"

I think the problem may be with the server end, not sure though. I just don't know enough.

Tried to config xdmcp, as i understand it, you just make XDMCP=TRUE, that file is suposed to be in /etc/X11/gdm/gdm.conf There is no such gdm.conf file on the server.

There is nothing on the server apart from three mdk CDs, I was using wget to test out the d-load speed of the server. Can I send you the password for the server? maybe you could figure out what im doing wrong.

Link to comment
Share on other sites

Hello anon!

I've got good news. I tested what you want yesterday evening. First tell me if I'm wrong: you want a whole remote desktop, and you want it through SSH.

 

Here's what I did on VT1 (CtrlAltF1) (note that display :0 was already running on CtrlAltF7):

yves@client$ X :1 &

... some output ...

... then I checked that X was indeed running on CtrlAltF8 ...

yves@client$ export DISPLAY=:1

yves@client$ ssh server

password for 'yves' on 'server': ... my password ...

connected.

yves@server$ echo $DISPLAY

localhost:10.0

yves@server$ icewm

... some output ...

And guess what? On my local (Mdk8.1) :1 display (CtrlAltF8), I had a perfectly working IceWM session (Mdk9.1) running (and fast!), until I clicked "Disconnect..." on IceWM's menu (then only the bare X remained on :1, and I got the prompt back on VT1).

 

One note though: IceWM behaved perfectly and terminated OK; I expect any window manager would behave the same.

But then I tried to do the same with Gnome (startgnome). Gnome started OK (with some minor warnings on VT1), and I soon could see and use the Gnome 2.2 desktop on my laptop. Unfortunately, the "Close session..." command on Gnome's menu did not terminate. After properly closing the session, and disapearing from screen, Gnome hung, waiting on some resources, as I could see from VT1's messages. I don't know if it is supermount being polled by the Desktop Environment, or something like that, but I had to use the kill command to make Gnome terminate. I'm almost sure it would be the same with KDE.

 

Some final remarks:

- I couldn't find the GDM login screen! gdmlogin is some command-line tool, that don't react correctly to my keystrokes; gdmchooser is for choosing the server, not the user; gdmiflexserver and all other gdm* tools told me that there was a version mismatch of some sort...

- You were suggested to use the startx command. That is not possible with ssh X11-forwarding, because the local X server has to run before ssh is called, but ssh has to run before you run startx remotely: it's a no-go-loop (don't know how to say that in English).

 

Yves.

Link to comment
Share on other sites

Yes, im after a whole display using only ssh thanks.

Command not found?? I must be doing something stupid.

export DISPLAY=:1

[me@localhost me]$ ssh root@213.232.94.69

Enter passphrase for key '/home/me/.ssh/id_rsa': 

root@213.232.94.69's password: 

Last login: Thu Apr 24 21:30:25 2003 

[root@dp-5003 root]# echo $DISPLAY

localhost:10.0

[root@dp-5003 root]# icewm

-bash: icewm: command not found

[root@dp-5003 root]# startgnome

-bash: startgnome: command not found

[root@dp-5003 root]#

Its a new server, (redhat) so i thought i would check if Gnome was installed.

[root@dp-5003 root]# rpm -qa | grep gnome

gnome-vfs2-2.0.2-5

libgnomeui-2.0.3-3

gnome-python2-canvas-1.99.11-8

libgnome-2.0.2-5

gnome-python2-bonobo-1.99.11-8

gnome-python2-1.99.11-8

gnome-libs-1.4.1.2.90-22

gnome-python2-gtkhtml2-1.99.11-8

redhat-switch-printer-gnome-0.5.12-1

redhat-switchmail-gnome-0.5.14-1

gnome-mime-data-2.0.0-9

libgnomecanvas-2.0.2-1

[root@dp-5003 root]#

Link to comment
Share on other sites

Yes. IceWM and Gnome surely are not in you path. Try using that instead:

/usr/X11R6/bin/icewm

/usr/bin/startgnome

 

As for the display ending with :10.0. It's normal because ssh creates a proxy X display on the remote machine with the same abilities as your local display, and then encrypts everything from/to this proxy display, and forwards the encrypted X11 commands to your local display.

 

Yves.

Link to comment
Share on other sites

I found out why startgnome etc, won't work, its doesn't exist on the server!!

[root@dp-5003 root]# rpm -qa | grep gnome

gnome-vfs2-2.0.2-5

libgnomeui-2.0.3-3

gnome-python2-canvas-1.99.11-8

libgnome-2.0.2-5

gnome-python2-bonobo-1.99.11-8

gnome-python2-1.99.11-8

gnome-libs-1.4.1.2.90-22

gnome-python2-gtkhtml2-1.99.11-8

redhat-switch-printer-gnome-0.5.12-1

redhat-switchmail-gnome-0.5.14-1

gnome-mime-data-2.0.0-9

libgnomecanvas-2.0.2-1

[root@dp-5003 root]#

As you can see from above, the new server has only half of the files needed for Gnome.

Why they did this, i don't know, im sure when everything is installed it will work OK.

Thanks very much for all your help, could not have got this far without it. 8)

Link to comment
Share on other sites

Everything now works great, i used APT-GET to install the missing files. Im logged in to my remote server, running KDE, and posting this message using Mozilla. The screen is perfect.

The YinYeti, thanks very much for your help. Im really pleased 8) 8) 8)

Link to comment
Share on other sites

  • 1 month later...
There are two ways to run a remote 100%-X session:

1)- login first on remote host (telnet), set the DISPLAY variable, and then run remote X programs;

2)- connect first to remote X session manager (gdm, kdm...), and then login graphically.

 

3) Alternatively, you can run a remote X session by adding a bit of SSH. This is the most secure solution.

 

4) Finally, you may use a remote display protocol, such as VNC.

 

Here's how:

Let's assume your address is 10.0.0.2, and you want to run X programs on 10.0.0.1

 

1)

$ xhosts +10.0.0.1

$ telnet 10.0.0.1

login: ....

password: ....

$ export DISPLAY=10.0.0.2:0

$ xterm &

 

2) First configure the server's display manager to accept XDMCP connections, then

$ X -query 10.0.0.1 :1

This time, you have the full remote desktop on another X vt (CtrlAltF7 is your first X display, numbered :0 ; and CtrlAltF8 is the second, numbered :1)

 

3) First make sure sshd is running on the server, then

$ ssh -X 10.0.0.1

login: ....

password: ....

$ xterm &

 

4) There are many ways to use VNC. Mandrake's DrakTermServ (or something like that) is based on VNC. I prefer XDMCP on a secure network, and SSH in all other cases.

 

Yves.

 

Hi, I'm wondering if there is any way to run any of these four methods on a Windows machine. I tried running most of these commands in the CLI (using Putty on a Windows machine) with no success (i.e. errors); I think they're meant to be run on a Linux machine, connecting to a Linux machine?

 

I've seen a few X-Windows programs (namely X-Win32) and VNC clients, but none seem to be easy to use; if that's the way I should go, I'd like to know before I do my homework for nothing. :)

 

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...