coLinux
Line 24: Line 24:
   
 
Be sure to unmount anything except for /. If you have seperate partitions / disks for the directories on your system, you have to tar them seperately. Don't squash it all together like you would do if you would follow the following example (that uses only one partition).
 
Be sure to unmount anything except for /. If you have seperate partitions / disks for the directories on your system, you have to tar them seperately. Don't squash it all together like you would do if you would follow the following example (that uses only one partition).
  +
  +
[Can you clarify the unmount procedure - it seems pretty fundamental. Thanks!]
   
 
In the tar line add any other directory installed by your distro. Be shure to NOT add <code>sys</code> and <code>proc</code>, as well as anything else in <code>dev</code> except <code>console</code> and <code>null</code>. With option ''one-file-system'' will automatically exclude all live mounted directories like dev, proc and sys.
 
In the tar line add any other directory installed by your distro. Be shure to NOT add <code>sys</code> and <code>proc</code>, as well as anything else in <code>dev</code> except <code>console</code> and <code>null</code>. With option ''one-file-system'' will automatically exclude all live mounted directories like dev, proc and sys.

Revision as of 13:13, 20 November 2009

ATTENTION: This howto requires quite a bit of knowledge about linux, and colinux in particular. Searching in this wiki (I will repeat this sentence a lot, sorry in advance) could help you understand at least the colinux part quite well.

NOTE: Since coLinux is 32bit, even this howto does not help you convert 64bit distros ;-)

Install your distro in a VM

If you already installed the distro of your choice in a vm or on some machine, you can skip this point.

Virtualization Software examples:

  • VirtualPC (free, Windows, easy install, no snap-shots)
  • VMWare Player (free, Windows, Mac)
  • VMWare Workstation / VMWare Server (for-cost, many features)
  • Parallels Desktop (for-cost, Mac, Windows)
  • VirtualBox (free, Windows, Linux, Mac)

Configure your VM with the setting required by your distro. Install your Distro.

Be shure to create only one partition mounted on "/". Otherwise you would have to port more than one filesystem to coLinux.

Copy your distro

When your Distro is up and running, go to / and run tar to archive the complete filesystem.

Be sure to unmount anything except for /. If you have seperate partitions / disks for the directories on your system, you have to tar them seperately. Don't squash it all together like you would do if you would follow the following example (that uses only one partition).

[Can you clarify the unmount procedure - it seems pretty fundamental. Thanks!]

In the tar line add any other directory installed by your distro. Be shure to NOT add sys and proc, as well as anything else in dev except console and null. With option one-file-system will automatically exclude all live mounted directories like dev, proc and sys.

cd /
tar --one-file-system --exclude distro.tar.bz2 -cvjf distro.tar.bz2 . dev/console dev/null

Install openssh. (You can use anything similiar that supports copying files to and from your

machine, e.g some ftp server). Use any sftp client you want (e.g. filezilla, which is available for about any os).

Copy the distro.tar.bz2.

Install your distro into coLinux

Now we will use coLinux with the preconfigured debian (or any other preconfigured coLinux fs - just search this wiki). In the configuration file for debian add a line cobdX replacing X with a number not used already. I will use cobd4 in this example from now on.

cobd4="distro.fs"

You need an empty file named distro.fs. You can search this wiki on how to generate empty disk files.

Now start debian.

Format the new disk image (ext3 filesystem):

mke2fs -vj /dev/cobd4

mount it:

mkdir /mnt/distro
mount -t ext3 /dev/cobd4 /mnt/distro

you need to get the openssh server running on your debian. Connect to it using filezilla (host: ip of your debian - see the networking wiki), user root, passwd(default on colinux debian) : 'colinux', connection type: sftp, port 22). Upload the distro.tar.bz2.

In your debian, untar the distro archive:

cd /mnt/distro
tar -xvjf /path/to/where/you/uploaded/distro.tar.bz2

Edit (i use nano editor) fstab and mtab

nano /mnt/distro/etc/mtab

and afterwards

nano /mnt/distro/etc/fstab

in both files:

  • replace /dev/sda1 with /dev/cobd0 (where /dev/sda1 is the device mounted on / in your vm. Replace with the appropriate. And /dev/cobd0 is the / in colinux)

in fstab:

  • replace /dev/sda2 with /dev/cobd1 (where /dev/sda2 is the swap partition and /dev/cobd1 is the swap partition in colinux, or just remove this entry for no swap (not recommended). Please search this wiki on how to create swap devices)

Start your coLinux distro

now create a config file for your distro in the colinux directory with the entries:

cobd0="distro.fs"
cobd1="swap.fs" (swap.fs is my empty swap file)

and run your new distro.

Thats it. I hope I did not totally confuse your, and I hope I didn't make too many mistakes. Good Luck.