This howto is for topologilinux4 only Topologilinux 5 incorporates these ideas and includes coLinux and is ready to use under coLinux out of the box. So for tlinux5 this document is for reference purposes only if you want to understand how it works.

This howto explains how to setup an installation of Topologilinux to boot both normally and to also boot under coLinux. This system will automaticly change its configuration depending on how it is booted.

At this time coLinux is still experimental software, so I would not recommend using this method on a setup of Topologilinux that you depend upon to get work done or one that contains valuable files in its filesystem until co Linux is considered stable. At the end of this howto #AppendixA I will give a quick description of how to install a second Topologilinux base.img along with your main one for users of Topologilinux that do not want to risk their main system.

Topologilinux can be obtained from It is a 2 cd distro that installs to loopback images so it does not need a separate partition. It is totally slackware compatible.

I will assume that you have a working version of Topologilinux 4 that can boot with the grub based bootloader. (The bootloader is necessary because you will need to modify the initrd. The only alternative would be to create a new boot cd which we will not cover here) I will also assume that you know how to use a console based text editor such as EMACS or vi. No other install of linux is necessary.

You probably want to start with your topologilinux system set to boot to runlevel 3 and use startx to run x when booting normally. To get X working under coLinux see XCoLinux after you have finished this howto.

You must be able to copy a file that is too big for a floppy from Topologilinux to the windows file system. If you are using Fat32 you can do this directly but if you are using NTFS then you need an extra Fat32 partition or the program explore2fs

Install coLinux, you may want to test it with one of the images that are provided before proceding. See coLinuxRunning for tips and co Linux download.

Boot your Topologilinux system normally and log in as root. We will now create the coLinux block devices

# cd /dev
# mknod cobd0 b 117 0
# mknod cobd1 b 117 1
# mknod cobd2 b 117 2
# mknod cobd3 b 117 3

You may want to continue to make more block devices. The above assumes you need one for root, swap, floppy, and cdrom. If you have other partitions to mount that are under control of windows you may want to make more. 8 is the maximum number you can create (0 - 7).

We want to create some folders so that we can store configuration files that are different when running under coLinux.

# cd /
# mkdir coTopo
# cd coTopo
# mkdir dual-boot

This will be for files that are used when booting normally.

# mkdir coLinux

This will be for files that are used when booting under coLinux.

Now we will retrieve initrd.gz from c:\boot and modify it.

# cp /mnt/windows/boot/initrd.gz /root/
# cd /root
# gunzip initrd.gz
# mkdir mnt.initrd
# mount initrd mnt.initrd -o loop
# cd mnt.initrd
# ls

Now you can check that the mount was successful [ls should show files in this directory].

We will now create a symbolic link called coTopo that points to /coTopo/dual-boot

# ln -s /coTopo/dual-boot coTopo

We can now unmount the initrd and recompress it.

# cd ..
# umount mnt.initrd
# gzip -9 initrd

Later we will need to copy this file back to windows c:\boot If your windows system is using fat32 you can do that now. If using NTFS you must wait and use explore2fs when we reboot to windows after a couple more steps. You may also want to make a second copy of initrd.gz called inirtd1.gz and edit it as described in appendix A if you will have a second topologilinux system.

warning fat32 only.

# cp initrd.gz /mnt/windows/boot/initrd.gz

end fat32 only.

Now we must copy the files that are going to be different between the 2 boot modes and make the appropriate edits.

You should decide at this time what sort of networking you are going to use. If you are going to be obtaining addresses from DHCP or the configuration will be the same you do not need to copy the network files below. See coLinuxNetworking to decided how you are going to set up networking.

The configuration files will be copied to /coTopo/dual-boot and /coTopo/co Linux . We will then delete the original file replacing it with a symbolic link to /initrd/coTopo/filename.

When booting normally the initrd will be mounted on initrd so the link we created in the initrd will redirect to /coTopo/dual-boot. When booting with coLinux the initrd is not used later we will create a link inside this mount point directory redirecting to /co Topo/coLinux

# cp /etc/fstab /coTopo/dual-boot/
# cp /etc/fstab /coTopo/coLinux/
# rm /etc/fstab
# ln -s /initrd/coTopo/fstab /etc/fstab

/coTopo/dual-boot/fstab does not need to be changed. But you will need to edit

/coTopo/co Linux/fstab to point to the coLinux block devices. Open it in a text editor and

change /dev/loop7 to /dev/cobd0 /dev/loop6 to /dev/cobd1 /dev/floppy to /dev/cobd2 /dev/cdrom to /dev/cobd3 see man fstab and man mount if you do not understand this.

If the networking configuration will be different you will need to do the same with the following files.

# cp /etc/networks  /coTopo/dual-boot/networks
# cp /etc/networks /coTopo/coLinux/networks
# rm /etc/networks
# ln -s /initrd/coTopo/networks /etc/networks
# cp /etc/rc.d/rc.inet1.conf /coTopo/dual-boot/rc.inet1.conf
# cp /etc/rc.d/rc.inet1.conf /coTopo/coLinux/rc.inet1.conf
# rm /etc/rc.d/rc.inet1.conf
# ln -s /initrd/coTopo/rc.inet1.conf /etc/rc.d/rc.inet1.conf

You may wish to edit the two network files in /coTopo/co Linux by hand or you may run netconfig later while booted under coLinux.

Now we need to create the symbolic link in the directory that is the mount point for the initrd. This directory is /initrd the initrd is currently mounted there and we cannot unmount it. Topologilinux provides setup.gz this is a ramdisk that we can use as a small linux system and we can then mount base.img and create the link.

reboot Select Topologilinux on the ntldr menu Then select Topologilinux setup on the grub menu After logging in do not type setup we do not want to run the setup program.

# cd /mnt
# mkdir win
# mkdir base

Assuming that base.img is on hda1 if you system is different change the following command

# mount /dev/hda1 /mnt/win
# mount /mnt/win/tlinux4/base.img /mnt/base -o loop
# cd /mnt/base
# ls

You should see an initrd directory. This is the mount point of the initrd when booting with the bootloader. Anything you put in this directory will be covered up by the contents of initrd but when booting without an initrd as we do with coLinux these contents will be visible.

# cd initrd
# ln -s /coTopo/co Linux coTopo
#ls -l

you should see a new sym link named coTopo that points to /co Topo/coLinux

# cd /
# umount /mnt/base
# umount /mnt/win
# reboot

Now when we reboot we want to choose windows.

If you did not yet copy the initrd that you modified back to windows we need to do so now. Start explore2fs File menu open file browse to c:\tlinux4\base.img click open it should appear in the left side. Browse to your /root/initrd.gz file Drag it to a window opened to c:\boot overwrite your old copy. (You may want to back the original up before doing this but it is available on the cd so it's no big deal)

Here is a copy of default.colinux.xml I have the block devices setup for root and swap you may wish to change the networking according to what method you choose. Also you may want to setup the floppy drive on cobd2 and the cdrom on cobd3

<?xml version="1.0" encoding="UTF-8"?>
    <block_device index="0" path="\DosDevices\c:\tlinux4\base.img" enabled="true">

    <block_device index="1" path="\DosDevices\c:\coLinux\swap.img" enabled="true">

    <bootparams>root=cobd0 ro</bootparams>
    <image path="vmlinux"></image>
    <memory size="64"></memory>
    <network index="0" type="tap" name="TAP"></network>

You should now be able to boot Topologilinux both ways If you have different networking setups and did not edit the files manually boot under colinux login and run netconfig.

Appendix A[]

You should read the whole text above before attempting this unless you are an expert. I did not include as many details here. If you have a production Topologilinux install that you do not wish to use with coLinux but you would like to install a second system rename c:\tlinux4\base.img to base1.img . You canthen install the second Topologilinux system or you can make base1.img a copy of base.img to save the time of the second install. If doing a second install donot install the bootloader the second time. Make a copy of c:\boot\initrd.gz called inirtd1.gz you need to copy this into topologilinux decompress and mount it as above. At about line 40 change

losetup /dev/loop7 /dos/tlinux4/base.img to losetup /dev/loop7 /dos/tlinux4/base1.img

save the file unmount and recompress initrd1.gz and copy to windows as indicated above.

In windows open c:\boot\menu.lst with notepad add the following section. you may want to add it before the other choices if you would like it to be your default

# For booting My Topologilinux base1(vga 1024x768 mode)
title My Topologilinux base1.img(vga 1024x768 mode)
kernel (hd0,0)/boot/bzImage root=/dev/loop7 vga=773 ro
initrd (hd0,0)/boot/initrd1.gz

You should now have this entry in your grub menu along with the others that boot base.img

If having problems with the grub based bootloader see or the topologilinux forums

MassTranslated on 25 Dec 2004.

MassTranslated on Sun Apr 23 17:36:56 UTC 2006

ManuallyAdjusted on 20 July 2008