the methods running X server on CoLinux

Contents

[show]

Introduction

At the moment, you can't directly run an X server (using the display hardware) on a Cooperative Linux machine. The way so far is bringing the screen output to the windows host through the network and let windows display it somehow.

So you'll need a running network before being able to continue here.

There are currently two ways of working with X-Windows under coLinux :

Native Windows X server: run a X server directly under windows and let the graphical applications use the X network protocol==

Firefox  
coLinux Windows X server (display)
Windows network (X protocol)

VNC server on coLinux: Run the X VNC server under coLinux and bring the screen output to windows using a Windows VNC client==

Firefox  
Xvnc
coLinux Windows VNC client (display)
Windows network (VNC protocol)

Which method to choose will depend. As I had some experience with VNC before, I used that way, but installation of an windows X server shouldn't be hard too. As you already brought up your network (which is the tricky part), setting up an X server shouldn't be magic (at least nowadays).

Use a X Window server on the Host System Edit

We'll be discussing Cygwin/X here. Contact your vendor for assistance in setting up a commercial X server. (What applies to Cygwin/X usually applies to Xming, except Xming installation is very simple)

Also, you will be able to use non-US keyboard now since your X Window server is a Windows application.

Single-Window Mode Vs Multiple Window Mode Edit

To view a complete graphical desktop on windows, you can start an XServer in single window mode. This gives you one window which shows an entire desktop environment (taskbar, clock, desktop icons, etc). but there is another way. Multiple window mode provides a more integrated way to view graphical applications running on multiple remote computers along with graphical windows running on the host computer. In multiple window mode, each remote graphical application gets its own window on your desktop, and looks just like any other application you may have started locally.

A big advantage of multiple window mode is not having to run some resource-intensive window environment like KDE or Gnome (GDM). In fact, you don't have to run any window manager at all, since you are just using the native Microsoft Windows facilities.

Once you have a Xserver running in multiple window mode, it's easy to start X clients from a CoLinux terminal:

export DISPLAY=192.168.0.1:0
xterm &
firefox &
xclock &

Note that DISPLAY must be set to the ip address of the computer running the X Server.

  • A Screenshot

Multiple X Servers Edit

It is possible to run multiple x servers, each listening on its own "screen":

export DISPLAY=192.168.0.1:0
export DISPLAY=192.168.0.1:1

Another person's comment (WinXP & coLinux 0.8.0 & Debian 2.6.17-co-0.8.0):

1): Install Cygwin with X11 and make sure xterm runs OK on Cygwin (set DISPLAY in Windows environment variable). Getting "xeyes" to run is NOT enough of a test. Xterm must run properly (on WinXP, under Cygwin, without coLinux).

2): Install coLinux - you don't need as new a version as I am using ;)

3): Start coLinux - get networking to work so you can use apt-get (make sure you activate     your swap file (check by typing free - need fstab entry and format it).

4): Type:

apt-get update
apt-get upgrade
apt-get install xterm

5): Alt-TAB back to Cygwin and ping -n 1 www.somewhere.com - look at your firewall     display (I use Sunbelt Kerio http://go.sunbelt-software.com/?linkid=440 with it's wonderfull packet display) to get your IP address. Now type XWin -ac -multiwindow to start X11 server.

5.5) Before you go back to coLinux you need to tell XWin to allow another host to draw on the X11 screen, "xhost ", or "xhost +" for all. ie:

c:\> xhost 172.194.127.80       USE  correct IP Address

Hint: You not need the xhost, if you starts XWin right with parameter -ac. "-ac" stays for disable access control.

6): Alt-TAB back to coLinux and type:

export DISPLAY=172.194.127.88:0       USE  correct IP Address
xterm &

CoLinux will give you back your prompt and an Xterm window will open on your WinXP screen. That bash window is coLinux. Plus you have the coLinux window you started with.

The Cygwin screen will display X11 startup info and freeze until you exit the bash window - then you get Cygwin back.

Dedicate a Virtual Adapter

With many network strategies discussed on this site, communication between the X Server and the X Clients would be forwarded through a home router. For dramatic improvement in X perofrmance, see Provisioning Multiple Adapters for CoLinux

Install/Configure X Libraries/Clients in coLinux

CoLinux does not run the Xserver, but it does run XClients like Xterm, Firefox, etc. It will usually also run a window manager for these clients.

Core X Components Edit

Debian Install Edit

If necessary, first do:

apt-get update

to refresh your package list.

Install Xterm (also installs all core X components):

apt-get install xterm

Troubleshooting Edit

If note: if you try to update the xserver-xorg package in the Debian image Debian-20040605-mit.ext3.1610mb.bz2 , the update will cause coLinux 0.6.2 to quit unexpectedly. It appears that the dmidecode utility would try to open /dev/mem to read out the BIOS tables and cause coLinux to panic and quit. Simply replace your copy of dmidecode in /usr/sbin with an executable which returns an exit code of 0 and prints nothing to stdout to avoid the crashes.

Clarifying and emphasizing note: If you are installing xserver-xorg, you need to get rid of /usr/sbin/dmidecode (rename, delete, replace) or coLinux will simply close when trying to configure and/or run the xserver.

Other IdeasEdit

apt-get install x-window-system-core

: this didn't work using the Debian3.0rev2 image; see the coLinuxASAP page for the correct sequence of apt-get to use

Debian Configure/Reconfigure Edit

dpkg-reconfigure xserver-xfree86

If prompted, select an X server driver. Any selection will work, since CoLinux will typically only run X clients, not the X Server. The default driver (vga) should be sufficient

Gentoo Install Edit

Check to see if X-Windows is already installed (either XFree86 or X.org, but not both):

emerge -p xorg-x11
emerge -p xfree

or

If necessary, install XFree86 or X.org, but not both:

emerge xorg-x11
emerge xfree

(see --pretend in the emerge(1) man page)

Window Manager Install Edit

Big full-service desktop environments Edit

GNOME and KDE are popular choices (and are complete desktop environments with many bundled applications), but many others are available. If you are in doubt about which window manager to choose, your distribution's default is a good place to start.

As an example, here is how to install KDE using Debian:

apt-get install kde

If you are impatient or don't require the entire suite of KDE applications, you can install the basic core of KDE only:

apt-get install kdebase

Consult your distribution's documentation for information on how to install a window manager.


External Resources Edit

Launching Cygwin Xserver

Cygwin/X (a port of XFree86 to the Windows platform by the Cygwin project)

Cygwin Xserver can be more convenient than vncserver because xterms of multiple remote systems can coexist on your desktop.

If you install Cygwin, you can install Cygwin/X by selecting the module xorg-x11-base in the X11 section of Cygwin's setup program. Additionally, you might choose to select OpenSSH in the Net section in order to use an encrypted tunnel for the communications between X clients and your X server (or simply for another convenient method of using your coLinux system).

Pros Edit

  • Since you're running Cygwin on your Windows host machine, you have a suite of basic Unix tools available to use in conjunction with coLinux (such as "dd" for creating a large file to be used as yourcoLinux swap file).
  • Cygwin is fairly well-integrated into the Windows environment. The Cygwin/X root window can occupy the entire screen, and the X desktop scales to fit perfectly without any clipping or scrolling required (a common problem with VNC servers).
  • CygwinRootlessMode, which allows X applications to share the desktop with Windows applications. (To make this work, start Cygwin's X server using the command "X -rootless". Alternately, you can edit "startxwin.bat" in Cygwin's /usr/X11R6/bin/ directory, using the line "start XWin -ac -multiwindow". Make sure you don't start a window manager. The Cygwin/X project page at http://x.cygwin.com/ includes documentation and an FAQ that can help you with these or other tasks related to Cygwin/X.)
  • You can use the Cygwin X server in multiwindow mode to allow Windows to manage your X windows and create menu items, windows launcher icons, or desktop icons to launch applications.

You can also use full-screen mode under your VNC client (see below), but using Cygwin/X or another Win32 X server allows for easier switching and better integration between applications running on your coLinux system and the Windows host machine.

  • Also it's easy to get sound up and running using the Cygwin included esd networked sound daemon to have sound.
  • (TODO: Confirmed all those stuffs? 1) yes 2) yes 3) could not make it work with -rootless. worked fine with -ac -multiwindow.)

Cons Edit

  • If Cygwin/X crashes, you lose your session.
  • Cygwin and software firewalls like ZoneAlarm makes things slow.
  • Windows catches certain key combinations, preventing you from sending them to your coLinux guest (for instance, ALT-TAB will switch between Cygwin/X and other MS Windows applications rather than switching between programs on the Linux desktop). Using the -keyhook command line option allows the X server to catch these keys, but this obviously means that you can no longer switch away from the X server with them, which can be annoying too.
  • Note*: Bart Kerver took Cygwin/X and made a package untied from the Cygwin installer:http://speeldoos.showcase.surfnet.nl/startx.zip

(It may enter/exit, but if it does not load correctly, do appropriate tweaking.)

df-startx: Download site has been deleted!!!

: If you are using df's X-only Cygwin distribution as above and want to use XDMCP and GDM, you must edit the 'startx - desktop.bat' file and make it contain 'XWin.exe -ac -query 192.168.0.40' (replace with yourcoLinux IP address). Also note that Debian's default GDM config doesn't seem to want to let you log on as root.

: df's X-only Cygwin is missing mkfontdir and ttmkfontdir, so you can't update your font list. I found a binary-only ttmkfontdir somewhere (forgot to bookmark it unfortunately) but I couldn't find any source for mkfontdir without installing Cygwin.

  • XLiveCD: http://xlivecd.indiana.edu/
  • TextLayout: http://man-wiki.net/index.php/3:TextLayout

minimal, stripped down cygwin/x Edit

http://wiki.dennyhalim.com/xwin


XDMCP with a graphical display manager Edit

This offers a simple and effective method if encryption isn't required between the client and server. When your coLinux guest system boots, a display manager (XDM, GDM, or KDM) can be launched. Using this method, you simply have to start Cygwin/X and you are presented with a graphical login screen to gain access to your coLinux system. (A large portion of the specific instructions on installing and configuring the graphical display managers discussed here relates to Debian. Your mileage may vary. Consult your distribution's documentation or your favorite search engine for help performing these tasks.)

Warning: At least with coLinux 0.5.4, when you install GDM at all, the daemon WILL automaticaly try to launch a local server after the apt-get and cause the coLinux to crash taking your PC with it, so replace the content of /etc/X11/default-display-manager with:
echo "null" > /etc/X11/default-display-manager 

In this way, KDM won't be able to start so you won't crash hardly your system and the apt mechanism.

XDMCP with GDM Edit

As you will see, GDM is really simple to configure and of course you can install it and use it without necessarily using Gnome. I start a KDE session with GDM and Gnome is not installed at all.

First, install the beast :

apt-get install gdm

If you WANT Gnome, add the following to your /etc/apt/sources.list :

deb http://red-carpet.ximian.com/debian stable main

and run this instead:

apt-get update
apt-get install task-ximian-core

Note: This WILL try to take your video card, but unlike when just GDM is installed, it will fail and you will not crash.(In Theory)

On Gentoo:

emerge gdm 

and watch it go! (Process took me about an hour on a 2500MHz Celeron.)

On Debian and Gentoo:

Then, edit /etc/X11/gdm/gdm.conf

Find the [xdmcp] section and set the property of Enable to true :

Enable=true

Then, find the [servers] section to disable the local server :

You should comment the line (start the line with #)(well, ok, you MUST. otherwise coLinux will try to start X using your physical video card, causing Windows display to hang and forcing you to reboot Windows. also, coLinuxwill now try to start X and gdm every time it boots thereafter, so you would be screwed)

0=Standard

If you read the above warning too late, you're not screwed!!, append "init 1" to your so that:

root=/dev/cobd0

becomes

root=/dev/cobd0 init 1

Now the display manager won't load and you can fix your problem(s). When you are done, restore the original .

[Note:] It seems that I had to change the following from true to false to get it to work. Found under the [security] section.

DisallowTCP=false

If you use gdm and cygwin/X with the -clipboard option, gdm will kill all X clients including the clipboard application by default (msg). So change the initial client killing option in gdm configuration file to


[[KillInitClients]]=false

Then, replace the content of /etc/X11/default-display-manager with this:

echo "/usr/bin/gdm" > /etc/X11/default-display-manager

If you want to try it immediately without rebooting as the MS Windows fashion ;o), do :

/etc/init.d/gdm start

On Gentoo, you have to configure the display manager you want to use, find the next line

#DISPLAYMANAGER="xdm"

uncomment and change it to "gdm" in /etc/rc.conf. If you want, you can also set the default window manager (so that it does not have to be specified in gdm). At the end of the /etc/rc.conf, uncomment

#XSESSION="Gnome"

and set it to "XFCE-4" or something.

After that, you can start the display manager

/etc/init.d/xdm start

Now, launch a Cygwin console on Windows and it's time to enjoy the graphical power of Linux :

X -query 192.168.0.40 &

Replace the IP by the correct IP of your coLinux guest.

Et voilà...

(although the GDM display will appear very quickly, be patient if you choose to launch KDE).

: Seems to work nice, only one problem how can i set a keymap?

You may want to look at the +kb, -xkbdb and -xkbdbmap command line options to the X server. I'm not sure exactly how to use them, but they ought to do what you want. -- JulesH

XDMCP with KDM on Debian Sarge Edit

It's easy:

apt-get install kdm

Edit the kdmrc in /etc/kde3/kdm section [Xdmcp]

  • Allow XDMCP
Enable=true
  • (Optional) Allow to log in as root:
[[AllowRootLogins]]=true
  • (Optional) Set permanent display IP address (e.g. 192.168.0.1):
StaticServers=192.168.0.1:0


Edit the file Xaccess. Remove the # in of the *, so every host can get a login window.

Edit the file Xservers like this:

#:0 local@tt ......

No local Xserver starts after that.

I believe this will screw things up if you dual-booting. Is there any advice on having it both ways?

You can set up an init script that checks for coLinux and makes symlinks to the appropriate files, a command you can use is described as the [[isStandAlone]] utility in the ConvertingDistributions page.

Set SET REMOTE_HOST=192.168.0.2 in the startxdmc.bat of cygwin. That's it. restart colinux and start the startxdmc.

Troubleshooting Edit

I've had an XDMCP setup working for a while, but have recently made a few configuration changes, and things seem to have stopped working reliably. I have my host machine on 192.168.0.1 and colinux on 192.168.0.2, and run kdm on colinux. I use cygwin's X server with '-query 192.168.0.1'. KDM receives the query (it immediately logs a few things into /var/log/messages), but tries to connect back to 'localhost:0', which obviously isn't right.

Bizarrely, it does this whenever my host machine is connected to the Internet (standard dial up connection), but not when it isn't (although it does try to initiate an outbound connection while the kernel is booting).

Any ideas why it might be doing this?


No idea why, but I have a similar issue: If the TAP connection from XP host to colinux is 'connected', then my Cyg X that I've set up for connection to another system does not work. If the TAP-Win32 Adapter is not connected, then Cyg X works normally. ...hope this helps...


Important here, you said that your HOST is at '192.168.0.1' and your GUEST is at '192.168.0.2'. You need to change your X-server invocation to '-query 192.168.0.2' Hope that works.

Running programs in Cygwin/X multiwindow mode Edit

If you only want to run graphical linux programs through X, and not a whole desktop, you can use the multiwindow feature in Cygwin/X. After installing Cygwin with the X11 packages all you need to do is run the xwin program with the -multiwindow option. One way to do this is to create a batch file like so:

@echo off

c:
chdir C:\cygwin\usr\X11R6\bin
set PATH=C:\cygwin\bin

run XWin -ac -multiwindow

Alternatively, use /usr/X11R6/bin/startxwin.bat to start the Cygwin Xserver. Just make sure you add the *-ac* switch to the xwin.exe launch line, or else you will get some errors in Cygwin/X like :

AUDIT: Sun Oct 17 08:07:56 2004: 2132 XWin: client 5 rejected from IP your.colinux.ip.address

Cygwin Xserver should already contain a reference to xwinclip as an option to xterm.exe

the latest version (since 4.3.0-61) of Cygwin/X supports server-integrated copy & paste capability between X and Windows. You dont need xwinclip now :) Please check out Cygwin/X site http://cygwin.com/xfree/ for details.

  • Clipboard integration doesn't work for me (using DigitalFire's df-startx 1.1 in multiwin mode).

When you run the batch file the xserver should start in the background (and you should see a black X in your taskbar).

Finally in a coLinux terminal add the following to your .bash_profile script.

DISPLAY=windows.ip.address:0.0
export DISPLAY

Note: If you are running in a dual boot system you might want to add something to check which kernel is running, or create a seperate user for coLinux.

Now by simply typing "xterm &" (or a different program) an xterm window will appear.

You could also use ssh:

ssh -Yf [email protected] xterm

Hybrid: Running a hybrid Windows / X11 (KDE/Gnome) desktop, with display manager and XDMCP Edit

I just added this section and it needs some thoughtful review.

The idea here is to run similarly to B, with multiwindowing, but have
XDMCP working (have to use -rootless instead of -multiwindowing to get
xdmcp), and KDE (or Gnome) fully running (complete with Kicker and
multiple desktops for X11 windows), minus the desktop background.

Procedure:

1. In your startxdmcp.bat script, comment your current XWin line and add this:

run XWin_GL -query %REMOTE_HOST% -nodecoration -lesspointer -clipboard -rootless -ac

(Note: This is for the experimental OpenGL accelerated server. Change XWin_GL to XWin if you don't want acceleration.)

2. Start it up. I get a kdm login window (not fullscreen), and then login, and I get the full KDE desktop as in A.

3. The full desktop isn't desired, so start xkill and brutally terminate it. [Todo: insert better method here ;-). Ideally, one that works in a dual-boot situation. I'm sure there's some way to not run the KDE Desktop.]

(CJP comment) OK, I did something like you are asking about, like this...

Note: Using gentoo, and bash, but this bit should be almost the same regardless...

After taking hours (actually days) to do the following

  emerge xorg-x11
  emerge gvim
  emerge gnome
  emerge kde

After setting up the rc scripts as described above...

On windows, Start the Cygwin X server

run XWin -ac -rootless -nodecoration -lesspointer -clipboard -silent-dup-erro

IMPORTANT Wait till the "X" has appeared in windows before doing the following!

ssh into colinux, and from inside colinux enter the following commands

export DISPLAY=192.168.0.5:0.0
<-- use your Windows IP address!

metacity &
<-- Note that "kwin" also could work here, but causes the black
   background that you described, metacity works just as good.

kicker &
<-- yes just run it from here and voila, it works fine with metacity.
   and no black background when moving windows.

gnome-panel &
<-- well OK, maybe overkill having both, but goes to show, why not
   have all 3. (MS Windows, KDE Kicker and Gnome Panel)

Note that you can use the "kwin", and then you can use the theme manager found in "kicker", for the pretty stuff. But you have to put up with the black background problem with Cygwin/X when moving windows.

But, if you use "metacity" or "gnome-wm", then use the theme manager found in the "gnome-panel", for that Gnome look and feel. At least you can avoid the windows black background thing, and most of the theme stuff from kicker applies inside the K anyway. So the best of both worlds with this choice.

(end of CJP comment)

I have Kicker at the bottom, and Windows taskbar at the top, and lots of fun in the middle! Now all I need is some kind of brilliant combined desktop pager.

How it works:

  • (Works) Rounded window corners are transparent.
  • (Visual Defect) While drag-moving a window, the whole windows desktop   goes black and all I see are the X11 windows! But if this is the worst   problem, I'm content.

Launching X with a VNC server

(First, you must install some kind of window manager like kdebase or xfce4 (not a display manager like GDM or KDM). Later, you may wish to install better looking fonts. If you skip this step, you will stare at a grey screen with a lonely terminal in the top left corner.)

Use a VNC server on your coLinux system and connect to it with a Windows VNC client

Pros Edit

  • Lightweight when compared to Cygwin (useful for shorter download times and smaller disk space requirements).
  • Saves you from downloading and installing Cygwin if you don't need to run it.
  • In the event the VNC client crashes, you can easily re-launch it and connect to your original session without trouble.
  • You can connect to the VNC server from other machines on the network, allowing you to take your session with you.
  • Some VNC clients allow for sending certain special key combinations to the guest machine.
  • You can copy and paste text between Windows and Linux applications. ( Cygwin/X also integrates with the Windows clipboard. There are a few peculiarities, and integration isn't absolutely perfect, but it's usable under most circumstances. On some KDE instalations copy/paste wont work correctle due to a Qt bug)

Cons Edit

  • If you want to retain use of the Windows taskbar, you will have to scroll to see some parts of your Linux desktop or use a non-standard screen geometry like 1024x740 instead of 1024x768 to leave a gap. (For information on setting the screen geometry in a standard Xvnc server, type "man Xvnc" and look for information on the -geometry switch.)
  • It is likely more difficult to configure this if you'd like to login via XDMCP (see below) using GDM for example, whereas Cygwin/X supports this with a few simple modifications (two lines) to the configuration file.
  • On my system, it seems to be notably slower ( on my system with KDE 3.4 1200x1000 24bits 3ghz cpu 1gb ram, tightvnc server and client worked faster than plain Cygwin/X or FreeNX. The later loaded the CPU a lot! ( Remove tightvnc server and install realvnc server, it is a LOT faster than tightvnc!!))


Use VNC without XDMCP Edit

If you don't use XDMCP with VNC (this is easier to configure), you must launch the VNC server with the user you would like to use on your Linux Desktop.

First, you should install the VNC server on Linux :

apt-get install vnc-server

use 'apt-get install tightvncserver' wich performed faster on all my tests, even faster than FreeNX! Also you need to get the TightVNC client to get the speed improvements from http://tightvnc.com/

And then, you should install a VNC client on the Windows host. You can find realVNC there :http://www.realvnc.com/

(note : the following section may or may not be necessary)
Before trying to start a session : create a directory called .vnc in your home directory, then create a file called xstartup inside this directory. now add the following content :

#!/bin/sh
startkde &

(startkde or startxfce or something else, depending on your window manager) For gnome, the command is gnome-session

In order to start a session, you must launch the VNC server on Linux with the user you intend to use in the graphical desktop environnment.

vncserver :1 -geometry 1024x768 -depth 16

A good geometry to use is:

     vncserver :1 -geometry 1000x685 -depth 16

The task bar will be visible in most os's if using 1024x768.

The first time, you will be prompt to choose a password.

You should now see a message like

New 'X' desktop is colinux:1

The number at the end is important. This is the screen number.

Now, in your Windows client, you can launch the VNC viewer and fill the correct IP and screen number.

eg :

192.168.0.40:1

Note that you have to add the same screen number at the end of the IP, as mentioned during the launch of the VNC server. To change your vnc password, use vncpasswd.

If you can't seem to connect to your VNC server, it could well be that it did not start up correctly because of missing fonts. Check the log file in your .vnc directory. See Question 4 in the coLinuxIAQ about what to do.

How to stop the server :

vncserver -kill :1

Use VNC with XDMCP Edit

After installing VNC & Installing an XDMCP like (xdm, kdm, or gdm)

Go to /etc/X11/xdm/Xservers (or /etc/kde3/kdm/Xservers) and modify it.

change the line

0 local /usr/X11R6/bin/X ....

to

0 local /usr/bin/Xvnc -geometry 800x600 -depth 16

If you'd disabled your xdm, kdm, or gdm, renable it:

update-rc.d add kdm defaults

Next, time you open your Linux you'll automatically start an VNC server, or if you don't want to wait run:

/etc/init.d/kdm start

Now fire up VNC viewer and connect.

  • TODO* : Hum, I'm lazy now, it's your turn to write on VNC, KDM, export display via SSH... ;o)
  • Update* : Here's a link just make the adjustments to /etc/services and /etc/inetd.conf that are listed on this page. The patch is no longer necessary. You also have to setup XDMCP and GDM as above :

http://www.dei.isep.ipp.pt/~andre/extern/ixvnc.htm

You can also check out :

http://www.linux-mag.com/2003-03/guru_01.html

I haven't the time to read and to try but when I'll do, I'll made a sum-up there

Forwarding X over SSH Edit

On your coLinux machine Edit

  • Make sure you have ssh installed type:
      sshd 
    If sshd does not appear to be installed see: SSH
  • Set X11Forwarding to yes in /etc/ssh/sshd_config, Example:
     X11Forwarding yes
  • Then if you have sshd started, type, when you are root:
     killall sshd 
  • Start sshd:
     sshd 

On host machine (Windows) Edit

  • start your Xserver on Windows. If using Cygwin, type in Cygwin:
     Xwin.exe 

Cygwin SSH Client Edit

ssh client is part of the base Cygwin install.

ssh -Yf user@host xterm

An xterm should appear.

Putty SSH Client Edit

  • Start Putty on Windows, then click:
     ssh->Tunnels->Check "Enable X11 Forwarding"
    Click Session, type in the IP address of your colinux. In the majority of this wiki's
    examples we use:
     192.168.0.40
    Click Open at the bottom of the page
     login as: root 
     password: 
    Note: you have to set your root password to something, SSH
    does not accept empty passwords. To set, open up the coLinux console,
    login as root, then type:
     passwd 
    then enter your new password both times. Then exit Putty and
    start this step over again.
  • After you are logged in, type in Putty:
     xterm 
    and see it show up on your Cygwin X window.

You can use a batch file and the "plink" tool that is supplied with putty to automate this process, once you have it working.

Refactor this info Edit

If you'd like to VNC into a connection with SLIRP, you'll need to change the configuration just a bit, since you need to open the VNC server port or SLIRP won't allow the connection. First, you need to use a command-line configuration instead of the XML config file. Here's an example deb.bat file:

c:\colinux\colinux-daemon kernel=vmlinux cobd0=fs_4095Mb cobd1=swap_512Mb mem=256 eth0=slirp,"",tcp:5901:5901 root=/dev/cobd0

After "cobd0=", put the filename for your disk image file. After "cobd1=", put the filename of your swap image. To run a full KDE install successfully, you'll need to give coLinux 256MB of memory (mem=256). The 5901 is the port you'll be using for your VNC connection.


Now, install kde and vncserver:

apt-get install kdebase (OR apt-get install kde)
apt-get install x-window-system-core
apt-get install vncserver

To launch the VNC server, type:

vncserver -geometry 1000x650 -depth 16 :1

As a comment, 1000x650 is a good geometry on a 1024x768 monitor, modify it for your needs. Give the server an appropriate password when requested.

Now, start your favorite VNC client. For the address, type 127.0.0.1:5901. If all has gone well, you should start into KDE.

If the client fails to connect, check the log file of the VNC server (when you start the server, it'll tell you the location of the logs). If the server fails because it can't find a font file, apt-get install x-window-system-core.


Other Comments Edit

cygwin/X/SSH Two machines, coLinux on one and cygwin/X on the other Edit

My setup involves the use of remote machines to develop software, so I found the easiest way to initiate X withcoLinux is with SSH without the forwarded X options. The machines are within the same network, so I do not need to worry about a secure tunnel, and it is fast.

I assume you have an account already setup on coLinux that you normally use and can quickly use SSH to log into. If not, check out the guides on how to establish ssh-keys to log into machines without the password prompts. You'll need to do that first in order to execute remote commands with SSH from the local machine's CLI.

Once that is done then you can execute a command on the local machine with cygwin, like a .bat file the has:

start/b C:\cygwin\bin\ssh.exe -l username 192.168.0.40 bin/xsh.sh

in your coLinux directory have the bin/xsh.sh script look like:

#!/bin/sh
export DISPLAY=192.168.0.100:0
cd ~
nohup xterm >/dev/null &

That'll make a xwindow appear on your local machine. You'll have to update the IP addresses and such. The setup can be used for much more interaction than just to launch xterms from the local window taskbar but that's another story.

The ssh solution is light weight since there is no need to install gdm/kdm (and all the associated libraries) on colinux. It will work for a single computer as well as two machines. Note: there is also no need to include the -query option when X is started on the cygwin side.

Once X is running, type the following at a cygwin prompt:

ssh -l   "export DISPLAY=:0.0;  &"

The colinux window manager/desktop of your choice will then start up on X.

Similar to above, I've written a script to remotely run any individual X app from any host machine to the Cygwin X server through ssh. I use RSA and so I don't enter passwords, but that would be a trivial addition to the script. I've called it rx (for Remote X). For instance to run "xcalc -rpn" on the machine 10.0.1.1, you would run:

rx 10.0.1.1 xcalc -rpn

Here it is:

#!/bin/sh

# Simple script to run an X app from a remote machine through ssh

basename=${0##*[/\\]}

if [ "$#" -lt 2 ]; then
 echo "usage: $basename  " >&2
 echo "example: $basename amd xcalc -rpn" >&2
 exit
fi

host=$1;
shift
Xapp="$@";

# See if X is running
Xpid=`pidof XWin_GL`
if [ -n "$Xpid" ]; then
 echo "X is running"
else
 echo "X is not running. Starting X ..."
 run XWin_GL -ac -multiwindow >/dev/null 2>&1 &
fi

echo "Allowing X access for $host"
xhost $host

# Run the X app on the remote host

echo "Attempting to run \"$Xapp\" on $host ..."

# Assume X11R6 is installed

ssh -tf $host "
 export PATH=/usr/X11R6/bin:\$PATH &&
 DISPLAY=\${SSH_CONNECTION%% *}:0 &&
 DISPLAY=\$DISPLAY nohup $Xapp >/dev/null 2>&1 &
" >/dev/null 2>&1

nice how-to :

  • http://www.linuxjournal.com/article.php?sid=5499

Start VNC at CoLinux bootup Edit

Starting VNC on coLinux bootup

External Resources Edit

| Notes from James McDonald which include launching Xvnc from inetd.conf, and removing the local Xserver display invocation so you can still run xdm without it crashing.

VNC with TAP for Win2000 or WinXP - many examples Edit

Lots of info here:
http://www.cwelug.org/cgi-bin/wiki.cgi?CoLinux 

Also has some info on expanding your filesystem (add space to your coLinux disk), short comments about getting someone else to assist you online and building coLinux on coLinux.


Launching X with a FreeNX server/client

(summary : remote desktop solution, vnc-like, faster than vnc ( not on my case, see below) )


I installed it and it *is* very fast. Much faster than VNC. On their web page they say that it can even run faster than a native installation (If someone works out how to do this please report back. The default values are very fast anyway.).
It also has the possibility of streaming audio over the network, but haven't managed to get this working yet. (I am relatively new to all this, and do not consider myself an expert, by any means, so if you know how to get it working please write about your success here.)

This is how you set it up in debian:
add this line to your /etc/apt/sources.list:

deb http://archive.kalyxo.org/debian experimental main

(someday the packages will be in unstable and you don't need this line anymore)

This adress has changed to:

deb http://archive.kalyxo.org/ staging main

pgp signing key is at http://archive.kalyxo.org/kalyxo-key-2005.asc needed if using APT 0.6

kalyxo and freedesktop.org packages aren't there at present, so I got mine from:

deb http://debian.tu-bs.de/knoppix/nx/slh-debian/ ./
deb-src http://debian.tu-bs.de/knoppix/nx/slh-debian/ ./

i got another link to get another nxserver package, try this it might be useful

deb http://debian.tu-bs.de/knoppix/nx/skolelinux ./

I couldn't get any of those to work for me. So I went to the FreeNX site and came across the following paths for .debs in the downloads page.

http://kanotix.com/files/debian/pool/main/f/freenx/ 
http://packages.debianbase.de/

(and eventually)

apt-get update
apt-get install nxserver

Non-Debian users can get a copy of the software at http://freenx.berlios.de/. NoMachine's commercial version is also available. Fedora Core users should refer to Rick Stout's page for packages for their distribution.

NOTE: 
You can not run the client as "root" so you will have to add a user on colinux. 
This can be done by typing:

adduser -m NEW_USER

at the command prompt.

Then set up the nx server:

nxsetup --setup-nomachine-key
nxserver --useradd NEW_USER
nxserver --passwd NEW_USER
  • Get the windows client from NoMachine: http://www.nomachine.com/download.php
  • Set it up to Host 192.168.0.40 Port 22
  • Use the biggest memory cache if possible.
  • Disable SSL encryption for local connections. You may need it to get through a firewall.
  • You can also experiment if disabling zlib compression on local connections shows any benefit.

If you want to reach your colinux from the internet you may have to enable port forwarding for port 22 from your windows host to your colinux.

Recently I have successfully installed nxserver (the commercial version) on Debian image and prepared a step by step tutorial how to install it from scratch. Hopefully someone might be interested.

The Pros: Edit

  • Very fast and still usable over modem connection.
  • Usually runs faster than either VNC or X over the network ( not best option on highspeed networks due to cpu loads)
  • Only a small client for Windows needed. No need to install X/cygwin.
  • You can even suspend a session and reconnect to it later.
  • Printer and file sharing is possible.
  • Multimedia connection is possible.
  • Adjustable quality settings so you can use high compression for high latency connections, and little or no compression for low latency ones (like between coLinux and host)
  • Can run fully encrypted using SSH

The Cons: Edit

  • Requires a SSH server
  • Initial configuration with FreeNX can be problemmatic if you choose not to use NoMachine's key
  • Client can not handle changes to the host's resolution or color depth (connecting with Remote Desktop causes this problem)
  • Client doesn't always terminate properly (end all nx programs from task manager if you have troubles reconnecting)
  • One "gotcha" (generally true): if you previously installed cygwin on your system and it is not the EXACT version as NX client, you get strange failures when trying to run cygwin or NX client at the same time.
  • Can load your server alot thus causing slower speeds. On my system with KDE 3.4 1200x1000 24bits 3ghz P4 w/HT 1gb ram, tightvnc server and client worked faster than plain Cygwin/X or FreeNX. The latter loaded the CPU a lot! Editing a PHP file caused high cpu load, the same as dragging windows.
  • Contrary to Xming and Cygwin NX doesn't support Windows keyboard settings with Dead Keys as, for example, "English, United States, international". The Dead Keys will not be forwarded correctly to the Linux applications and you're stuck with setting the keys via xmodmap, which is not completely possible: key combinations like 'k leading to a non-existing accented character are just ignored, while Windows tolerantly falls back to the non-dead key handling. Thus you're forced to press 'k under Linux, which makes dead keys virtually unusable. --Brunod 15:28, 11 January 2007 (UTC)

To get streaming audio working you need to install the esd sound daemon and configure gnome/kde to use esound instead of ARTS or other audio backends. Sadly esd won't run on coLinux because it can't open a valid audio device (/dev/dsp etc). I believe the nxserver is using esdmon to split the sound stream for the nxclient.

Actually, esd supports tcp/ip connections. esdplay works great for me, but I haven't been able to make arts play well (just hangs artsd). While the display port is 7000-7999, the esd port will be 8000-8999. So add this line to your /usr/kde/3.3/env/agent-startup.sh:

[[ ${NX_VERSION|+1} ]] && export ESPEAKER=`~/nxespeaker.pl`

And put this into ~/nxespeaker.pl:

#! /usr/bin/perl
use strict;
use warnings;
use strict 'subs';

$_ = $ENV{'DISPLAY'};
if (/:(\d+)(\.\d+)?$/) {
 print "localhost:" . (7000+$1);
}

To fix the cygwin version problems, delete cygcygipc-2.dll, cygpopt-0.dll, cygwin1.dll, and cygz.dll from NXClient\bin directory. Then it will find the ones in your cygwin install. I also suggest deleting the special NX mounts from the registry (it changes your /tmp).

(As of version nxclient-1.5.138, some file names are different. cygccrypto-0.9.8.dll, cygjpeg-62.dll, cygminires.dll, cygpng12.dll, cygin1.dll and cygz.dll.)

Xming

  • Xming using the same code base as Cygwin/X without the dependence on Cygwin, much smaller and easier to install and use. Now available at http://www.straightrunning.com/XmingNotes, andSourceForge, due to lapsed maintenance of the old site.

Reportedly easier to install than Cygwin-Xserver, although with Cygwin you get so many other useful *nix tools.

dieselnutjob: Xming only works with XP, server 2003 or Vista, Windows 2000 isn't supported.

Note that you can still get an old version of Xming that works with Windows 2000 (6.9.0.18). See the Troublepage.

Xming will work with CoLinux with all of the Xming settings set to default, except that in the Xming installation folder there is a file called X0.hosts; the IP address of the CoLinux machine host must be added to this file.

Run the XLaunch windows application (comes with Xming) and follow all defaults options.

Now in CoLinux type for example

export DISPLAY=192.168.0.1:0.0
 xterm &

where 192.168.0.1 is the IP address of Windows and provided that you have xterm installed. You can view the log of Xming to see the IP address it is currently using.

You should now see an xterm window appear in Windows.

Adding the line

export DISPLAY=192.168.0.1:0.0

to /etc/profile makes the setting permanent, at least in Debian.

Full screen mode

If you run XMing in full-screen mode with xdm and friends, you can switch between Linux and Windows by clicking on the bottom line of the screen, by pressing Ctrl+Escape, and by pressing Alt+Escape. This gives a Linux look and feel, and you can switch Linux applications with Alt+Tab.

The xlaunch file for full screen mode looks like this:


X-WIN32

Commercial.

  • http://www.starnet.com/en/products/ - Xwin32

Gniarf tried it out for the 2-hour evaluation period and liked it. Supports XDMCP protocol.

Someone reported that xterms from Gentoo crashed X-WIN32 regularly

SamuelMoffatt reported that Starnet offers a free X server (called LX) for _local_ only connections. "I have tested this and if you use SSH tunnelling to a remote PC, the X server will quite happily display its output. Its like to the Microsoft Services for Unix (SFU) pages. Requires a token registration and is free."

LX isn't available anymore... This product was developed for Microsoft's Services for Unix 3.5. Recently, Microsoft has removed LX from its web site as the company has decided to move Interix and other SFU components into the UNIX subsystem of Windows Vista and server 2003 R2. SFU is still available and will be supported for a couple more years. But no new upgrades will be made available. For these reasons, StarNet has decided to discontinue the general availability of X-Win32 LX.

xRDP

coLinux with xRDP for a Windows Remote Desktop Connection

XwinLogin

A mini Cygwin/X package (24 Mo) : http://www.calcmaster.net/visual-c++/xwinlogon/


pexus

Freeware, but closed-source.

  • http://www.pexus.com/ : X-Deep/32, Pexus' freeware x-server is convenient and well-featured, but somewhat slow (not faster than VNC).
  • The freeware X server provided at pexus.com is unmaintained and provide very poor performances compared to Cygwin/X X server. While much easier to set up, I highly recommend you to check out Cygwin if you wish to do anything more than a screenshot with your desktop.
  • Well it met and exceeded my expectations. I'll just mention the "performance" are ok on most application as long as they don't use Pango. It is application dependant.
  • Open GL is not supported with X-deep/32

Notes to Move Elsewhere

I updated SoundSupportInColinux with some more details and (I think) a cleaner solution, which works for both GNOME and KDE.

To paste from Microsoft Windows clipboard to xterm, use - key. From xterm to Microsoft Windows, just highlight with mouse in xterm, then move to a Microsoft Window and (paste).

External Links

  • http://www.hummingbird.com/products/nc/exceed/index.html - Exceed PC X Server
  • http://www.microimages.com/mix/
  • http://www.wrq.com/products/reflection/ - WRQ Reflection X
  • http://www.netsarang.com/products/enterprise.html ---> Xmanager Enterprise

Please add links to any other X server solutions

To Sort


After trying all the options here for running X, i found that CygwinX_GL (experimental) is really fast for running X. Although GL support is very limited (not realy usable) it has some form of hardware accel and helps running KDE very smooth (even Firefox runs at *almost* native speeds (exept for some sites)). Ive tried VNC and FreeNX too but found both noticable slower than CygwinX_GL.

this doesn't entirely surprise me: the normal windows gui drawing routines are slow as hell at certain operations (notablly stretchblitting stuff to the screen)

i have a firend who wrote a gameboy emulator in normal gdi mode running it maximised leads to huge frameskip. in directdraw mode it works fine maximised with no frameskip whatsoever


I have been struggling with vnc always showing a grey screen after following all the instructions here. Also, I was constantly getting an error every time I start vncserver saying:

xauth: (Argv) : 1: Bad display name "colinux:1" in "add" command

Both problems were fixed by editing /etc/hosts and adding (with different IP)

192.168.0.40 colinux

--colinux and a native Xwin server--

1) install Xming (fully documented and easy install) a fast reliable Xwin server with a graphical launcher ... and faster than XFree86 or Xorg on cygwin

works good with cygrunsrv as a service (I think you will find Xming doesn't use any Cygwin service!)

i suggest the native windows mode (so your unix and win32 progs run in the same windows with the same manager)

2) launch colinux with a tap device colinux-daemon ... eth0=tuntap,"TAP-CONNECTION-NAME" ... (make sure the tap connection name is the one that is displayed in windows)

MAKE SURE EITHER THE DEFAULT GATEWAY IS EMPTY IN WINDOWS OR YOU KNOW WHY IT IS NOT !!

3) configure linux and windows with adresses on the same subnet (and better keep the subnetmask small just in case it wants to interfere)

let's say for example : linux->192.168.60.11, windows->192.168.60.10

4) on windows, run xhost +192.168.60.11 (this will accept incoming x connections from the linux machine) ... and this only works when cygwin is installed, please stick in the pure Xming method anyone if you stumble upon it before i do. (use the -ac parameter on trusted networks as Xming doesn't provide a xhost program, Xming should be used with SSH X11 forwarding on insecure networks)

5) on linux, run the following command xterm -display 192.168.60.10:0 &

... and see the xterm popping on the windows desktop

this work tremendously well when you launch kicker on a corner of the screen

KDE apps work with no visible speed difference from what you may experience with a native linux on a fast computer ... and the cygwin KDE is REALLY SLOW in comparison (on a P4E 3GHz) so just imagine on old hardware

6) my own advice if you are in a LAN behind a router or if your FAI like mine will let you run several PPP concurrent sessions use a PCAP connection on the linux for the rest of the networking just to keep thing separate these work fine with PPPoE connections, DHCP, and a few things


---note concerning portability and thing that could be done

there should be enough space on modern USB stick to stick in a fully graphical linux and Xming as an Xserver ... but with the tap device method you still need to install the tap device driver (i'm using a customised Knoppix but a Damn Small Linux or better a custom dist should do fine)

i guess in this case, a Pcap adapter would be better (and maybe the ssh method is better as well) in either case, if anyone can give a way to send linux the ethernet address it should use, we could have a nice batch file that would detect the current windows address, launch an Xserver, set the proper authorisation and finally launch colinux, all in one step, from a simple usb stick, and on any computer providing it has an IP address

perhaps there is a hack to bridge output from a loopback interface to another (using 127.0.0.x where x is definitely not 1) and this could do the trick as well ?

i tested this portable setup using the MUST-HAVE cygwinX live CD, and it worked just fine... but still not fully automated as it should be...




In some LANs there is no other way than having both XP and coLinux on DHCP. Unfortunately, in these LANs, there is also no DNS for local machines but only WINS. If you want to automate the export DISPLAY=... stuff, here's the solution I came up with:

1) Do an apt-get install smbclient.

2) Paste this into a file named fetchhost

DISPLAY=$(nmblookup $@|grep $@\<|cut -f1 -d' '):0.0
echo "Found[$@]: $DISPLAY"
export DISPLAY

3) call it in the lines of:

. ~/fetchhost <[[YourXPBoxNameInWhatMS Calls A Work Group]]>

in your .bashrc, init.d script or wherever you like. Note the leading dot.

If you need to run a webserver from within coLinux in such a LAN, do an apt-get samba and configure samba to add your coLinux to the WINS server using nmbd. Don't forget to give your samba config a distinguished name of less than 13 characters (!) and to join an exsiting workgroup on your subnet. If you're paranoid, just run only nmbd from inetd.

Thanks to coLinux, I'm happily running my own development wiki on a corporate Windows only LAN and I can shift it from one Windows workstation to another as fast as I can zip and burn my coLinux folder to a CD without leaving a trace! Now try this with an apache install on XP ;)


MassTranslated  on 25 Dec 2004.

ManuallyAdjusted on 25 Dec 2004.


MassTranslated on Sun Apr 23 17:37:05 UTC 2006


shared from: http://colinux.wikia.com/wiki/XCoLinux#XDMCP_with_GDM

你可能感兴趣的:(Linux,linux,colinux,X,server)