WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: booting tinycore using colinux - it works!  (Read 12638 times)

Offline btheado

  • Newbie
  • *
  • Posts: 9
booting tinycore using colinux - it works!
« on: September 26, 2010, 05:38:58 PM »
Colinux (http://colinux.org/) is a port of the linux kernel that allows it to run in Windows without using virtualization software.

I just tried running tinycore over colinux and it boots just fine unchanged.  At least as far as getting the console-based shell prompt.  Getting it work completely with GUI, network, disk image mounting and extensions required some effort and changes to the tinycore initial ram disk.

I downloaded and installed colinux version 0.7.8.  Colinux comes with a kernel file (vmlinux) and an initial ram disk (initrd.gz).  Typical use of colinux involves booting using those two files along with a disk image containing the rest of your linux installation.  For tinycore, no disk image is required as the base functionality is all present in the initial ram disk.  And it turns out that the tinycore initrd (tinycore.gz) boots just fine using the colinux kernel.

The current tinycore initial ram disk is available at http://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/3.x/release/distribution_files/tinycore.gz

Just copy that file into your colinux directory and then run the following command:

  colinux-daemon kernel=vmlinux initrd=tinycore.gz text

Seconds later you should see a shell prompt.  No networking, no gui.  Colinux does not provide a graphic interface like QEMU and other virtualizers do.  You have to setup networking and either use VNC or have an X-server running in windows (I use xming - http://www.straightrunning.com/XmingNotes/).

To get no-fuss slirp based networking (slow, I think) add one boot parameter:

  colinux-daemon kernel=vmlinux initrd=tinycore.gz eth0=slirp text

Now you should have networking:

    tc@box:~$ ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:FF:16:2A:D0:00
                 inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
                 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                 RX packets:2 errors:0 dropped:0 overruns:0 frame:0
                 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
                 collisions:0 txqueuelen:1000
                 RX bytes:1180 (1.1 KiB)  TX bytes:662 (662.0 B)
                 Interrupt:10
    [...lo device elided...]

Verify connectivity:

    tc@box:~$ wget http://google.com
    Connecting to google.com (72.14.204.103:80)
    Connecting to www.google.com (72.14.204.99:80)
    index.html           100% |*******************************|  8757  --:--:-- ETA

With slirp, 10.0.2.2 is the host address, so if you have xming already setup, the following should bring up the appbrowser utility:

  tc@box:~$ DISPLAY=10.0.2.2:0.0 appbrowser

The first trouble with tinycore-over-colinux hits when trying to install an extension.  Tiny core extensions are squashfs based files.  Mounting a squashfs file requires kernel module support. Since the tinycore kernel was not used (vmlinux from colinux was used), none of the kernel modules (including squashfs) from the tinycore initrd gets loaded.

The lsmod output in tinycore-over-colinux is empty, whereas a qemu booted tinycore shows squashfs, ramzswap, loop, and other kernel modules.

Fortunately, colinux comes with its own kernel modules in the file vmlinux-modules.tar.gz and squashfs is one of the modules.  So copying the colinux kernel modules into the tinycore initrd is fairly easy.  I followed the instructions at http://wiki.tinycorelinux.com/Remastering and got a new tinycore initrd (larger now because it has kernel modules for both the tinycore kernel and the colinux kernel).

Now extension loading works just fine:

    tc@box:~$ tce-load -w -i expat2
    Downloading: expat2.tcz
    Connecting to distro.ibiblio.org (152.46.7.109:80)
    expat2.tcz           100% |*******************************| 77824  --:--:-- ETA expat2.tcz: OK

To construct the revised initrd from within tiny core colinux, it is useful to have access from within tinycore to the windows filesystem (to copy the original tinycore.gz in and copy the modified version out).  For file system access boot like this:

  colinux-daemon kernel=vmlinux initrd=tinycore.gz eth0=slirp text cofs=c:\temp

Use whatever directory you want in place of 'c:\temp'.  Then from the colinux shell:

    tc@box:~$ sudo mkdir /mnt/cofs
    tc@box:~$ sudo mount cofs /mnt/cofs -t cofs
    tc@box:~$ ls /mnt/cofs
    [you should see the contents of your c:\temp directory]

Now you can copy files back and forth between linux and windows (using 'sudo cp').


The second problem I encountered was with persistent storage.  I could create a disk image and tell colinux to expose the disk image as a block device, but tinycore would not automatically mount it.  I could manually mount it, but tinycore ignored it for automount.  Here's the colinux command line now:

  colinux-daemon kernel=vmlinux initrd=tinycore.gz eth0=slirp text cofs=c:\temp cobd0=tinycore_400M.img

And after booting, the /mnt directory is empty.  But I can manually mount:

    tc@box:~$ sudo mkdir /mnt/cobd0
    tc@box:~$ sudo mount /dev/cobd0 /mnt/cobd0/
    EXT3-fs (cobd0): using internal journal
    EXT3-fs (cobd0): mounted filesystem with writeback data mode
    kjournald starting.  Commit interval 5 seconds                                 

After looking at the tinycore boot scripts, I figured out that colinux does not label the cobd0 device with an id that tinycore knows to automount:

    tc@box:~$ cat /sys/block/cobd0/dev
    117:0                                                                           

I didn't fully understand the code in /usr/sbin/rebuildfstab, but changing this:

    179|9|259) # MMC or MD (software raid)
      FSTYPE="$(fstype $DEVROOT/$DEVNAME)"
      ;;                                                                       

to this (just added '117'):

    117|179|9|259) # MMC or MD (software raid)
      FSTYPE="$(fstype $DEVROOT/$DEVNAME)"
      ;;                                                                       

and updating my tincore.gz initrd with the changed rebuildfstab fixed the issue for me.

Then I use that automounted drive with the options "tce=cobd0 restore=cobd0 home=cobd0" and I have persistent home and packages and everything seems to work fine for me so far.

tinycore-over-colinux is significantly faster than tinycore-over-unaccelerated-qemu.  I'm amazed at how fast it boots.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: booting tinycore using colinux - it works!
« Reply #1 on: September 27, 2010, 04:36:22 AM »
btheado, welcome to the TC / MC community.

I found your contribution to be a highly informative and even entertaining read (in particular for a first post of a new member). When I first read the subject I though: "Hmm that might be the story of someone running into some trouble". It's been quite some years since I've "played" with colinux. After some initial success I got really fed up due to some nasty crashes of the host OS, presumably caused by colinux. I also found the fact that one had to use the colinux provided kernel instead of a distribution one to be a bit cumbersome, plus the fact that those kernel versions were not any more that "fresh" when a new coliux release eventually came out.

I remember that colinux appeared to be quite fast, but we have nowadays QEMU (which I'm using with KQEMU) and VBox as pretty decent ways to run TC under Windows. Also the non-standard handling of the GUI (i.e. X server on the host instead of a SDL solution) was another reason to give it a miss. I just found the alternatives to be way easier to deal with.

Now, thanks to your post I might give colinux another chance (time permitting). You seemed to have done some good work in solving all the initial issues one would face when using clinux. Clearly the fact that the colinux 0.7.8 kernel version and TC 3.x are almost the same would have been a great help. So there might not be too many problems lurking around. I wonder whether you would have done a comparison of the kernel configuration used for TC 3.x vs. colinux 0.7.8. There are also a small number of other patches (in addition to the squashfs one) which have been applied for TC 3.x. Did you have a look into those as well?

Anyway, it will be at least a few days before I might get around to give it a go, but thank you for bringing the subject of colinux back from the state of semi-obscurity (at least in my mind).

Offline btheado

  • Newbie
  • *
  • Posts: 9
Re: booting tinycore using colinux - it works!
« Reply #2 on: September 27, 2010, 07:28:28 PM »
maro, thanks for the welcome.

Quote
I wonder whether you would have done a comparison of the kernel configuration used for TC 3.x vs. colinux 0.7.8. There are also a small number of other patches (in addition to the squashfs one) which have been applied for TC 3.x. Did you have a look into those as well?

No, I didn't look at kernel configurations at all.  Off-the-top of my head, I don't know where to look.  The colinux kernel must have the loop module compiled in, because it is not visible as a separate module (while it is visible in tinycore as a separate module) and I would think that extension loading depends on it.

Some other modules visible in tinycore must either be compiled into colinux or not crucial to tinycore.  I have no idea what the ramzswap module in tinycore does, for example.

As for the patches, I didn't know squashfs involved a patch--I thought it was just a module.  I read somewhere on this forum (I dont' recall where) that the tinycore kernel patches are not crucial to normal operation.

Offline cast-fish

  • Hero Member
  • *****
  • Posts: 1000
  • hi there
Re: booting tinycore using colinux - it works!
« Reply #3 on: July 27, 2011, 10:11:38 AM »
Hello

Do you have a finished Remaster .iso file of TCL(colinux)?

A file that can just be executed from the win32 desktop to boot into
TCL?

thanks

Vince.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: booting tinycore using colinux - it works!
« Reply #4 on: October 08, 2011, 03:14:29 PM »
Did someone tried TC4 with coLinux?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline ok-man

  • Newbie
  • *
  • Posts: 6
Re: booting tinycore using colinux - it works!
« Reply #5 on: January 13, 2012, 08:53:45 AM »