Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: coLinux 0.6.2 Tutorial -- Linux on Windows

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915

    coLinux 0.6.2 Tutorial

    Hey Hey,

    i2c posted a Tutorial on the previous version of coLinux using ICS... I've installed the newer version... which has a few changes and used bridged networking, So I'm going to walk you through the differences. The main reason I prefer this method is that on XP if you're network is set to 192.168.0.0/24 then you won't be able to enable ICS. The second reason is that you are physically on the same network.

    Outline of Tutorial
    1. Obtaining the Required Files
    2. Installing coLinux
    3. Extracting and configuring the fs file
    4. Enabling networking support
    5. Deplaying coLinux as a service. (optional)
    6. Upgrading the fs size (optional)
    7. Setting up and deploying X (through VNC) (optional)

    ******

    .:Section 1:.

    WinPcap v. 3.1 -- http://www.winpcap.org/install/bin/WinPcap_3_1.exe
    The coLinux installer (for 2.6 kernels) -- http://prdownloads.sourceforge.net/c...2.exe?download
    The base FS Image (we're using Debian) -- http://prdownloads.sourceforge.net/c...b.bz2?download
    The optional larger fs image -- http://gniarf.nerim.net/colinux/blank/blank_4095Mb.bz2
    The optional swap file image -- http://gniarf.nerim.net/colinux/swap/swap_128Mb.bz2

    ******

    .:Section 2:.

    This section will be left fairly short... It's a straight forward Windows Installer. Follow the prompts there are only a few things to change.

    1. Don't Download the Base FS (you've already done that and in my experience this continually fails)
    2. Install to c:\coLinux (not Program Files)
    3. Tell XP to Allow the Unknown Driver to be installed

    ******

    .:Section 3:.

    Extract the base Debian system with your favourite extraction program... I use 7-zip because it's free.

    Place the extracted file in your coLinux install directory.

    Create a copy of the 'default.colinux.xml' file and name it debian.xml.

    Open debian.xml in your favourite text editor. I suggest Wordpad or Textpad as it will be displayed improprerly in notepad.

    The default config file will look like this:
    Code:
    ?xml version="1.0" encoding="UTF-8"?>
    <colinux>
        <!-- This line needs to point to your root file system. 
      	 For example change "root_fs" to the name of the Debian image.
             Inside coLinux it will be /dev/cobd0 
    	 
    	 Block Device Aliasing: You can now handle most dual-boot issues
    	 by adding an alias="devname" to block_device. i.e. alias="hda",
    	 alias="hda1" You can do this for SCSI as well as IDE.  You need
    	 to be aware that if you add an alias, you need to change your
    	 bootparams root="devname" appropriately (you may need to use
    	 devfs naming in some situations).  -->
        <block_device index="0" path="\DosDevices\c:\coLinux\root_fs" 
        enabled="true" />
        
        <!-- This line can specify a swap file if you wish, or an additional
             image file, it will /dev/cobd1. Additional block_devices can
    	 be specified in the same manner by increasing the index -->
    
        <block_device index="1" path="\DosDevices\c:\coLinux\swap_device" 
        enabled="true" />
    
        <!-- bootparams allows you to pass kernel boot parameters -->
        <bootparams>root=/dev/cobd0</bootparams>
    
        <!-- Initial RamDISK (initrd) support -->
        <initrd path="initrd.gz" />
        
        <!-- image allows you to specify the kernel to boot -->
        <image path="vmlinux" />
    
        <!-- this line allows you to specify the amount of memory available 
             to coLinux -->
        <memory size="64" />
    
        <!-- This allows you to modify networking parameters, see the README 
             or website or wiki for more information -->
        <network index="0" type="tap" />
    </colinux>
    We're going to make a few minor changes here... In the <block_device index="0" line we're going to modify remove root_fs and put the name of the debian image. This will result in a line similar to:
    Code:
        <block_device index="0" path="\DosDevices\c:\coLinux\Debian-20040605-mit.ext3.1610mb" 
        enabled="true" />
    We're also going to disable swap. If you decide you want it, you would edit the swap_device line to use the swap fs that you downloaded above. To disable the swap we're simply going to change enabled="true" to enabled="false" and we'll have this:

    Code:
        <block_device index="1" path="\DosDevices\c:\coLinux\swap_device" 
        enabled="false" />
    Save this file and close it. The final result is this for those of you too lazy to edit your own:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <colinux>
        <!-- This line needs to point to your root file system. 
      	 For example change "root_fs" to the name of the Debian image.
             Inside coLinux it will be /dev/cobd0 
    	 
    	 Block Device Aliasing: You can now handle most dual-boot issues
    	 by adding an alias="devname" to block_device. i.e. alias="hda",
    	 alias="hda1" You can do this for SCSI as well as IDE.  You need
    	 to be aware that if you add an alias, you need to change your
    	 bootparams root="devname" appropriately (you may need to use
    	 devfs naming in some situations).  -->
        <block_device index="0" path="\DosDevices\c:\coLinux\Debian-20040605-mit.ext3.1610mb" 
        enabled="true" />
        
        <!-- This line can specify a swap file if you wish, or an additional
             image file, it will /dev/cobd1. Additional block_devices can
    	 be specified in the same manner by increasing the index -->
    
        <block_device index="1" path="\DosDevices\c:\coLinux\swap_device" 
        enabled="false" />
    
        <!-- bootparams allows you to pass kernel boot parameters -->
        <bootparams>root=/dev/cobd0</bootparams>
    
        <!-- Initial RamDISK (initrd) support -->
        <initrd path="initrd.gz" />
        
        <!-- image allows you to specify the kernel to boot -->
        <image path="vmlinux" />
    
        <!-- this line allows you to specify the amount of memory available 
             to coLinux -->
        <memory size="64" />
    
        <!-- This allows you to modify networking parameters, see the README 
             or website or wiki for more information -->
        <network index="0" type="tap" />
    </colinux>
    We now have enough for a bootable system. Simply open a command prompt and browse to your install directory (c:\coLinux) and type in colinux-daemon -c debian.xml. The system will boot. The default login is username = root and password = root. Feel free to change your password at this point with the passwd command.

    ******

    .:Section 4:.

    Enabling networking is fairly simple... and as I said I'm going to cover the bridged networking setup.

    Most of the work has been done for you during the install, so this will be fairly simple. (Shut down coLinux if you still have it running at this point).

    The first thing you will want to do is configure a network bridge. If we go into Network Connections, we'll see a TAP-WIN32 Adapter. We're going to that and our network connect (Local Area Connection on most machines) and right click and select bridge. These will now be added to a network bridge. At this point you can also go into properties of TAP-WIN32, Configure, Advanced, Media Status and change it to always connected to get rid of the 'Cable is disconnected' box.

    Next we're going to edit the debian.xml file again. This time we want to modify near the bottom... The line that reads <network index="0" type="tap" />. We want it to read <network index="0" name="Local Area Connection" type="bridged" />, where Name="" is the name of the connection in the Network Bridge with your TAP-Win32 Adapter.

    Complete file for the Lazy:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <colinux>
        <!-- This line needs to point to your root file system. 
      	 For example change "root_fs" to the name of the Debian image.
             Inside coLinux it will be /dev/cobd0 
    	 
    	 Block Device Aliasing: You can now handle most dual-boot issues
    	 by adding an alias="devname" to block_device. i.e. alias="hda",
    	 alias="hda1" You can do this for SCSI as well as IDE.  You need
    	 to be aware that if you add an alias, you need to change your
    	 bootparams root="devname" appropriately (you may need to use
    	 devfs naming in some situations).  -->
        <block_device index="0" path="\DosDevices\c:\coLinux\Debian-20040605-mit.ext3.1610mb" 
        enabled="true" />
        
        <!-- This line can specify a swap file if you wish, or an additional
             image file, it will /dev/cobd1. Additional block_devices can
    	 be specified in the same manner by increasing the index -->
    
        <block_device index="1" path="\DosDevices\c:\coLinux\swap_device" 
        enabled="false" />
    
        <!-- bootparams allows you to pass kernel boot parameters -->
        <bootparams>root=/dev/cobd0</bootparams>
    
        <!-- Initial RamDISK (initrd) support -->
        <initrd path="initrd.gz" />
        
        <!-- image allows you to specify the kernel to boot -->
        <image path="vmlinux" />
    
        <!-- this line allows you to specify the amount of memory available 
             to coLinux -->
        <memory size="64" />
    
        <!-- This allows you to modify networking parameters, see the README 
             or website or wiki for more information -->
    <network index='0' name='Local Area Connection' type='bridged'/>
    </colinux>
    We can save this and startup our Debian instal again using the same command as last time. This time we should be connected. By default the network is setup to use the static ip 192.168.0.40. We can change this by using our favourite editor (vi for instance) and editing /etc/network/interfaces. Change the IP to one in your network range, or setup dhcp (change static to dhcp, however since I have't tried this, I'm unsure of whether or not a dhcp client ships with the debian fs). Now you just have to edit /etc/resolv.conf and place your nameservers. Now you should be able to successfully access the net. You should also be able to ssh into the image with your favourite ssh client (PuTTY for example).

    ******

    .:Section 5:.

    This section most likely doesn't need it's own section but that's ok... This is simply one command line, executed from the coLinux install directory:

    Code:
    colinux-daemon -c c:\coLinux\debian.xml --install-service "CoLinux - Debian"
    After it finishes it's steps you can go into services.msc and you'll see your new service. Simply start it and ssh in to continue on from here.

    ******

    .:Section 6:.

    Because this section has been nicely written up in the CoLinux wiki and it's not overly necessary, I'm including it solely as reference.

    Source: http://wiki.colinux.org/cgi-bin/ExpandingRoot

    The simplest way to enlarge the root partition:
    There is a tremendous amount of information in this entry, most of which makes something that can be simple far too complex. But here's the simplest way to do it, without doing any math or hijinx with dd, thanks to Gniarf's preformatted filesystems. Of course, if you want a filesystem of a size different than those provided, you'll need to read about the more complex ways below. 1) Download the larger, preformatted filesystem of your choice from http://gniarf.nerim.net/colinux/fs (Remember that 4095Mb is the limit if you are using FAT32 (and not NTFS) on the windows partition where the filesystem will be stored.)

    2) Unpack the new filesystem using the bunzip2 program of your choice, such as 7zip http://7zip.org

    3) Edit your colinux.xml config file. Add a line to load that filesystem on an unused cobd device, e.g.

    <block_device index="3" path="\DosDevices\c:\colinux\fs_4095Mb" enabled="true" />
    4) Boot into colinux. Make a mountpoint and mount the new filesystem from the cobd device. E.g.

    mkdir /mnt/test
    mount /dev/cobd3 /mnt/test (that's /dev/cobd/3 on GenToo)
    5) Copy the old filesystem onto the new filesystem using cp -ax. Once it finishes, unmount and exit colinux. E.g.

    cp -ax / /mnt/test
    umount /mnt/test
    shutdown -h now
    6) Change your colinux.xml config file to use the new filesystem as root and delete the line referring to the new filesystem you added in a previous step. (You might want to zip up the old filesystem for backup purposes.) E.g.

    <block_device index="0" path="\DosDevices\c:\colinux\fs_4095Mb" enabled="true" />
    7) Reboot colinx. You should have a larger filesystem (use "df -h" to check). You're done.
    I have editted the above slighly to account for the installation path we used (c:\colinux).

    ******

    .:Section 7:.

    Now we're going to get X up and running. The first step is to install the XWin Core and our VNC Server, which will also give us the other required software.
    First we'll want to update our packages
    Code:
    apt-get update
    Now we'll download and configure the X Server
    Code:
    apt-get install x-window-system-core
    Accept all the default configuration statements that appear.
    Now let's install KDE (this will take a while and use up a good chunk of disk space.... Depending on your user of the device, you can choose a different Window Manager or you may want to go back and do the fs size increase). Again just accept the install defaults (unless you want to play with them).
    Code:
    apt-get install kde
    Now for the VNC Server
    There are some installed packages that much be removed by force, so we're going to install the server using the below command.
    Code:
    apt-get -u -o APT::Force-LoopBreak=1 install vncserver
    You're going to want to tell it that yes you do want to install the packages and yes you do want to restart the services.

    Note: Most of this section is from http://wiki.colinux.org/cgi-bin/XCoLinux

    Now you can create a user or use root, but you'll want to go into your home directory and create a .vnc folder. Inside it you'll want to create a file called xstartup and paste the following:

    Code:
    #!/bin/sh
    startkde &
    Now you'll want to start the VNC Server

    vncserver :1 -geometry 1024x768 -depth 16
    You may want to play with the geometry to get the best for your screen so that you can still see your taskbar etc. I run a higher res so using 1024 is fine for me.

    The following will be displayed, note the line in bold.

    You will require a password to access your desktops.

    Password:
    Verify:
    xauth: creating new authority file /root/.Xauthority
    xauth: (argv):1: bad display name "colinux:1" in "add" command
    xauth: creating new authority file /root/.Xauthority

    New 'X' desktop is colinux:1

    Starting applications specified in /etc/X11/Xsession
    Log file is /root/.vnc/colinux:1.log
    You'll want to use that :1 to connect to the server. Let's open our vncviewer on our Windows desktop now and type the IP Address and :1 (192.168.0.40:1 if you're the same as I am).

    You'll be asked for your session password, and then on your first boot you'll be greated with the KDE Setup Wizard. You're now running KDE as natively as you can get on your Windows computer... With a full Linux system to back it.

    Enjoy.

    Peace,
    HT

    PS: If I get a chance, I'll compress my full setup... Finalized FS (with KDE Running), Config Files and the coLinux installer and throw them on my Website.

    I'm also going to attempt to create a 512MB and 256MB FS Images that can be carried on a USB Key to run on top of the system you may be working on.

  2. #2
    Senior Member gore's Avatar
    Join Date
    Oct 2002
    Location
    Michigan
    Posts
    7,177
    Not sure why no one replied, I thought this was awesome.

  3. #3
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Hey Hey,

    Thanks gore...

    For those of you looking for an easier way to settle some dependencies... Install vncserver before you install the x win core.. I was playing aorund with and experimenting a bit today..

    I'm a little confused by it actually.... It's running great as a service on my work machine.. it's been running for the past like 24 hours.... However the one I setup here seems to die after a couple of hours... I'm looking into it.. seems sometimes you can have problems with memory limits,although that's pretty much been cleaned up with this last one.

    Peace,
    HT

  4. #4
    Junior Member
    Join Date
    Dec 2005
    Posts
    6
    This looks sweet but is it hard to do and if I mess up will it damage my pc?

  5. #5
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Hey Hey,

    It's very simple to do... even simplier if you do the VNCServer install before the xwin core... I had no problems .. did it the second itme in about 15 minutes... and no damage to your PC if you screw up.. no need to worry about fubaring partions or anytihng else.

    Peace
    HT

  6. #6
    Junior Member
    Join Date
    Dec 2005
    Posts
    6
    This tutorial is a life saver. Man this is realy cool.

  7. #7
    Junior Member
    Join Date
    Dec 2005
    Posts
    6
    Sorry for the double post but
    in step...

    2. Install to c:\coLinux (not Program Files)

    Are you talking about installing colinux?

  8. #8
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Hey Hey,


    Sorry for the late reply.... (I should subscribe to my own posts.. heh).

    Yes I mean coLinux... (well everything will go there in the end).

    Peace,
    HT

  9. #9
    Junior Member
    Join Date
    Dec 2005
    Posts
    6
    Ok i got it working but how do i get the desktop of linux up, im a little confuzed in that area.

  10. #10
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    Hey Hey,

    Basically just follow section 7 step by step.. which part of it are you confused by?

    Also if you decide to go bridged... You can follow all the steps but leave out the actual bridging of your adapters (assuming you've got WinPcap installed)... it'll stop a lot of network problems.

    Peace,
    HT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •