Skip to contentSkip to conversation

remote X sessions

DISCUSSION Jacob Langley 4 participants 6 messages Jan 6, 2004 – Jan 11, 2004

lore
Share & tools
lore
#0 lore raw

I've been all over the internet tonight looking for exactly what I want and I can't find it. What I'd like to be able to do is type something like

$ startx 

Maybe with a whole lot of command line options even and be able to open an X session running fluxbox or twm or some other light window manager on a completely separate machine on my lan. I'm so rarely in a window manager now that I'd like to be able to just use one off another computer and stick to a console only install on my main system since I'm the only person that uses it. Any ideas or places to look would be appreciated.

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#1 lore raw
Quoted 6 lines · Jacob Langley

I've been all over the internet tonight looking for exactly what I want and I can't find it. What I'd like to be able to do is type something like

$ startx
Quoted 7 lines

Maybe with a whole lot of command line options even and be able to open an X session running fluxbox or twm or some other light window manager on a completely separate machine on my lan. I'm so rarely in a window manager now that I'd like to be able to just use one off another computer and stick to a console only install on my main system since I'm the only person that uses it. Any ideas or places to look would be appreciated.

This sort of question -- "Where do I find [name of application]?" is almost always a distro-specific question. And you don't say what distro you are using.

First step for you is to search your distro's package database for "startx" (that is in fact the correct name for the app that does what you want ... or at least what I *think* you want). For example, in Debian, this app is part of the package xbase-clients .

The upstream source for X11 is www.xfree86.org ... I imagine the "startrx" app is available there.

But I am not *certain* that I understand what you want. X is a server that has to run on the workstation that you are working at. Using the X server, you can run X clients -- specific applications that use X as their UI -- on other hosts. But

If you want to run an X-like interface on a remote machine that your workstation can access, you might do better to look at the client-server combo VNC. You run vnc-server on the remote host, and vnc-client, also called a viewer, on the workstation (clients exists for Linux and Windows, maybe other OSs too). There are several VNC clients for Linux, some requiring X on the workstation, at least one using SVGA directly.

Here too, check your distro's packaging system for the parts of VNC. Or you can go to the upstream site, http://www.realvnc.com/ .

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#2 lore raw
In reply to Jacob Langley
Quoted 6 lines · Jacob Langley

I've been all over the internet tonight looking for exactly what I want and I can't find it. What I'd like to be able to do is type something like

$ startx 
Quoted 9 lines

Maybe with a whole lot of command line options even and be able to open an X session running fluxbox or twm or some other light window manager on a completely separate machine on my lan. I'm so rarely in a window manager now that I'd like to be able to just use one off another computer and stick to a console only install on my main system since I'm the only person that uses it. Any ideas or places to look would be appreciated.

Quick answer: Copy & past the script below, edit as appropriate, and save as $HOME/.xinitrc, then run startx.

Long answer:
To do this, you need to set up the both ends of the connection, the server and the client. In the following brief description, replace xserver with the hostname of the machine you will be sitting at, and xclient with the hostname of the machine you want to run the application (the window manager in you're question - for simplicity, I illustrate with the xmatrix screensaver).

Step 1: Tell the local display (the server) to accept connections from the remote computer, for example with the following command:

user@xserver:~$ xhost +xclient

Step 2: Tell the remote application (the client) to direct its output to your local display, either with the -display or --display command line options, or with the DISPLAY environment variable for example:

user@xclient:~$ /usr/X11R6/lib/xscreensaver/xmatrix -display xserver:0.0

or

user@xclient:~$ export DISPLAY=xserver:0.0
user@xclient:~$ /usr/X11R6/lib/xscreensaver/xmatrix

Now, where you want the window manager to be running off the remote (client) machine, it gets trikier, because each X display can only have one window manager running. Most X session scripts end with the window manager command, so you have to quit or kill this window manager before you can start the remote window manager, but as soon as the window manager ends, the X server closes as well. So you actually need to write a X session script that will start the remote window manager.

Here is an example of such a script:
------------------------<snip>------------------------ #!/bin/sh
# Standard X Setup stuff userresources=$HOME/.Xresources usermodmap=$HOME/.Xmodmap sysresources=/usr/X11R6/lib/X11/xinit/.Xresources sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap

# merge in defaults and keymaps
if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi
if [ -f $userresources ]; then
    xrdb -merge $userresources
fi
if [ -f $usermodmap ]; then
    xmodmap $usermodmap
fi
# Here's the important stuff:
# Allow connections from the remote (client) machine
xhost +xclient

# Connect to the remote machine (xclient), and start the window manager # Only have one uncommented.
# Here's how you could start Gnome:
#ssh xclient /usr/bin/gnome-session --display xserver:0
# Here's a twm example:
ssh xclient /usr/X11R6/bin/twm -display xserver:0 ------------------------<snip>------------------------

The 2 important lines are
xhost +xclient
that allows the client machine to display on the X server, and
ssh xclient /usr/X11R6/bin/twm -display xserver:0
which signs into the client with ssh, and then launches the window manager connected to the X display on xserver. Note that this script requires you to have configured ssh to automatically sign in without prompting for a password (see the ssh man page).

More detailed info available in the following documents:

<http://www.ibiblio.org/mdw/HOWTO/Remote-X-Apps.html>
Specific to remote X Apps - This should cover everything you need.

<http://www.tldp.org/HOWTO/XWindow-User-HOWTO/index.html>
More general X Windows information, with some info on remote X apps.

man 7 X
man 1 xinit
man 1 xhost
man 1 ssh
The manual pages for relevant programs.

Hope this helps,
Conway S. Smith

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#3 lore raw
In reply to Jacob Langley
Quoted 11 lines · Jacob Langley

I've been all over the internet tonight looking for exactly what I want and I can't find it. What I'd like to be able to do is type something like

$ startx 
Maybe with a whole lot of command line options even and be able to open
an X session running fluxbox or twm or some other light window manager
on a completely separate machine on my lan.  I'm so rarely in a window
manager now that I'd like to be able to just use one off another
computer and stick to a console only install on my main system since I'm
the only person that uses it.  Any ideas or places to look would be
appreciated.

Jacob,

not sure I understand exactly what you're looking for either, but maybe a XDMPC solution would work for you, since you're talking about connections on your LAN. The box you wish to use X at could be set up to accept such connections, and be queried with "X -query <remotehost>". You do need a X installed where you are sitting, though, but this could be quite minimal, and demand little HW resources. (Could also be done with really thin, diskless clients). Then you just get an entire session as if you were sitting at the machine you query. ssh back to yourself or C-m-F1, etc, to get the console back.

--lars

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#4 lore raw

I know about this solution if the remote machine is using a login manager of some sort (gdm, xdm, kdm) but will it work if the remote machine isn't running X like that?

Quoted 26 lines · Lars Bungum
Quoted 11 lines · Jacob Langley

I've been all over the internet tonight looking for exactly what I want and I can't find it. What I'd like to be able to do is type something like

$ startx 
Maybe with a whole lot of command line options even and be able to open
an X session running fluxbox or twm or some other light window manager
on a completely separate machine on my lan.  I'm so rarely in a window
manager now that I'd like to be able to just use one off another
computer and stick to a console only install on my main system since I'm
the only person that uses it.  Any ideas or places to look would be
appreciated.

Jacob,

not sure I understand exactly what you're looking for either, but maybe a XDMPC solution would work for you, since you're talking about connections on your LAN. The box you wish to use X at could be set up to accept such connections, and be queried with "X -query <remotehost>". You do need a X installed where you are sitting, though, but this could be quite minimal, and demand little HW resources. (Could also be done with really thin, diskless clients). Then you just get an entire session as if you were sitting at the machine you query. ssh back to yourself or C-m-F1, etc, to get the console back.

--lars

Signature · 7 lines
Jacob Langley <[email protected]>

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
#5 lore raw
Quoted 3 lines · Jacob Langley

I know about this solution if the remote machine is using a login manager of some sort (gdm, xdm, kdm) but will it work if the remote machine isn't running X like that?

Jacob,

if this solution isn't feasible for you, I suggest you delve further into Conway's (Beolach) earlier post stepping through an example of such a setup. IOW it won't work exactly the same way. (That easy).

--lars

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs