Run Ubuntu inside coLinux
I got the question about how I setup Ubuntu to run inside coLinux in another thread, so here is a brief description. I am running ubuntu in a dualboot configuration with XP and when booting XP it also starts a coLinux instance using the ubuntu partition. Here are the steps I used to set it up.
1. I installed Ubuntu as normal on a separate partition and configured the computer to dualboot between Ubuntu/XP.
2. I installed coLinux with the Debian with backports image that is available on the coLinux website.
3. Configured coLinux so it could mount the the Ubuntu partition, the trick here is to figure out the correct partition number. The partition number in coLinux seems to be lower that the partition number used when booting the computer with Ubuntu. In my case I had to setup:
<block_device index="1" path="\Device\Harddisk0\Partition5" enabled="true" alias="hda7"/>
4. Boot coLinux with the Debian with backports image and after boot mount the ubuntu partition in my case /dev/hda7
5. To make it possible to boot ubuntu inside coLinux you need to turn of some services autostarted at boot, most of them har hardware related in some way and is not supported inside coLinux. You still want to run these services when not running ubuntu inside colinux. I did this by first creating a /etc/inid.d/colinux script according to http://wiki.colinux.org/cgi-bin/DualBootSystem
This script should of course be created in the /etc/init.d directory on the ubuntu partition and not on the "debian with backports" image.
When this script has been created you also need to edit the default.colinux.xml file so it contains a COLINUX=1 boot-parameter, in my case:
This script now makes it possible to turn of some autostarted services when starting inside coLinux but still run these services when dualbooting the computer with ubuntu.
You also has to make sure to run this script at boot time by inserting links in the /etc/rcS.d directory.
6. The next step is to turn of services by inserting if-statements inside the service scripts in /etc/init.d (on the ubuntu partition).
if [ -f /var/local/colinux ] ; then
I had to turn off the following services when booting inside coLinux to make it boot, coLinux crashed during boot when any of these services were running:
7. Create colinux customized versons of some other files, the colinux script in init.d mentioned above makes it possible to have a colinux-version and a non-colinux version of some different files.
In my case i have special versions of the following files:
/etc/fstab (coLinux mounts the ntfs partitions using smbfs instead of ntfs read-only mounting)
/etc/network/interfaces (I didn't get colinux to work using DHCP so it has hardcoded IP numbers instead)
/etc/gdm/gdm.conf (I am not really sure this is used since gdm can't be started at boot, but I have a special version for coLinux with all [servers] disabled. It may be used when using vnc but I am not sure if it is needed)
It is important to remember to edit correct file when setting up these files this way because the normal files will be overwritten with *-colinux or *-non-colinux versions at each boot. It might be possible to setup symbolic links instead of overwriting the files but I have not tested this.
9. Finally you will have to setup coLinux so it boots using the Ubuntu partition instead of the "debian with backports" image, this is done by setting a boot partition in the default.colinux.xml file, in my case it pointed to /dev/hda8
10. It should now be possible to either start Ubuntu by selecting it in the dualboot(grub) menu when booting the computer or by starting XP and startup coLinux. Observe that when running inside coLinux the ubuntu kernel is actually not used instead the coLinux kernel is used. This is imporant to think about for example if you need to recompiling kernels and kernel modules.
Finally, don't do the same misstake as I did. As described in this thread, I put XP/coLinux into sleep in hibernate mode and then dualbooted into Ubuntu. My ubuntu file system got corrupt at next boot of XP and I decided to do a total reinstallation of Ubuntu.