Search:  
Gentoo Wiki

CoLinux

This article is still a Stub. You can help Gentoo-Wiki by expanding it.

Contents

Introduction

coLinux is a windows daemon program. Its purpose is to run the linux kernel as a native windows thread, and thereby one is able run native linux within windows.

The main issue is probably performance, as it is reported to be 'quite' stable. Ordinary applications run just as fast as natively. X apps performance is bad, but useable.

Installation

Download the lastest snapshot from colinux.org/snapshots/ or the devel branch from Sourceforge. The .exe file is an installer which is able download a basic distribution image from sourceforge (gentoo/debian/fedora). Choose Gentoo Deluxe.

The Gentoo root FS will be downloaded to the installation dir automatically and then you must extract the 7zip image (2 GB).

Configuration

There is only a single configuration file, it's located in the installation directory and is named default.colinux.xml.

File: default.colinux.xml
<?xml version="1.0" encoding="UTF-8"?>
<colinux>
   <block_device index="0" path="\DosDevices\e:\gentoo-i586-ext3-2g-deluxe" enabled="true" />
   <bootparams>root=/dev/cobd0</bootparams>
   <image path="vmlinux" />
   <memory size="256" />
   <network index="0" type="tap" name="TAP" />
</colinux>


For lastest version of Colinux used the file configuration example.conf

File: example.conf
kernel=vmlinux
cobd0=D:\coLinux\root_fs
root=/dev/cobd0
initrd=initrd.gz
mem=256
eth0=tuntap

--vaughn 06:10, 5 July 2007 (UTC)

Change the path to the extracted image, and set how much memory to allocate for coLinux. Now you can boot coLinux by running colinux-daemon.exe, but most people want networking, so we should do that first.

Go to "Control Panel->Network Connections". Click on your internet connection, and then ctrl+click on your new TAP network connection. Then right click, and choose "Bridge connections". Now windows should create a bridge. If you still have internet connection in windows, then it probably works. Now you're ready to run colinux-daemon.exe and see the magic.

You have now booted into a basic Gentoo linux 2.6, with several basic programs already emerged.

Login as root with no password (it might also be root or colinux) and set the root password. Check that networking is running, and then start sshd, and ssh into it with Putty or cygwin to get a proper terminal. Now your can do emerge sync or whatever you what.

Adding a swap partition

Download a swapfile from here. The file name indicates the swapsize. Extract it to wherever you have room, and add the following to default.colinux.xml.

File: default.colinux.xml
<block_device index="1" path="\DosDevices\e:\swap-file" enabled="true" />
# (index="1" means that it will be mapped to /dev/cobd1).

For lastest version of Colinux add the following to example.conf.

File: example.conf

cobd1=D:\coLinux\swap


Restart colinux, and type "mkswap /dev/cobd1" and add

File: /etc/fstab
/dev/cobd1              none            swap            sw                      0 0

to fstab, and take it to use without rebooting by

Code: Activating swap
swapon -a

Accessing your linux partitions from coLinux

coLinux FAQ explains the basics. Here is a basic configuration.

File: default.colinux.xml
<?xml version="1.0" encoding="UTF-8"?>
<colinux>
   <block_device index="0" path="\DosDevices\e:\gentoo-i586-ext3-2g-deluxe" enabled="true" />
   <block_device index="1" path="\DosDevices\e:\swap-file" enabled="true" />
   <block_device index="2" path="\Device\Harddisk0\Partition5" enabled="true" />   
   <bootparams>root=/dev/cobd0</bootparams>
   <image path="vmlinux" />
   <memory size="256" />
   <network index="0" type="tap" name="TAP" />
</colinux>

This is a basic configuration for lastest version

File: example.conf
    
cobdX=<path to image file>

	Use any number of these to specify the block device's
	image files

alias=<path to image file> | :cobdX

	Use any number of these to specify an alias (hda1, etc)
	for an block device's image file.  <path to image file>
	can be to an partition using standard 
	\Device\HarddiskX\PartitionY format.


Now you should be able to use "\Device\Harddisk0\Partition5" (my "/" partition) through the /dev/cobd2 device in coLinux, for example

Code: Mounting linux partitions
mount -t reiserfs /dev/cobd2 /mnt/linux

Tip: You can also use your linux swap partition. Then you don't need a swap file for coLinux.

Remember that this will only work with partitions that windows doesn't use. Those you need to access through smbfs.

Increase the image size

Download topoenlarge-0.5.zip from hem.passagen.se, unzip it, and run topoenlarge.bat. Check the "find file" radio button, and press the "enlarge file" button. When you found the file and pressed "ok" the file should be enlarged.

Warning: Remember that FAT32 can only handle up to 4 GB files!

The above link appears to be broken. Try http://csemler.com/

Installing KDE

CoLinux cannot access the graphic card directly, so in order to use KDE, we must install an X-Server on Windows. Please see http://wiki.colinux.org/XCoLinux for more information regarding running X11 on CoLinux.

However, for simplicity's sake, use vncserver instead of full blown x-server.

Please follows HOWTO Xvnc terminal server to setup the vnc-terminal server, but edit /etc/X11/xdm/Xservers so that X will not run inside CoLinux.

File: /etc/X11/xdm/Xservers
:0 local /usr/bin/Xvnc

Thanks to

Links

Retrieved from "http://www.gentoo-wiki.info/HOWTO_CoLinux"

Last modified: Mon, 08 Sep 2008 06:29:00 +0000 Hits: 22,997