Friday, September 25, 2009

Cygwin on WinXP/Vista as an X Client

Most of us know cygwin as one of the best/easy Linux-like emulation on WIN/x86 platform. Cygwin also offers a graphical UNIX/LINUX client terminal (unlike putty that's just a character console).
To install/configure cygwin refer Shuva's blog on cygwin.

We can "ssh" to any X machine and open up a full fledged X console (KDE, GNOME etc. for Linux) in 3 steps:

1) From within the cygwin bash terminal, run:
$> x&
$> wmaker&
This will open up the cygwin GUI console that offers many utils as an X Client, including the XTerm.

2) Open Xterm on the wmaker console (right click and select Xterm)

3) On the XTerm command prompt run:
xhost +

4) login to the X host (the UNIX/Linux host to which you want to connect)
e.g.: "ssh username@hostIP"

5) Now that you're logged in to the UNIX/Linux machine, export its Display to your Windows machine IP (where you're running Cygwin) as:
$> export DISPLAY='X.X.X.X:0.0'
where X.X.X.X is your Windows machine IP (the character after : is "zero")

6) Start any X console, like:
$> startkde&
or
$> startX

... and voila!!! You can now see the GUI from your UNIX/LINUX host exported to your Windows client and running within the Cygwin wmaker terminal window. You may even export any other GUI utilities (like web-browser: firefox or email-client: evolution) and run/control them from your WIN client.

All said and done, this is a great, free and easy way to RDP to your UNIX/LINUX GUI console from your WIN box. But, things can go wrong sometimes with Cygwin.
Couple of usually faced issues are described below:

1) When you try to open Xterm window in wmaker (or try any other wmaker util), it doesn't open up and gives an error:
<<<
440 [main] wmaker: 1432 bash: fork_copy: linked dll data/bss pass 0 failed
>0x542000..
>0x5427F0, done 0, windows pid 1960, Win32 error 487
cannot fork a new process: Resource temporarily unavailable
fork failed: resource temporarily unavailable
>>>

Solution:
On your cygwin bash shell:

1) Check if you already have "rebase" package installed (/usr/bin/rebase and /usr/bin/rebaseall)

2) If yes, run the command:
$> /usr/bin/rebaseall
Now, try to open an XTerm window in wmaker and you should be good to go!

Note: Cygwin documents the need for a rebase/rebaseall for some packages/upgrades (like /usr/share/doc/cygwin/python-*.README)

Cygwin FAQ says:
Whether a rebase is required depends on several factors -

1) which packages you've selected (during an install or upgrade)

2) whether those packages have been compiled with --enable-auto-image-base.
The rebase is only required for certain packages, particularly
those that use dynamically loaded modules such as python or perl.

But, the fact is that running "rebaseall" does solve the above issue!

2) Cygwin bash shell (terminal) in WIN Vista doesn't open up fine; won't let you run basic commands; Permission Denied issues!

Solution:
The workaround is to run the Cygwin shell as Admin (before that, activate the real Administrator account)

a) Run Vista command prompt:
cmd

b) execute the following commands:
cd c:/cygwin/bin (or wherever cygwin is installed)
runas /user:Administrator bash

This would start cygwin bash shell with the Administrator account.
To setup the environment for Admin user properly, copy the skeleton files to admin's home folder /home/Administrator/:
execute the following command from the cygwin bash prompt:
. /etc/profile

While Cygwin, being a traditional one out there, works for most of us there are X clients like Xming that provide better GUI's and are compatible w/o tweaks with most WIN verrsions.

2 comments:

Anonymous said...

[url=http://www.23planet.com]casino[/url], also known as accepted casinos or Internet casinos, are online versions of important ("chunk and mortar") casinos. Online casinos approve gamblers to contend in and wager on casino games to a t the Internet.
Online casinos superficially make known forward odds and payback percentages that are comparable to land-based casinos. Some online casinos take higher payback percentages during place side games, and some announce payout pastime audits on their websites. Assuming that the online casino is using an aptly programmed indefinitely consider up generator, suit clear to games like blackjack be blessed an established congress edge. The payout go together lessen of these games are established via the rules of the game.
Uncountable online casinos lease in default or acquire their software from companies like Microgaming, Realtime Gaming, Playtech, Worldwide Deception Technology and CryptoLogic Inc.

Anonymous said...

top [url=http://www.xgambling.org/]casino[/url] hinder the latest [url=http://www.realcazinoz.com/]casino[/url] free no set aside hand-out at the chief [url=http://www.baywatchcasino.com/]www.baywatchcasino.com
[/url].