Difference between revisions of "X Window System/remote session"
m (Woozle moved page running a remote X session to X Window System/remote session: reorganizing) |
(tweaks & updates) |
||
Line 1: | Line 1: | ||
− | == | + | ==About== |
− | + | Unlike many other more popular windowing systems, the [[X Window System]], carefully separates the ''client'' (i.e. the part which the user sees and interacts with) from the ''server'' (i.e. the part which does all the work behind the scenes). This means that the client does not actually have to be running on the same machine as the server. It is possible to set up a window on one machine which is actually a session running on another machine – similar to [[VNC]], but designed into the system rather than being a kluge on top of it. (However, see [[#Bugs]].) | |
− | |||
− | |||
There are actually ''two'' ways to run remote graphical applications. Perhaps the simplest is to use this command: | There are actually ''two'' ways to run remote graphical applications. Perhaps the simplest is to use this command: | ||
* [[ssh]] -X <u>account</u>@<u>machine</u> {{optarg|<u>command</u>}} | * [[ssh]] -X <u>account</u>@<u>machine</u> {{optarg|<u>command</u>}} | ||
− | This causes any X commands invoked during the session to run using your local machine's X server. | + | This causes any X commands invoked during the session to run using your local machine's X server. (Note that some GUI applications, including [[Firefox]] and [[Thunderbird]], are configured to look for a locally-running copy and, if found, bring that to the foreground instead of running on the remote system and merely ''displaying'' locally. The purpose of this behavior is not clear, and HTYP does not currently know of any workarounds.) |
Alternatively, you can set up a window on your machine which will appear like a monitor which is booting into the remote system; the rest of this page describes that technique. | Alternatively, you can set up a window on your machine which will appear like a monitor which is booting into the remote system; the rest of this page describes that technique. | ||
Line 30: | Line 28: | ||
* The contents of the local X window are scaled to about 75%, making some things hard to read; there's probably a command-line option to change this, but it doesn't seem to be adjustable during runtime. (Automatic scaling when the user mouse-adjusts the window size would be nice; a drop-down menu on the Xnest window would also be good.) | * The contents of the local X window are scaled to about 75%, making some things hard to read; there's probably a command-line option to change this, but it doesn't seem to be adjustable during runtime. (Automatic scaling when the user mouse-adjusts the window size would be nice; a drop-down menu on the Xnest window would also be good.) | ||
− | == | + | ==Question== |
Is there any way to automate this whole thing? As it is, you have to have two console windows open – one for the remote ssh session and one for the local session to start Xnest. Neither of those windows can be closed without killing the session. There must be some way to have one session spawn a batch file (.sh) which spawns Xnest, then spawns an ssh session to the remote which runs export (using nmblookup to get the local machine's IP address automatically would be nice), and then exits – but I'm not enough of a Linux guru to know how to do most of that. | Is there any way to automate this whole thing? As it is, you have to have two console windows open – one for the remote ssh session and one for the local session to start Xnest. Neither of those windows can be closed without killing the session. There must be some way to have one session spawn a batch file (.sh) which spawns Xnest, then spawns an ssh session to the remote which runs export (using nmblookup to get the local machine's IP address automatically would be nice), and then exits – but I'm not enough of a Linux guru to know how to do most of that. |
Revision as of 19:42, 9 October 2015
About
Unlike many other more popular windowing systems, the X Window System, carefully separates the client (i.e. the part which the user sees and interacts with) from the server (i.e. the part which does all the work behind the scenes). This means that the client does not actually have to be running on the same machine as the server. It is possible to set up a window on one machine which is actually a session running on another machine – similar to VNC, but designed into the system rather than being a kluge on top of it. (However, see #Bugs.)
There are actually two ways to run remote graphical applications. Perhaps the simplest is to use this command:
- ssh -X account@machine
- REDIRECT Template:fmt/arg/opt
This causes any X commands invoked during the session to run using your local machine's X server. (Note that some GUI applications, including Firefox and Thunderbird, are configured to look for a locally-running copy and, if found, bring that to the foreground instead of running on the remote system and merely displaying locally. The purpose of this behavior is not clear, and HTYP does not currently know of any workarounds.)
Alternatively, you can set up a window on your machine which will appear like a monitor which is booting into the remote system; the rest of this page describes that technique.
How
In order to do this, you will need Xnest running on the "client" machine. This is available in standard repositories for most Linux distributions (including Ubuntu and SuSE).
- On the local (client) machine (note the space before the ":"):
Xnest -ac :1
- Notes:
- Xnest may not be installed by default; use the package manager to install it.
- there are apparently better alternatives to Xnest; xserver-xephyr seems worth trying.
- On the remote machine (via ssh or equivalent):
export DISPLAY=yourmachine:1
...where yourmachine is the name or IP address of your local machine. If you get messages indicating that it's having trouble connecting to yourmachine, try using an IP address instead. If you are using a Windows (Samba) network and machine names do not automatically resolve to IP addresses, use "nmblookup yourmachine" to get the address.
- You will then need to run the command to start a GUI session:
- startkde starts KDE
- startxfce4 is reputed to start Xfce
Bugs
Resized windows often don't display properly; the controls within the window resize, but the window itself won't grow past its original size. Controls which move outside the visible area become inaccessible, including the window-frame controls (max/min/close).(This problem seems to have been fixed as of July 2006; not sure whether it was with the client or the server, but it now works fine with Kubuntu 6 connecting to Fedora Core 4.)New windows often don't display at all (except in the taskbar, if they would normally show up there), but you can make them appear by clicking on the K menu in the taskbar.(This problem also has gone away.)- The contents of the local X window are scaled to about 75%, making some things hard to read; there's probably a command-line option to change this, but it doesn't seem to be adjustable during runtime. (Automatic scaling when the user mouse-adjusts the window size would be nice; a drop-down menu on the Xnest window would also be good.)
Question
Is there any way to automate this whole thing? As it is, you have to have two console windows open – one for the remote ssh session and one for the local session to start Xnest. Neither of those windows can be closed without killing the session. There must be some way to have one session spawn a batch file (.sh) which spawns Xnest, then spawns an ssh session to the remote which runs export (using nmblookup to get the local machine's IP address automatically would be nice), and then exits – but I'm not enough of a Linux guru to know how to do most of that.