Sunday, August 31, 2008

Install Cygwin with KDE Desktop

This tutorial is mainly aimed at all those frustrated souls who made several futile attempts of installing Cygwin with KDE Desktop environment. I am one of those frustrated souls who finally succeeded in installing the same and would like to help my fellow netizens to be successful. Long before, during my internship I used to work on unix using Cygwin with KDE desktop on top of it and was totally impressed by the flexibility and the user friendly features it provides which is the only reason for struggling almost 2 weeks to install the same on my machine.

I would like to put this tutorial in such a way even a novice programmer or even a fresh man of the college can install Cygwin with KDE desktop. So, I am making some that the person reading this tutorial no experience of installing either Cygwin or KDE. The latest Cygwin DLL release version I used is
1.5.25-15.

So, lets start the installation. Just blindly follow the instructions listed below:

1) Download the Cygwin installation executable from
http://www.cygwin.com/ . (I assume that you are intelligent enough to download the setup.exe file from this site)

2) The setup.exe itself is a very small file, the installation downloads all the required files from the internet and does the setup.

3) Start the setup.exe - you should encounter something as shown in Image 1.

Cygwin Installation - Image 1

4) Click "Next" and proceed.

5) In the next screen, you will encounter three options, the first option is actually combination of the next two options. If you are reading this blog, I suppose you are installing Cygwin for the first time and advice you to select option 1. Cygwin setup first downloads all the requried files and later installs them one by one. Select required option and proceed further by clicking "Next".

Cygwin Installation - Image 2

6) In the next screen you will be asked to give the location of the root directory, leaving the default values doesn't do any harm. So, don't touch any thing and lets proceed.


Cygwin Installation - Image 3

7) Next, location where to store the downloaded files, its a personal preference, give any location where you want to store the installation files.


Cygwin Installation - Image 4

8) In the next screen, select the option based on your internet settings.

Cygwin Installation - Image 5

9) After clicking Next, the installer downloads the list of mirrors from where the packages for Cygwin will be downloaded. Choose the mirror closes to you for faster download time. Please note that these files are very large, so spare some time to choose a mirror nearer to your location. The list of mirrors locations are given at http://www.cygwin.com/mirrors.html .Check out this page to make a decision on the list of mirrors nearer to your location.


Cygwin Installation - Image 6

10) On clicking Next, the installer downloads the information files from each of the selected mirros and shows a page with all the available packages. This is the most crucial and difficult part of the installation. To make things easier, just do as listed, If you are making any other choice, I assume that you know what you are doing. Click "View" button, to show the "Categorical" view of all the available packages. In the top node, of the tree, you will find node "All" and "Default" next to it. Just click on "Default" untill you get "Install" in the location of "Default". Install being just blindly install all the available packages. If you are intelligent enough to make a right decision on what packages you require, then you are most welcome to do so.



Cygwin Installation - Image 7


Cygwin Installation - Image 8

11) This time, when you click "Next", the installer will start downloading and unpacking the packages. Once all the downlading is done (Go and have a jog or some snacks or atleast have a cup of tea.. ;)) it will take some time.. (not some, a long time to download and install all the packages).

12) Be prepared to encounter few error messages, but donot panic. ;) (I encountered this error message a lot of times saying "Error while downloading the packages" at 99%, you can imagine how irritating it would be after waiting for 5-6 hours for complete download)

13) After step 12, you are all set with the Cygwin installation, but you still need to set some environment variables to finish the Cygwin installation.

14) Right Click on the "My Computer" icon and select Properties from context menu and select "Advanced" tab. At the right bottom corner, you will find a button "Environment Variables".

15) Click the button and you will find the "Environment Variables" page.


Cygwin Installation - Image 9

16) Under the System Variables, you need to add the cygwin path to the "Path" variable.
Edit the "Path" variable and add the following locations to that.

c:\cygwin\bin;c:\cygwin\usr\bin;c:\cygwin\usr\X11R6\bin

17) Add a new variable, with Variable name : "DISPLAY" and Variable value : "127.0.0.1:0.0".

18) Now you are totally done with Cygwin Installation. Lets proceed with installation of KDE Desktop.

19) Now, follow this link http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/ and download the required packages.
Note: The next few steps need to be executed in Cygwin bash shell
20) Open the Cygwin Bash Shell, and download the required packages.
wget -nd http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/qt-x11-free-3.3.4-1.tar.bz2
wget -nd http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/kdelibs-3.4.1-0.tar.bz2
wget -nd http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/kdebase-3.4.1-0.tar.bz2
wget -nd http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/kdepim-3.4.1-0.tar.bz2
wget -nd http://webdev.cegit.de/snapshots/kde-cygwin/kde/kde3.4/kdesdk-3.4.1-0.tar.bz2

tar -C / -xjf qt-x11-free-3.3.4-1.tar.bz2
tar -C / -xjf kdelibs-3.4.1-0.tar.bz2
tar -C / -xjf kdebase-3.4.1-0.tar.bz2
tar -C / -xjf kdepim-3.4.1-0.tar.bz2
tar -C / -xjf kdesdk-3.4.1-0.tar.bz2


21) Make sure that no Cygwin process is running.
1. create file list
find /opt/qt/3.3 /opt/kde3.4 -name '*.dll' >/tmp/files.lst
2. close *ALL* cygwin processes
3. open a windows command shell (cmd.exe) from Start/Run and goto cygwin installation root
cd c:\cygwin bin\ash bin/rebaseall -b 0x61000000 -v -T tmp/files.lst

22) With this now we are done with the KDE installation. But we need to write a small script to start KDE desktop.

cat >~/startkde #!/bin/bash
cygserver &
export CYGWIN=server
export SHELL=/bin/bash
xwin -fullscreen -noreset &
xwinclip &
xhost +
/opt/kde3.4/bin/startkde
kdeinit_shutdown
taskkill /IM xwin
taskkill /IM xwinclip
taskkill /IM cygserver

[press ENTER, then CTRL-D]

chmod a+x ~/startkde

now you can start kde with

~/startkde &

23) To display only kicker (uses Xwin multiwindow mode)

cat >~/startkde
/usr/sbin/cygserver &
export CYGWIN=server
export DISPLAY=127.0.0.1:0
xwin -multiwindow &
xwinclip &
xhost +
export SHELL=/bin/bash
kdeinit +kicker &

[press ENTER, then CTRL-D]

chmod a+x ~/startkde

now you can start kde with

~/startkde &

stop kde - run

kdeinit_shutdown

then close the bash window

24) This ends the tutorial for Installing Cygwin with KDE Desktop. Have fun.



No comments: