coLinux
Register
Advertisement

<msonsuz> I started this page because I needed help to install Fedora from scratch and use it in colinux. Now I did it myself by using all help in this wiki from what others wrote and I hope it will help someone else. And I have a place to get back if I forgot how I dit it :) If you can improve please do. If you have questions ask at techdesk100 (at) hotmail (dot) com (I check it once a week).

Extra information[]

Because I use mingw cygwin colinux qemu etc. I made a folder in my c drive called Linux and which has subfolders for each distribution.

c:\Linux 
- Colinux
- Cygwin
- Distro (the folder with image files for colinux/qemu/distribtion iso's)
- Mingw
- Qemu
...

Link[]

TOOLS

  • explore2fs To be able to copy your files from image in Windows. One way.
  • unxutils like dd ls

WEBSITES

Qemu to make an minimal install image[]

Qemu is an linux emulator which is not as fast as colinux (my opinion) even if there is an accelerator. So what we are going to do is to make an installation image in qemu and convert it to colinux.

  • Download Fedora Core 4 image from Fedora and put in Distro folder
  • Download Qemu from most recent windows port here is official site
  • After extracting qemu zipfile from windows port go with command prompt to folder
  • make a image to install fedora core (minimal 700MB) in dos by typing (2gb would be 2147483648 + 63*512)
fsutil file createnew c:\Linux\Distro\qemu_fc4_min_2gb 2147515904
  • make a image for a swap file in dos by typing
fsutil file createnew c:\Linux\Distro\qemu_swap_512 536903168
  • now make a batch file (like start_install.bat) in same folder in notepad and change settings like qemu_dir and name of iso file
@ECHO OFF

set qemu_dir=C:\Linux\Distro
set hd=%qemu_dir%\qemu_fc4_min_2gb
set swap=%qemu_dir%\qemu_swap_512
set cdrom=%qemu_dir%\FC-4_i386.ISO
set mem=256

qemu -hda %hd% -hdb %swap% -cdrom %cdrom% -m %mem% -boot d -L .
pause
  • start up start_install.bat and install fedora core with the second drive a swap drive

(don't forget to choose minimal install by installation :) )

Convert image to colinux[]

I found this on one of the wikipages. It said it was possible to change a qemu image to colinux. That's why I used qemu to begin with.

  • download and install unxutils I found a link here
  • go in command prompt to your qemu dir and convert qemu image to colinux image
dd if=qemu_fc4_min_2gb of=fc4_min_1gb.img bs=512 skip=63
  • you only need the file qemu_fc4_min_1gb the other 2 files you can remove now (but you could save it for temp backup)

install colinux and make image bootable[]

Now we can start with colinux. Don't forget to change noexecute option for windows XP in alwaysoff. I also make an extra image disk of 1GB which I use between different distributions as a second disk. So that I do not have to copy things from 1 distribution to another

  • Install colinux with Tap
  • Create an extra image 1gb file by using the following command in the dosprompt (windows XP):
fsutil file createnew c:\Linux\Distro\ext3_disk_1gb 1073741824 
  • Create a swap image 512 mb because I will use 256 mb memory by using the following command in the dosprompt (windows XP):
fsutil file createnew c:\Linux\Distro\swap_512mb 536870912
  • Create a colinux.conf file in the Distro folder for example colinux_fc4_minimal.conf:
############################################
# MAKE SURE THERE IS AN EXTRA LINE AT THE END
# OF THE BATCH FILE
#
# initrd should only be used at first start
# to install kernel modules for example when
# you upgrade your colinux
############################################
############################################
# DEFAULT
############################################

kernel=vmlinux
initrd=initrd.gz
mem=256
root=/dev/hda1 fastboot

############################################
# Drives
############################################
#cobd0=C:\Linux\Distro\image
#hda1=:cobd0
############################################

hda1=C:\Linux\Distro\fc4_min_1gb.img
hda2=C:\Linux\Distro\ext3_disk_1gb
hdb1=C:\Linux\Distro\swap_512mb

############################################
# Ethernet
############################################
#eth0=slirp,00:ff:00:00:00:00
#eth0=pcap-bridge,"LAN", 00:ff:00:00:00:00
#eth0=tuntap,TAP,00:ff:00:00:00:00
############################################

eth0=tuntap,"TAP",00:ff:00:00:00:00
eth1=pcap-bridge,"LAN",00:ff:00:00:00:01
  • Create a batch file in the colinux folder for example start_fc4_minimal.bat:
@echo off
colinux-daemon.exe -c "c:\Linux\Distro\colinux_fc4_minimal.conf" -t nt
pause
  • doublepress start_fc4_minimal.bat so it starts colinux and loads it
  • login with your username and pass
  • format swap
mkswap -c -v1 -L SWAP /dev/hdb1
  • format extra image to ext3
mkfs -t ext3 /dev/hda2
  • edit /etc/fstab
# this is what I changed mine fstab to
/dev/hda1	/		ext3	defaults 	1 1
/dev/hda2	/mnt		ext3	defaults	1 1
/dev/devpts	/dev/pts 	devpts	gid=5,mod=620	0 0
/dev/shm	/dev/shm	tmpfs	defaults	0 0
/dev/proc	/proc		proc	defaults	0 0
/dev/sys	/sys		sysfs	defaults	0 0
/dev/hdb1	swap		swap	defaults	0 0
  • edit /etc/inittab (is not needed with minimal install but still)
#to make a console login without gui bootparams nogui is same
id:3:initdefault:
  • restart colinux
shutdown -r now

making it colinux proof[]

When booting you get some failures. here you can find the solutions.

error: setting default font (latarcyrheb-sun16): putfont: PIO_FONT: Function not implemented

  • Rename the program /bin/setfont to /bin/setfont.old
mv /bin/setfont /bin/setfont.old
  • Create a new script file /bin/setfont with condition for coLinux
#!/bin/bash

if ! uname -r | grep -q -e "-co-"
then
	/bin/setfont.old $@
fi
  • and make it executable
chmod +x /bin/setfont

error: hwclock is unable to get I/O port access: the iopl(3) call failed.

  • coLinux don't allow hwclock. Edit file /etc/rc.d/rc.sysinit, locate the line with hwclock and add a condition for colinux:
# /sbin/hwclock $CLOCKFLAGS
if ! uname -r | grep -q -e "-co-"
then
	/sbin/hwclock $CLOCKFLAGS
fi
  • Edit file /etc/rc.d/init.d/halt, locate the line with hwclock and write a condition for colinux:
# runcmd $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS
if ! uname -r | grep -q -e "-co-"
then
	runcmd $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS
fi

error: Starting Udev [failed]

  • update udev to 0.7.1
yum install udev

error: raidautorun: failed to open /dev/md0: 6

  • comment out in /etc/rc.d/rc.sysinit
#echo "raidautorun /dev/md0" | nash --quiet

Disable the following services

chkconfig auditd off
chkconfig bluetooth off
chkconfig irda off
chkconfig isdn off
chkconfig nfslock off

Or better remove them

yum remove bluez*
yum remove irda-utils
yum remove isdn4k-utils
yum remove pcmcia-cs
yum remove ppp
yum remove mdadm dmraid

Bootparamaters[]

  • goes at startup directly to bash instead of running init script
init=/bin/bash
  • runlevel 3 for console and 5 for X windows
3
  • to skip e2fsck
fastboot

networking colinux[]

You have a working minimal fedora core 4 in colinux. The next step is to get networking started. We will make two network connections.

  1. eth0 - 10.0.0.100 - onboot yes - TAP - internal network - cannot be seen outside pc
  2. eth1 - DHCP - onboot no - bridged to LAN - external network - linux can be seen from other computers and gets his own IP from dhcp

You could also do network sharing by enabling this in your networkcard to your TAP. But I prefered this way.

setup eth0

  • In your Windows network connections rename your connection with the tap adapter to the name TAP
  • make the ipadress of TAP a static one with ip 10.0.0.10 and subnetmask 255.255.255.0
  • Start start_fc4_minimal.bat and login your colinux fedora core 4
  • edit your /etc/sysconfig/network-scripts/ifcfg-eth0
  • In your Windows network connections rename your connection with the tap adapter to the name TAP
  • edit /etc/sysconfig/network-script/ifcfg-eth0
# File: /etc/sysconfig/network-script/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.0.0.100
NETMASK=255.255.255.0
GATEWAY=10.0.0.10
  • Now you can from windows ssh your colinux using 10.0.0.100

setup eth1

  • In your Windows network connections rename your connection with the LAN adapter to the name 'LAN
  • Start start_fc4_minimal.bat and login to your colinux fedora core 4
  • edit your /etc/sysconfig/network-scripts/ifcfg-eth1 if it not exists make one
# File: /etc/sysconfig/network-script/ifcfg-eth1
DEVICE=eth1
ONBOOT=no
BOOTPROTO=dhcp

When you start colinux it will start the eth1 by using command ifup eth1 and will get an IP adress from the router where the LAN adapter gets his ip-adress. It will be a different IP-adress. With ifconfig eth1 you can find out the IP adress and ssh it from another pc.

DNS

  • to use a dns server edit /etc/resolv.conf
nameserver 111.111.111.111

Update fedora core[]

(Can put something more about the update process. Somebody interested) howto upgrade to other distributions

  • connect to the internet
ifup eth1
  • update existing installation
yum update
  • if you want to change settings for the repository go to /etc/yum.repos.d/


XDMCP (external Xwindows) login[]

For the client part I use XMING and I use KDE(but you can use your own like winx-32 x-deep32 gnome). This costed me two days to figure out because of 1 line in the Xserver file. If you enable XDMCP in a normal linux environment when you start your xdm server it automatically starts the gui. But in colinux it is not possible to do that. My colinux crashed a lot before I could use it. Another usefull link

  • startup eth1
ifup eth1
  • get xwindows
    • get minimal kde
yum install kdebase
    • or get full kde
yum groupinstall "KDE (K Desktop Environment)"
    • or get full GNOME (with setup xdmcp you are for now on your own/Maybe somebody could add to this)
yum groupinstall "GNOME Desktop Environment"
  • edit in /etc/X11/xdm/kdmrc
[xdmcp]
#Enable=false
Enable=true
#comment out #Port=177
Port=177
  • comment out in /etc/X11/xdm/xdm-config
! put an ! in front of DisplayManager.requestPort: 0
! DisplayManager.requestPort: 0
  • edit for external login (every pc) in /etc/X11/xdm/Xaccess
#*		# any host can get a login window
*		# any host can get a login window
  • edit for internal login (host pc) in /etc/X11/xdm/Xaccess
#*		# any host can get a login window
10.0.0.10	# 10.0.0.10 can get a login window
  • comment out in /etc/X11/xdm/Xservers (to make it not start xwindows for local machine)
#:0 local /usr/bin/X
  • comment out in /etc/X11/xdm/kdmrc (to make it not start xwindows for local machine)
#StaticServers=:0
  • start xdm
xdm
  • create file xming.xlaunch on windows host
<?xml version="1.0"?>
<XLaunch 
	xmlns="http://www.straightrunning.com/XmingNotes" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
	xsi:schemaLocation="http://www.straightrunning.com/XmingNotes xlaunch.xsd" 
	WindowMode="Windowed" 
	ClientMode="XDMCP"
	XDMCPHost="10.0.0.100"
	XDMCPBroadcast="false"
	XDMCPIndirect="false"
	Display="0" 
	Clipboard="true" />
  • doublepress xming.xlaunch to start xming and voila you have your xwindows


  • to make xdm start at startup so that you do not have to login in colinux edit /etc/inittab
#x:5:once:/etc/X11/prefdm -nodaemon
x:5:once:/usr/X11R6/bin/xdm -nodaemon
  • add to root option 5 in your conf filecolinux_fc4_minimal.conf:
############################################
# DEFAULT
############################################

kernel=vmlinux
initrd=initrd.gz
mem=256
#starts xming automatically
exec0="C:\Program Files\Xming\Xming.exe",":0 -query 10.0.0.100  -clipboard"
#root=/dev/hda1 fastboot 3 #starts runlevel 3
root=/dev/hda1 fastboot 5  #starts runlevel 5

APACHE with PHP/MySQL[]

Installing a webserver is really really easy

  • start internet
ifup eth1
  • install apache
yum install httpd
  • make apache start at boot
chkconfig httpd on
  • install php
yum install php
  • add to end in /etc/httpd/conf/httpd.conf
AddType application/x-httpd-php .php
  • install mysql-server
yum install mysql-server
  • install to be able to use mysql from apache
yum install php-mysql
  • make mysql start at boot
chkconfig mysqld on
  • set password for mysql (change the pass123 into something else)
mysqladmin -u root password 'pass123'
  • restart colinux
shutdown -h now

DUMP: THINGS I USED BUT LATER REMOVED[]

    • make nodes in dev folder without null zero and console it does not work (FEDORA CORE 1..4) (skip this and do only if needed)
mknod -m 666 /dev/null c 1 3
mknod -m 666 /dev/zero c 1 5
mknod /dev/console c 4 0
    • add nodes by editing 50-udev.nodes in /etc/udev/makedev.d/ folder (FEDORA CORE 5) (skip this and do only if needed)
cobd0
cobd1
cobd2
cobd3
cobd4
cobd5
cobd6
cobd7
tty0
  1. rest of nodes which are already in this file
tty
tty1
....

  • Create a colinux xml file in the Distro folder for example colinux_debian.xml:
<?xml version="1.0" encoding="UTF-8"?>
<colinux>

<block_device index="0" path="\DosDevices\z:\Debian-3.0r2.ext3-mit-backports.1gb" enabled="true" /> <block_device index="1" path="\DosDevices\z:\fc4_min_1gb.img" enabled="true" /> <block_device index="2" path="\DosDevices\z:\ext3_disk_1gb" enabled="true" /> <block_device index="7" path="\DosDevices\z:\swap_512mb" enabled="true" />

	<bootparams>root=/dev/cobd0</bootparams>
 	<memory size="256" />
	<image path="vmlinux" />
	<initrd path="initrd.gz" />
	<network index="0" type="tap" name="TAP" />
</colinux>
  • Create a batch file in the colinux folder for example start_debian.bat:
@echo off
subst z: "c:\Linux\Distro"
colinux-daemon.exe -c "z:\colinux_debian.xml"
subst /d z:
  • doublepress start_debian.bat so it starts colinux
  • login the distribution (in this case debian which has user root and pass root)
    • it can happen that de distribution had no addition cbod* in /dev if that is the case do
mknod /dev/cobd1 b 117 1
mknod /dev/cobd2 b 117 2
mknod /dev/cobd7 b 117 7

and restart colinux

  • mount the minimal fedora core 4
mount /dev/cobd1 /mnt
  • log into minimal fedora core 4
chroot /mnt
  • the following changes are needed to make it bootable in colinux

  • to create all pty
/dev/MAKEDEV pty

  • make a image to install fedora core (minimal 700MB) in dos by typing
qemu-img create c:\Linux\Distro\qemu_fc4_min_1gb 1000M
  • make a image for a swap file in dos by typing
qemu-img create c:\Linux\Distro\swap_temp_512.img 512M

Advertisement