These are some notes I wrote for myself when I tried to setup CoLinux to run with networking and X Windows on my Windows 2000 / Linux Redhat 9 dual boot up system. Hopefully it will be of some help to you.
I work at www.akeni.com. If you have any suggestions or corrections about these notes please send them to firstname.lastname@example.org. Please do not ask me how to get CoLinux to work on your system, whatever I know is already contained in these notes.
Copyright 2004, Akeni System. Please do not reproduce without permission.
Booting up CoLinux from a dual booting partition.
Caveat: These procedure are tested on a Redhat 9 system, your mileage may vary...
- Boot into your Linux system and create these /dev/cobdX nodes:
mknod /dev/cobd0 b 117 0
mknod /dev/cobd1 b 117 1
mknod /dev/cobd2 b 117 2
mknod /dev/cobd7 b 117 7 There is currently a limit of 8 cobdX
Surprisingly, you don't need to actually change your /etc/fstab. CoLinux will boot into the root partition correctly even though /etc/fstab has the wrong value. (At least it worked for me)
I found it easier to simply leave the /etc/fstab alone, and use a separate shell script to mount the /dev/cobdX driver when running CoLinux.
- Now you need to figure out what the the \Device\HarddiskVolumeX corresponding to your Linux boot partition. The easiest way to do that is by using the free tool from Microsoft.
- To setup the floppy add
<block_device index="2" path="\Device\Floppy0" enabled="true">
index="2" can be anything. '2' means that you will access the floppy as /dev/cobd2.
- Similarly for the CD-ROM, add
<block_device index="4" path="\\Device\CdRom0" enabled="true">
Unfortunately, it seems that you can not access your FAT drive because it is already locked by Windows. Presumably one way to get around this problem is by setting up C:/ drive to be network shareable and then run the Samba client under CoLinux to access it.
How to disable e2fsck at bootup
I have problem when booting into CoLinux because Linux keep trying to run fschk on /dev/cobd6, even though it should have been clean.
What I finally end up doing it to modify /etc/rc.d/rc.sysinit and added the line />
Running 22fsck under Windows
Instead of booting into Linux to run fsck, there is a port of e2fsck to NT that can be downloaded from http://ashedel.chat.ru/ext2fsnt/e2fsprogs-1.19-NT-i386.rar
To use it, type
Where \Device\HarddiskVolume5 is the same value you use in your default.colinux.xml file
Using dmdiag to figure out \Device\HarddiskVolumeX
I use CoLinux to boot into one of my Linux 9 ext-2 partitions to do testing. Because I have many partitions to test it took some guesswork to figure out the correct value for "\Device\HarddiskVolumeX" for use with default.colinux.xml. I found that the tool dmdiag from the Microsoft Windows 2000 Resource Kit to be very useful. The tool can be downloaded for free from http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/dmdiag-o.asp
Once you have install the tool, you need to open up (Control Panel | Administrative Tools | Computer Management), then (select Storage | Disc Management) From there, right click on the Linux Ext-2 partition for which you need to figure out the right "\Device\HarddiskVolumeX" value to use and choose "Change Drive Letter and Path" and use "Add" to assign a drive letter to it, say "L" Then go to a Windows 2000 command prompt and type
dmdiag > dmdiag.txt
Now use the notepad to look at the file dmdiag.txt
start notepad dmdiag.txt
There you'll find the value corresponding to the partition, which you can then use to
How to get networking using static IP/addresses.
I will assume that you are NOT try to get on the Internet from within your CoLinux session. You just want to setup your network so that you can communicate between your CoLinux session and the Windows 2000 session under which it is running. This means that you actually do NOT need to setup Connection Sharing or the Native Bridge Network under Windows 2000.
I will also assume that your have CoLinux running successfully.
- You need to install the TAP-Win32 drive. This should be done for you by the install already.
- Decide what is the subnet under which you want to run you CoLinux session. Let's assume that your Window 2000 already has a network card with address 192.168.1.5 with a subnet mask of 255.255.255.0. If you want your CoLinux session to be able to talk to this address then you CoLinux's must be on the same subnet. So let's say that it will be 192.168.1.7.
- Here it where it it gets a little bit confusing. You actually need to assign TWO addresses to the CoLinux session. One is the "internal" address (what the CoLinux session sees) and one is the "external" address which is what the Windows 2000 session sees.
If you think of your CoLinux session as a virtual computer, the networking looks something like this:
| CoLinux | | Windows 2000 |
| | | |
| 192.168.1.200 <--|---------|--> 192.168.1.7 |
| | | |
The values 192.168.1.200 and 192.168.1.7 can be anything provided that they are in the subnet 192.168.1.x and do not conflict with anything that is already on the network.
To set the "external" address of 192.168.1.7 under Windows 2000, Open your network properties, then choose "properties" for the Local Area Connection that corresponds to the TAP-Win32 driver. The goto General | Internet Protocol (TCP/IP) and choose "Properties". Check "Use the following IP address" and set the IP address to 192.168.1.7
- Now start you CoLinux session. Login as root. Now you need to edit /etc/sysconfig/network-scripts/ifcfg-eth0 (this is for Redhat, for other distros please consult your manual)
Change the following two lines:
It is crucial that the GATEWAY is set to the "external" address, else the CoLinux session will not be able to reach the Windows 2000 session.
If you are using Redhat, you can then use
service network stop
service network start
to load the new values
Once the network has restarted, type
and you should see something like
inet addr:192.168.1.200 ....
- To test the connection, type
under Windows 2000 and you should see an entry that says something like this:
Ethernet adapter Local Area Connection 4:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.1.7
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.7
and you should get a reply from the CoLinux session.
- Now go into your CoLinux session and type
Again, you should get a correct ping reply from Windows 2000.
Setup X Windows
Assuming that you got this far, the hard part of setting up the virtual network is done. I'll also assume that you have already install X Windows under your CoLinux session.
On your CoLinux session, type:
(Do not miss the ':0' at the end)
Start your X server on Windows 2000 (You can use the free one from Cygwin)
To test, type
Under you CoLinux session. If all went well you should see it displayed on your X-Window session.