home   articles   archive   forum   masthead  
Published at 21.8.2000
Author: Matthias Kranz
Translator: Andy Ziegler
Languages: de nl
Printer printer-version
Support Us!
 

Free X-Server for M$Win

X-Server for M$Win Free X servers exist for M$Win! This enables you to run programs on a Linux computer but export the display to a M$Win PC.

Contents:

Introduction

We want to start an X server on a M$Win 9x or NT machine so we are able to use it like a local machine.
There are a few commercial X server for M$Win and the cheapest one seems to be MicroImage with a price of $25, but that one only works with twm (Tom`s Window Manager); this software did not impress us at all.

You can find an old and completely free version of the MicroImage X server if you look. This one was released in 1997 but we have not found any serious problems with it, just a few minor problems concerning the graphical display.

Requirements

The following things are required:

A Linux computer with a correctly configured network card.

The window manager fvwm2 has to be installed but does not need to be specified as the default manager.

The Linux computer has to accept RSH connections.



M$Win has to be installed and should run stabley (already quite a challenge!). The network card should work without any problems.

The program you need is xserver.zip. You'll find it here and it can be freely distributed.

Configuration

Unzip the file xserver.zip to C:\mix_95\ . The documentation says that the directory has to have this name, but you can name it as you wish. Only one thing has to be known: the DOS name of the directory. That means if your directory has more than 8 characters, the DOS name would be the short form with the tilde. We will describe the configuration based on the directory C:\mix_95\.

Next you should try to get a small fvwm2 or twm configuration file. You need this for your window manager. Default configuration files can be found for fvwm2 (SuSE) at /usr/X11R6/lib/X11/fvwm2/.fvwm2rc and for the twm at /usr/X11R6/lib/X11/twm/system.twmrc .

FVWM A search with www.google.com/linux for .fvwm2rc or .twmrc respectively, should do the same.

The window manager configuration file has to be saved at $HOME/.fvwm2rc or $HOME/.twmrc respectively. $HOME stands for the home directory of the user account who wants to access the Linux PC via the X server. We want to point out that it is not recommended to work with the root account. Nevertheless, the complete configuration works similar for the root account (but the $HOME directory is /root).

We would also like to point out that rsh is not as safe than ssh. We would not use this via the Internet, but only in a secure LAN.

The basic configuration works easily with twm. We do not really like this window manager and we went into the depths of the configuration file and managed to run it with fvwm2. Maybe you can fit it to your favorite wm, but it does not work with KDE .

Next, we write the script to initialize the X server on the Linux PC

The free MicroImage X server has a limited amount of included fonts. In the ZIP file, other fonts are included but these have to be installed manually and done with the program "xset". The parameter -fp specifies the FONT-PATH. All other options are described in man xset, but are not necessary to start it the first time.
The next step matters: set the PATH (do not mix it with the FONT-PATH). By default only /bin/ and /usr/bin/ are included. To execute X clients you always have to specify the whole path (/usr/X11R6/bin/...). All this typing gets on our nerves, so why not just include it in the PATH declaration in the INIT script of the X server?
After starting the X server the first time we realized that special keys like backslash, delimiters and so on did not work with our German keyboard, so we added a change to the keyboard settings and placed the symbols in the right place for our keyboard. We used the command xmodmap for this. Maybe you will have to reconfigure this for your own keyboard.

That is it and you see our entire script following. Put it in /home/user/initxscript and execute chmod 755 initxscript to make it executable

File initxscript
   PATH="/bin:/usr/bin:/opt/bin:/usr/X11R6/bin:/usr/TeX/bin:/usr/local/bin"
export PATH
/usr/X11R6/bin/xset fp=\ c:/mix_95/pcf/75dpi/,c:/mix_95/pcf/misc/,c:/mix_95/bdf/misc/,\ c:/mix_95/fonts/100dpi/,c:/mix_95/fonts/75dpi/,c:/mix_95/fonts/latin2/,\ c:/mix_95/fonts/misc/,c:/mix_95/fonts/local/,c:/mix_95/fonts/pex,\ c:/mix_95/fonts/speedo/,c:/mix_95/fonts/type1,c:/mix_95/fonts/urw/\ >> /home/user/start.log & #German keyboard setting /usr/X11R6/bin/xmodmap -display 192.168.0.11:0.0 - ‹‹EOF keycode 125 = bar keycode 127 = asciitilde keycode 126 = braceright keycode 124 = braceleft keycode 92 = bracketleft keycode 94 = bracketright keycode 65 = at keycode 93 = backslash keycode 95 = asciicircum keycode 97 = quoteleft keycode 181 = quoteright EOF /usr/X11R6/bin/fvwm2 >> /home/user/start.log &


(download)

Comment:
The user in the script has to be replaced by your name.
The parameters for xset (third line) have to be all on one line!
On our Linux system, we found a few more fonts and included them. By default only the first 3(!) font-directories are included! Do not specify non-existant directories because otherwise xset will not work!

Perhaps you want to export the variable MAIL=/var/spool/mail, too. Write this mail-line below the PATH line (1.line) and change the export line to export PATH MAIL. Of course you can add more in the same way.

Now you have to set the permissions so M$Win is allowed to execute this script. To do this, you create the file .rhosts in the directory /home/user/ .
The file content has the structure:

File .rhosts
  computer-name.domain.de user
  


computer-name stands for the name of your M$Win computer (or the name you specified in the file /etc/hosts on your Linux computer). If your M$Win computer was the computer with the IP address 192.168.0.11 the /etc/hosts should look like:

File /etc/hosts
  192.168.0.11	alex.technix.de		alex
  


then you put into /home/user/.rhosts

File .rhosts
  alex.technix.de user
  


The .rhosts file allows a computer, specified in this file, to execute commands without any password. Be careful with this ability. Now you see why root must not do this!

The file /home/user/.rhosts should be only readable for the owner, so execute a

  >> chmod 600 .rhosts
  
We are done with the configuration of the Linux computer for the time being.


Let`s turn to the M$Win computer.
We write a small BATCH script that first starts the initializing script on the Linux PC and then the window manager (FVWM2).

The batch file can be placed at c:\mix_95\ and looks like:

File launch.bat
  REM Brought to you by Matthias Kranz (matthias.kranz@technix.de)
  REM you can remove the REM in the next line to reduce unwanted output
  REM ECHO OFF
  XS
  REM my Linux Server has the IP 192.168.0.1 and the M$Win client 
  REM the IP 192.168.0.11
  REM you have to fit the following line to your setup
  rsh -l user 192.168.0.1 "xterm -display 192.168.0.11:0.0 -title \ 
  Initializing -e nohup /home/user/initxscript > /home/user/start.log &"
  EXIT
  EXIT
  EXIT
  


(download)

Now you create a link on your Desktop. You can check the options "start minimized" and "close after exit" and the pop-up DOS box does not disturb us any longer.

That should do it. A double click on the link and it should work.

Important comments and problem solutions and unsolved problems:
- Starting the M$Win X server, a white window appears and closes immediately. This is a problem with the initxscript.
- The X server window uses the same resolution as the M$Win computer. Also the X server window cannot be resized.
- The X server uses the color depth of the Linux computer, independent what you set in M$Win. This does not create any conflicts or problems.
- A few programs do not run, in particular KDE programs or programs that need other fonts which are not supported by the X server. But you can add these in your /home/user/.fvwm2rc or /home/user/.twmrc respectively-> man fvwm2 or man twm .
- On the M$Win PC you can automatically execute other programs via

  >> rsh -l LINUX-COMPUTER-IP "/path-to-program/program -display WINDOWS-COMPUTER-IP:0.0 &"
  

Just add this command to your launch.bat file. Or you fit your .fvwm2rc or .twmrc respectively.
- Starting launch.bat could end in a crash of the M$Win X server, in particular if the M$Win ran for a longer time. Then you have to reboot M$Win.
- While executing the initxscript, the window manager may not start correctly. Due to this, you should include a restart button for the window manager in any of the menus of the window manager (The window manager can be independently restarted from the M$Win X server -> man fvwm2 or man twm). After restarting, everything should be OK again.

If you found other problems (and maybe the solution as well), it would be nice to write to us about it.

Documentation

More documentations can be found at:

Links

http://www.uk.research.att.com/vnc/ Another free X server for M$Win and other OSes. This X server is slower than MicroImage (all graphics are bitmapped) but works with many different window managers. There are some versions using compression that are faster.
http://download.sourceforge.net/WeirdX/ Another X server completely written in Java (JDK 1.2.* + Swing). Also it runs as an applet in a web browser which supports Java.


This article is a translation and reprint of an article written by Matthias Kranz. More Articles by M. Kranz and Jan Thiele can be found at their homepage at http://www.price-of-freedom.de




Talkback Area




Enter Own Comment