My Experience with coLinux

CoLinux is a wonderful tool for running Linux under Windows; it allows you to run a full-fledged Linux computer with no extra partitions, inside Windows. More information can be found at the main site. Here is what I have found out so far, that will hopefully be helpful to others.

Disclainers

This is most likely out of date; for several months now, I have been booting Linux as my primary OS, so no longer use CoLinux. This was never a full guide; now it is probably out of date and only useful as a second source for hints if things go wrong, if at all. Please use the official documentation at the coLinux site.

CoLinux is still under heavy development, and will likely change in the future. This page also only represents my results with it. As a result, the information here may not match your exact situation. However, I hope it will be helpful. Also, keep in mind that, like many open source projects, there's no warranty, blah blah blah. This page reflects my personal experience; there is no guarantee that you will have anything even remotely similar (though it will most likely be very close).Now onto the fun stuff...

Download and "Installation"

This actually isn't particularly fun, but is fairly trivial; go to the downloads section of the site (this is currently a link to the sourceforge downloads page, but who knows it it will always be). You want to get the most recent binary version (you can get source if you want to, but if you want to try that, you probably don't need this document), and extract it (I used Cygwin tar, but I think Winzip might handle it). There are a couple main files here; the TAP-Win32 directory is the virtual network driver that coLinux uses by default (at least at the moment); various colinux executables; cygwin1.dll; default.colinux.xml; linux.sys; packet.dll; vmlinux; wpcap.dll; and various documentation. The simplet thing to do is to copy these to c:\coLinux, but you can leave them wherever you want.

The TAP-Win32 Network Driver

Without a network connection, coLinux won't be very useful. However, since it runs within Windows and is supposed to cooperate, it won't just steal access to the network. Instead, it acts as a separate computer connected over a network. The TAP-Win32 network driver is an odd little thing that allows a process in your computer (i.e., coLinux) to connect to your computer (Windows) as if it were a seperate computer connected over a network. This way, you have a connection shared between Windows and coLinux with relatively little trouble.

There may be other ways to configure this, but I have no idea what those are.

To install the TAP-Win32 driver, use the "Add New Hardware Wizard", accessible through the Control Panel->Add Hardware menu. I started out following the instructions included with coLinux, but my setup varied slighly, but had the same general trend: say that you have connected the hardware, select "Add a new hardware device" from the list of "Installed hardware", "Install the hardware that I manually select from a list", the "Network Adapters" hardware category, click the "Have Disk..." button, go to the TAP-Win32 directory and choose OemWin2k, and finish installation. Now, if you go to Control Panel->Network Connections, you should have, under "LAN or High-Speed Internet", a "Local Area Connection" with device name TAP-Win32 Adapter. Make sure this is enabled before trying to run coLinux. Windows may give you an error about a network device being unplugged, but you can just ignore this since you will be "attaching" coLinux to it soon.

A Disk Image and Configuration

In order to run coLinux, you also need a disk image to work from. You can use a pre-existing Linux partition, but I used the Debian image available from the download site. It's an 18M file that expands to 1GB when decompressed, so make sure you have plenty of disk space. This has a basic Debian image on it with everything you need to get started. Save/extract this in the coLinux directory (it actually can go anywhere, I think, but putting it there keeps things simple). Now look at default.colinux.xml. This file contains the setup for your coLinux distribution. By default, this contains several options: <block_device> options represent partitions. They are actually mounted under /dev/cobdn, where n is given by the index passed to it, and the path is fairly striaghtforward. Make sure that the first one (index="0") points to your root filesystem (e.g., the Debian image). You may want to disable the swap device for now; it's not strictly necessary and will be described later. The other options are fairly straightforward; bootparems should probably be left alone in most cases, image (the kernel image to boot from, not a picture) should be right; memory describes the amount of memory coLinux should use, and network describes the network adapter to use; if you're following this, just leave it as it is (with TAP). One note on the memory: this is non-swappable memory, so using too much can do bad things to your computer (as long as coLinux is running; as soon as you reboot, everything will be fine). It used to default to 29MB which was sufficient for most things, now it seems to default to 64MB. If you have less than 256MB of RAM you probably want to make it smaller. Realistically, unless you want to use X (described later) or use a very memory-intensive program, 32MB or even 16MB may be enough.

Running coLinux

Now that you've got it all set up, you can run it. Make sure your TAP-Win32 adapter is enabled if you want to have networking setup, and run coLinux-daemon. This will open up a DOS prompt that will scroll through Linux booting up! There will probably be some errors, but they are probably just things that aren't normal in coLinux that haven't been properly patched yet. In another few seconds, a colinux-console should pop up. And after a few more seconds, it should stop and give you a login prompt. Since the Debian image by default has no other users, you must log in as root (with no password). Now you can use adduser to add another user for normal use, or passwd to set the root password. And you have Linux!

Todo: