From: Henrik Carlqvist Subject: Re: start X remotely Date: Tue, 09 Aug 2005 21:51:25 +0200 User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-ID: Newsgroups: alt.os.linux.slackware References: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Lines: 110 Organization: SunSITE.dk - Supporting Open source NNTP-Posting-Host: 82.183.137.225 X-Trace: news.sunsite.dk DXC=d<6GPbZ2ZA_gcbniiOP=_RYSB=nbEKnk[>L`eQ\RmIj\>bne[9P4SS>F7;=WgZWM08@d2o8lXCLS6aal?5?Z>jPBB1Pk?D\ X-Complaints-To: staff@sunsite.dk Path: news.comindico.com.au!news.optus.net.au!news1.optus.net.au!optus!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!feed.news.tiscali.de!uninett.no!news.net.uni-c.dk!dotsrc.org!news.dotsrc.org!not-for-mail Xref: news.comindico.com.au alt.os.linux.slackware:112569 Lezo wrote: > I have a headless PC (really a linux box with no monitor or mouse attached) > setup on a network. > How do I start X from another PC. X is installed & works if I run it > locally. First of all, X has some strange naming of things. Normally when you log in to something on a network to run something there you call that something for a server which runs your program. When you are connected to a server you normally call your machine a client. X has reversed that naming. Instead you are running an X server on your local machine. This means that X gives the service of a monitor, mouse and keyboard to applications which can be run from any machine on the net. So many "thin clients" are really "X servers". You have already been able to start X on your local machine. This is a good first step. Next you want to log in to that headless machine over the network. This could be done in many ways. In a trusted network you may use telnet or rsh. Otherwise ssh is always useful. We will start with a simple example and call your machines for "desktop" and "headless". We are assuming that you did configure your network so you are able to ping the machines and also use telnet, rsh and ssh. desktop:~$ xhost +headless headless being added to access control list desktop:~$ telnet headless Trying 192.168.0.3... Connected to headless. Escape character is '^]'. Welcome to Linux 2.6.12.5. headless login: myusername Password: Last login: Sun Aug 7 15:24:55 from desktop Linux 2.6.12.5. headless:~$ export DISPLAY=desktop:0 headless:~$ xlock Voila! Now you have a clock which is run on the CPU of headless but is show on the display of desktop. So what did we do? First of all we did allow headless to place windows on the screen of desktop, this was done with "xhost +headless" on the machine desktop. We then logged on to headless and said that we wanted our windows to be presented on desktop, this was done with "export DISPLAY=desktop:0". Then we started an X program, in this case the clock. Instead of using telnet you could also use rsh in the same way. But ssh has many advantages. One of the advantages is that ssh and sshd can be configured to something called X forwarding. Using this you will not have to mess with xhost and the DISPLAY variable, this is done automatically. Another advantage of ssh is that everything sent over the net is encrypted. This could also be a disadvantage as it steals some performance, you don't want to run an mplayer window over an encrypted ssh session. If you want to read more about X forwarding with ssh there are manpages for ssh, ssh_config and sshd_config. As you are able to run a clock over the network with X you are also able to run any X application, including a complete window manager. Something like this: (Start with a text console) desktop:~$ X (you will se a boring dithered background and an X cursor, then jump to another text console with ctrl-alt-f2) desktop:~$ export DISPLAY=:0 desktop:~$ xhost +headless headless being added to access control list desktop:~$ telnet headless Trying 192.168.0.3... Connected to headless. Escape character is '^]'. Welcome to Linux 2.6.12.5. headless login: myusername Password: Last login: Sun Aug 7 15:24:55 from desktop Linux 2.6.12.5. headless:~$ export DISPLAY=desktop:0 headless:~$ fvwm Now you have a complete window manager running on that other machine. Any application you start from menus in the window manager will also be run on headless. A better way to do this would be to start an xdmcp server on headless. Examples of such servers are xdm, gdm and kdm. These servers can be configured to listen for connections from the network. Once you have configured such a server you will be able to: desktop:~$ X -query headless Then you will get a nice graphical login which logs you in to headless. It is possible to do many fun things with X. The default display of X is :0, but you are able to have more than one session of X running using diffrent display numbers. Example: "startx -- :3". Another nice program is Xnest which allows you to start a second X server within an X server. Example: "Xnest -query headless :4". regards Henrik -- The address in the header is only to prevent spam. My real address is: hc7(at)uthyres.com Examples of addresses which go to spammers: info@k-soft.se info@k-software.biz info@webrider.ru root@localhost --2008-10-03