This is a long guide on how to get coLinux up and running in a graphical UI (KDE). The goal is to get an X-Server running in coLinux, and connect to it using VNCViewer from Windows. What you need is (read: what I've used):
- debian distribution (only 18mb)
- extra packages from the debian website
- VNC client, VNCViewer from http://www.realvnc.com
This installation assumes that you have a dial-up connection to the internet, Windows 2000, and a standalone pc (without a network). It might be simple to get it working with other connections to the internet, by changing the properties of an ethernet card (if you're using a cablemodem or ADSL) instead of the Dial-up adapter.
If you need a preconfigured easy to install colinux distribution with KDE-Window, networking and file-sharing you can find one at http://www.opensource.eu.com/colinux/
coLinux 0.6.1 and XP SP2 with PAE
Version 0.6.1 has an issue with PAE, which is enabled by XP SP2 (it implements DEP/NX, which activates PAE as
well). If you want to use 0.6.1 with XP SP2 disable DEP/NX and PAE, by adding the switches
/noexecute=Always Off /NOPAE to your boot.ini BEFORE you install coLinux 0.6.1.
This might apply to coLinux 0.6.2 too (FIXME: verify that claim) (Windows XP SP2 machines yielded very different results for me. The main machine I had been working on would reboot if I attempted to run coLinux without the bootflags. The other machine operated perfectly fine without them and would start coLinux without a hitch. The hardware was very similar but apparently different enough - the troublesome machine's behavior continued after a fresh install of XP. -- asmclean)
"AlwaysOff" needs also for all current coLinux version with very new CPU and hardware support for noexecute NoExecuteDEP
Execute coLinux installation
To start, download two packages from the coLinux site. One must be the latest coLinux system (coLinux-0.6.1.exe) and the other one your actual file system, a pre-installed GNU/Linux system. We'll use the Debian system for the purpose of this guide.
With version 0.6.1, installation is easier than ever. Download and run coLinux-0.6.1.exe. The tap device and everything else will be taken care of. During the installation, download the Winpcap_3_0.exe file from http://www.winpcap.org/install/default.htm. Version 3.1 beta doesn't work for me (no network connection with my Windows box). Version 3.1 of winpcap should work for colinux 0.6.2 and above (but not with colinux 0.6.1). Also, for simplicity's sake, change the installation directory to c:\coLinux. Don't download the Debian image during the installation.
After the installation, if you go to "C:\coLinux" with explorer, you'll see the following files ("[ ]" means directory, list of files for colinux 0.6.2):
Get a Linux distribution
For this example we use the Debian root image that's provided on the coLinux downloads page from the Sourcefourge site.
Under "Root Filesystem Images" you'll see the Debian-3.0r0.ext3.1gb.bz2 file. Download it. The file system (18MB) will decompress to 1Gb. Do not worry about that yet, just be sure now that you will have enough free space.
Decompressing .bz2 files
The Debian Root filesystem image has been zipped as a .bz2 file. This is a kind of compression format. To unzip it, use a tool that can unpack .bz2 files. A good one is TUGZip: http://www.tugzip.com. It's pretty intuitive, so I won't go into that here.
Unzip the the Debian-3.0r0.ext3.1gb.bz2 file to C:\coLinux with TUGZip. This will take a while (unpacked it will be > 1G). Unzipped, the file will have the name Debian-3.0r0.ext3.1gb. This is also the name we'll later use in the configuration file.
The images that coLinux provides may not be big enough for your needs, especially if you plan to install Gnome or KDE. Here's a nifty little program you can use to increase the size of the image file: toporesize.zip (contains currently a .txt file with a dead link, program not found with Google) (toporesize can now be found at ).
Create a swapfile
We need a file of a fixed size which will be used as our swap partition. The size chosen for this file will determine how large your swap partition is. Download one of these zipped dummy swapfiles in various sizes provided by <Gniarf>: http://gniarf.nerim.net/colinux/swap/ (the filenames indicate the size of the provided file in MB). Take a file with as much MB as your physical RAM. For example: Physical RAM: 512 MB --> Swapfile "swap_512Mb.bz2".
(To get the amount of Physical ram, see My computer --> Properties)
Unzip the swapXXXMb.bz2 file to "C:\coLinux". Unzipped, the file will have a name like swapXXXMb. This is also the name we'll later use in the configuration file.
CoLinux needs a configuration file, previously default.colinux.xml in the directory you've installed coLinux into (formerly C:\coLinux, now "C:\Program Files\coLinux"). The new Configuration file format is plain text. You should create a default.conf from the example.conf provided.
There's already a default file in C:\Program Files\coLinux. Edit an XML configuration file with Wordpad. Not in Notepad, because it's in a Unix format, and Notepad doesn't display it very nicely. The new text version doesn't have this issue.
This is how mine looks (Cherlin 17:30, 22 August 2008 (CDT)). Note that some elements are out of date. Fix your installation directory, and set up your Windows-coLinux connection. It used to default to slirp, but now TAP-Win32 is installed automatically. My eth0 is set up as
network index="0" type="tap" name="coLinuxTap" eth0=tuntap
I also had to check the Tap adapter settings, and edit /etc/network/interfaces, as documented in the network setup procedures on this Wiki.
# # This is an example for a configuration file that can # be passed to colinux-daemon in this manner: # # colinux-daemon @example.conf # # Note that you can still prepend or append configuration and # boot parameters before and after '@', or you can use more # that one '@ to load several settings one after another. # # colinux-daemon @example.conf @overrider.conf mem=32 # # Full list of config params is listed in colinux-daemon.txt. # The default kernel kernel=vmlinux # File contains the root file system. # Download and extract preconfigured file from SF "Images for 2.6". cobd0="c:\coLinux\root_fs" # Swap device, should be an empty file with 128..512MB. #cobd1="c:\coLinux\swap_device" # Tell kernel the name of root device (mostly /dev/cobd0, # /dev/cobd/0 on Gentoo) # This parameter will be forward to Linux kernel. root=/dev/cobd0 # Additional kernel parameters (ro = rootfs mount read only) ro # Initrd installs modules into the root file system. # Need only on first boot. initrd=initrd.gz # Maximal memory for linux guest #mem=64 # Slirp for internet connection (outgoing) # Inside running coLinux configure eth0 with this static settings: # ipaddress 10.0.2.15 broadcast 10.0.2.255 netmask 255.255.255.0 # gateway 10.0.2.2 nameserver 10.0.2.3 #eth0=slirp # Tuntap as private network between guest and host on second linux device #eth1=tuntap # Setup for serial device #ttys0=COM1,"BAUD=115200 PARITY=n DATA=8 STOP=1 dtr=on rts=on" # Run an application on colinux start (Sample Xming, a Xserver) #exec0=C:\Programs\Xming\Xming.exe,":0 -clipboard -multiwindow -ac"
<?xml version="1.0" encoding="UTF-8"?> <colinux> <block_device index="0" path="\Dos Devices\C:\coLinux\Debian-3.0r0.ext3.1gb" enabled="true"/> <block_device index="1" path="\Dos Devices\c:\coLinux\swap_512Mb" enabled="true"/> <bootparams>root=/dev/cobd0</bootparams> <image path="vmlinux"/> <memory size="128"/> <network index="0" type="tap" name="TAP"/> </colinux>
In previous versions it was necessary that you'd keep the textfile in Unix format, but since coLinux version 0.6.0 that's not necessary anymore.
If you want network sharing to work don't forget to change "TAP" into "Local Area Connection 2" or "coLinuxTap" or whatever you called it on your system.
Save the document.
When Wordpad asks something about converting the text of an XML file and discard formatting, click [Yes]. Now you'll also be able to edit it in Notepad.
Enable Connection sharing
To be able to establish an internet connection from coLinux, we will need to make a connection between the Dial-up adapter and coLinux. This will be done by NAT (Network Address Translation). Make sure that you're not connected to the internet with your dial-up connection.
(Be advised: The following procedure would not work on winXP Home Edition; not in any way shape or form.)
- Control Panel -> Network and Dial-up Connections:
- Select the dial-up connection --> Properties --> Tab Sharing -->
In my case in the list, it says:
- Local Area Connection 2
Select the Local Area Connection 2. It might show a different number on your pc. This is the TAP-Win32 Adapter that was installed by the coLinux installation. The TAP-Win32 adapter will connect coLinux and my dialup-connection with the internet. Click the checkbox "Enable Internet Connection Sharing for this connection", so that it is selected.
Windows will show a window with a message that it assumes that the LAN adapter (TAP-Win32 Adapter) should be set to IP address 192.168.0.1.
This means that we'll have to activate the TAP-Win32 adapter. But, this is not yet possible, the TAP-Win32 adapter will only be activated when we start coLinux.
Batchfile to start coLinux
Make a colinux.bat file with the following contents (or just use a shortcut and put this option in the Target field):
"c:\Program Files\coLinux\colinux-daemon.exe" @default.conf
or whatever your configuration file name is.
Old form for XML configuration files:
colinux-daemon.exe -t nt -c default.colinux.xml
Place it in "C:\coLinux". This batchfile will later be used to start coLinux in a console.
If you specify the -t nt when starting coLinux, it creates only 1 window, and you'll see a prompt (very handy when you're editing a textfile, so that you know where you are). It also overwrites the linux kernel startup information, so you should leave it at the default -t fltk setting if you need this information.
If you want to capture linux startup information, you may also want to change the screen buffer size in the properties window reachable by right-clicking on the dos prompt icon in the upper left.
Start the batchfile colinux.bat.
You'll notice, that the "Local Area Connection 2" in the system tray (that was "unplugged" according to Windows and showed a red cross) suddenly disappears. That means the virtual adapter is connected.
If everything goes well, it will say:
Debian GNU/Linux 3.0 colinux tty1 colinux login:
Log in as root with no password (remember you are still on Windows ;). (Note: 2.6.x password is root) You'll be in the root file system, still just a single file on your Windows drive.
Working in coLinux
This is just a very brief description of what you can do now on the command line to get you going.
If you use df -kh to see used space, you'll see the following lines:
Filesystem Size ~[[Used Avail]] Use% Mounted on /dev/cobd0 1008M 91M 865M %10 /
This is a very basic system with just enough installed to use networking.
Here's a couple of commands to get you started in the Linux shell:
- cat - just like the "type" command under Dos.
- ls - just like the "dir" command under Dos.
- ls -l - just like the "dir/p" command under Dos.
- cd .. - change to directory level above, same as Dos, but note the extra space between "cd" and "..". In Linux this is necessary.
- cd / - change to root directory, same as in cd \ in Dos.
- cd /etc - change to directory "etc", same as cd \etc in Dos.
- clear - "Clear screen", same as cls in Dos.
- df -kh - show the current disk usage
- shutdown -h now - shutdown coLinux
To practice this a little, type:
clear cd / ls
Now you'll see the contents of your root filesystem.
If you want to close coLinux again, it's not a good idea to simply close the coLinux console window. You should use:
shutdown -h now
This will start a shutdown sequence immediately "now" (taking a few seconds) and will power down the linux when it's finished. This "power down" will tell coLinux to quit it's windows part too.
Setting up networking
The process of setting up your network depends on how you are connected to the internet. As wouter_cx says below, the following manual assumes you are not connected via a home LAN or permanently to a DHCP server.
As a rule of thumb, if coLinux is on a computer ...
- ... that dials directly to the internet and doesn't serve anything else, try the following manual.
- ... that dials directly to the internet and also serves the internet connection to a home LAN, you might try this manual.
- ... which connects to the internet through another computer on a home LAN, try this manual.
- ... that is permanently connected to a DHCP server (e.g. in a college dorm), you might try the native XP bridged connection outlined in this manual, which also describes NAT networking. -- bbeck
The focus of this manual is on a dialup connection, and I don't have a home lan/cable modem/router... -- wouter_cx.
If 192.168.0.1 is already in use, try 192.168.0.2. That means you would have to modify all the occurrences of 192.168.0.1 in this manual to 192.168.0.2.
If you go tweaking the network settings to get it working, make sure that your firewall software is not running, it could save you a lot of trouble. For permanent solution, firewall software needs allow traffic between coLinux and Windows host. Add TAP-Win32 Adapter or 192.168.0.1 to trusted network sources.
+------------------------+ | TAP-Win32 Adapter | +-----------------------+ | (gateway) | | coLinux <--|-------|--> | | | | IP:192.168.0.1 | | | | netmask: 255.255.255.0 | | IP: | +---|--> | | 192.168.0.40 | | +------------------------+ | netmask:255.255.255.0 | | +------------------------+ | gateway: 192.168.0.1 | | | Dial-up connection | +-----------------------+ | | | +---|--> | | | +---|--> | | | Dynamic IP (DHCP): | | | 184.108.40.206 | | | netmask: 255.255.255.0 | | +------------------------+ +------------------------+ | | Provider <-|--+ | | | DNS: 220.127.116.11 | | 18.104.22.168 | | | +------------------------+
Your coLinux session needs an IP address on the same network as the network interface that serves as your gateway. Change the values in the file /etc/network/interfaces. You can use nano as your editor. Start nano with the interfaces file:
Basically, all you should know about Nano at this moment, is the following commands:
Use the arrow keys to move in the file. This is how it should look like:
1. Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
1. /usr/share/doc/ifupdown/examples for more information.
auto lo eth0
iface eth0 inet static
iface lo inet loopback
They're also compatible with the default Windows Connection sharing settings which make the IP of your TAP-Win32 Adapter 192.168.0.1. The lines starting with 1. are comments, you won't have to change them. When you're done, press Ctrl-O.
Nano will ask "File Name to write: interfaces". Press [Enter].
Now the file is saved to disk, it says "Wrote 10 lines". Press [Ctrl-X] to exit Nano.
When you're back at the prompt, type "clear" to clear the screen of the remains that Nano left on the screen.
In Windows, go to Control Panel -> Network and Dial-up Connections:
Select the dial-up connection --> Properties --> Tab Sharing
Select the Local Area Connection 2. This is the TAP-Win32 Adapter that was installed by the coLinux installation. The TAP-Win32 adapter will connect coLinux and my dial-up-connection with the internet. Click the checkbox "Enable Internet Connection Sharing for this connection". [OK]
ncryptor: This didn't work for me. After more than an hour of trying i made it work by activating Internet Connection Sharing on the dial-up instead on the TAP.
Windows will ask you if you the LAN adapter (TAP-Win32 Adapter) should be set to IP address 192.168.0.1. [Yes]
To show your IP configuration in Windows, start a Command shell, and type:
This is how my configuration looks like now:
Windows 2000 IP Configuration Host Name . . . . . . . . . . . . : wouter_cx Primary DNS Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Broadcast IP Routing Enabled. . . . . . . . : Yes WINS Proxy Enabled. . . . . . . . : No Ethernet adapter Local Area Connection 2: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : TAP-Win32 Adapter Physical Address. . . . . . . . . : 00-FF-1F-4B-2F-3B DHCP Enabled. . . . . . . . . . . : No Autoconfiguration IP Address. . . : 192.168.0.1 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : DNS Servers . . . . . . . . . . . : PPP adapter hetnet: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : WAN (PPP/SLIP) Interface Physical Address. . . . . . . . . : 00-53-45-00-00-00 DHCP Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 22.214.171.124 Subnet Mask . . . . . . . . . . . : 255.255.255.255 Default Gateway . . . . . . . . . : 126.96.36.199 DNS Servers . . . . . . . . . . . : 188.8.131.52 184.108.40.206 NetBIOS over Tcpip. . . . . . . . : Disabled
In Linux, the command ifconfig shows the network configuration in the same manner with the "ifconfig" command. Type ifconfig in the coLinux console:
eth0 Link encap:Ethernet HWaddr 00:4A:41:52:45:4B inet addr:192.168.0.40 Bcast:255.255.255.255 Mask:255.255.255.0 UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1 RX packets:53 errors:0 dropped:0 overruns:0 frame:0 TX packets:48 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:8750 (8.5 Kb) TX bytes:5008 (4.8 Kb) Interrupt:2 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
In Windows, type
and you should get a reply from the coLinux session.
Do a ping 4 192.168.0.1 in coLinux to see if we have a network connection to the Windows host:
ping -c 4 192.168.0.1
Ping -c 4 means: ping 4 times. In Windows, ping will stop after 4 pings by default, but in Linux it will ping forever if you don't stop it... Anyway, you can stop it by pressing Ctrl-C.
To get internet access we will need to set up the DNS first by editing etc/resolv.conf with Nano.
You can find what DNS server your ISP uses by running ipconfig /all in a Windows command shell. Under the heading "PPP adapter ..." you'll see something like:
DNS Servers . . . . . . : 220.127.116.11 18.104.22.168
Adapt your resolv.conf file to match these two DNS Servers.
Now make a connection to the internet with your dial-up adapter. When you're online, do a ping to Google in coLinux to see if we have a network connection to the internet:
ping -c 4 www.google.nl
If the answer is:
PING www.google.akadns.net (22.214.171.124): 56 data bytes 64 bytes from 126.96.36.199: icmp_seq=0 ttl=243 time=207.8 ms 64 bytes from 188.8.131.52: icmp_seq=1 ttl=243 time=224.6 ms 64 bytes from 184.108.40.206: icmp_seq=2 ttl=243 time=209.0 ms 64 bytes from 220.127.116.11: icmp_seq=3 ttl=243 time=209.0 ms
Then your ping succeeded! Congratulations! This means you have a connection to the internet.
Edited by Bracx on 20040706: I also had to create a /etc/hosts file with the following line:
127.0.0.1 colinux.colinuxdomain colinux
Taken from the coLinux ASAP page. Otherwise I would just get a grey Xserver screen with a x cursor when using VNCViewer instead of the KDE desktop.
First we need to get an updated package list, to get that run:
Well, that is something different from Windows Update, right? No fancy stuff, no ActiveX components, plain text...
Remark by Alex: If this action fails due to "Data Socket timed out" you might want to try and reduce your MTU.
ifconfig eth0 mtu 576
worked for me (via WLAN).
Setting up a display server
There are basically two ways of getting a graphical display of coLinux on Windows, namely using a VNC server and a client (such as RealVNC or TightVNC) or an X server and a client (such as Cygwin/X or XWin32). A VNC server uses the X graphical system but uses a different network protocol for transferring the display. If you already have Cygwin or XWin32 installed under Windows, you may want to use this manual instead of or in addition to the following instructions. -- bbeck
We need VNC to send the desktop of Linux to the Windows machine. As stated at the top of the page, you can find a VNC client at Real VNC: http://www.realvnc.com/. To install VNC server we need to install a few packages. Run:
apt-get install xserver-xfree86
or more recently
apt-get install xserver-xorg
This will install Xserver, the X Window System display server.
On the questions in the screen, answer:
Linux is now downloading the package from the Debian website. When it's ready, it will startup the Xserver configuration wizard. With the [Tab] key you can switch between Yes and No.
On the question answer <No>. We'll do that later. We only want to update now.
Also do the following updates:
apt-get install xfonts-base xfonts-75dpi apt-get install kdebase apt-get install konsole apt-get install vnc4server
These install necessary fonts, a basic KDE environment, konsole (X terminal emulator with support for several sessions) and vncserver.
Running vnc server
Now we want to run the graphical Linux desktop. Running vncserver from the commandline is done like this (use man vncserver in the command shell to find out more about what commands are available):
vncserver -geometry 1024x768 -depth 16
Type a password. "vncserver" is a good password at the moment. To change your password, use vncpasswd.
Run VNC Viewer in Windows. It will say something like "192.168.0.40:1". 192.168.0.40 stands for the IP-number of your coLinux box for windows. That means that for your Windows machine, 192.168.0.40 will be an internal IP-number. For outsiders it will not be visible. [OK]
Now you have to provide the password that you typed in earlier.
Isn't that beautiful!
Now you're inside the graphical environment. From here, find other sources of information to increase the possibilities you have with Linux.
If you have the debian root system and install OpenOffice.org the fonts will look really bad. To change that: apt-get install msttcorefonts Once the installation is complete the fonts in OOo will automatically look great. (Associated web sites http://corefonts.sourceforge.net/ (notice that there are a lot of instructions that do NOT apply for the deb package. For debian all you have to do is "apt-get" :-). http://packages.debian.org/unstable/graphics/msttcorefonts.html)
If you use coLinux a lot, you may wish to have coLinux run a hidden instance when Windows boots up and then access coLinux using a VNC client or a SSH client. To access coLinux via VNC, first make vncserver start on bootup and then access coLinux using a VNC client (such as RealVNC or TightVNC). To access coLinux via SSH, first set up SSH on coLinux and then use a SSH client (such as PuTTY or SSH Secure Shell) to connect to a running instance of coLinux. Once you can do access coLinux reliably, you can use one of the managers on the Administration Tools page to set the service up automatically, or you can set it up manually. Notably, the Colinux Manager administration tool allows you to spawn a console and access a running coLinux service, if you prefer the console over VNC or SSH. -- bbeck