Wikia

coLinux

Wubi

Talk0
235pages on
this wiki

Howto: Run a WUBI installation under coLinux (Ubuntu installer for Windows)Edit

The Installation from Wubi can simple use as basic installation for coLinux. Here are the steps.

Install WubiEdit

I used Ubuntu 8.10 (2009-01-04) for this description here.
  • Install Xubuntu in normal way, choose your language and packets
I used minimal, 3.8 GB filesystem and 200 MB swap
  • Test the running Wubi and boot Ubuntu
  • Login as root, set root password, check that you can login as root.
  • Check that you have installed a console editor (for example nano).

Where are the files we need?Edit

  • C:\ubuntu\disks\root.disk Contains the root filesystem
  • C:\ubuntu\disks\swap.disk Contains the swap
  • c:\ubuntu\disks\boot\ Contains boot files, native kernels, initrd and bootloader. We don't need for coLinux.

All files leave untouched.

Create coLinux start scriptEdit

  • Boot Windows and create a new file "ubuntu.cmd" in your coLinux install directory (c:\colinux or "c:\program files\colinux"). Put this code into the file:
REM change to coLinux install path
cd c:\colinux
REM start coLinux
colinux-daemon kernel=vmlinux cocon=100x60 ^
 cobd0=C:\ubuntu\disks\root.disk ^
 cobd1=C:\ubuntu\disks\swap.disk ^
 root=/dev/cobd0 text ^
 eth0=slirp ^
 cofs0=. cofs1=C:\ubuntu\disks\boot
  • If you use notepad, then check that the file does ends with ".cmd" or ".bat" and not with ".txt"!
  • The ^ lets continue long lines in next line under Windows.
  • Replace the path c:\colinux with your current coLinux install directory.
  • Change the console size after cocon=... as you like. Or remove it completely.
  • The entry cofs1 is optional. It points to /boot and is not real used. (see fstab later)
  • The word text as boot parameter says, that GDM (graphic login) should not run. This is a text only mode.

First bootEdit

  • Please reboot Windows before you first try to start coLinux. This helps you, not loosing data from last changes, in case coLinux does not start and crash your system (sometimes)!
  • Start the script ubuntu.cmd
  • Ubuntu will start with lot of errors, for example:
error: "vm.mmap_min_addr" is an unknown key
...
mount: special device /host/ubuntu/disks/boot does not exist
...
FATAL: Could not load /lib/modules/2.6.22.18-co-0.8.0/modules.dep:
 No such file or directory
$Loading AppArmor module: Failed.
...
/dev/mem: mmap: Bad address
  • Don't worry. In the end you should get a login prompt like this:
Ubuntu 8.10 ubuntu tty1

ubuntu login:

Adjust fstab entriesEdit

fstab Wubi defaultEdit

The default installation would have this entries:

# /etc/fstab: static file system information.
#
# <file system>       <mount point>  <type>  <options>   <dump>  <pass>
proc                          /proc  proc    defaults         0       0
/host/ubuntu/disks/root.disk  /      ext3    loop,errors=remount-ro 0 1
/host/ubuntu/disks/boot       /boot  none    bind             0       0
/host/ubuntu/disks/swap.disk  none   swap    loop,sw          0       0
  • Make a backup of current fstab "cp /etc/fstab /etc/fstab.orig"

fstab for coLinux onlyEdit

  • Change the entries for Root, Swap and boot as follow:
# /etc/fstab: static file system information for coLinux.
#
# <file system> <mount point>   <type>  <options>    <dump>  <pass>
proc            /proc           proc    defaults          0       0
/dev/cobd0      /               ext3    errors=remount-ro 0       1
cofs1           /boot           cofs    defaults          0       0
/dev/cobd1      none            swap    sw                0       0

boot is optional and never used. You can comment out or remove it.

Hint: Keys Win+V inserts the copy&paste buffer from Windows.

fstab for dual bootEdit

  • If you wish to boot Wubi and coLinux with same fstab, then add the coLinux entries behind the defaults.
# /etc/fstab: static file system information.
#
# <file system>       <mount point>  <type>  <options>   <dump>  <pass>
proc                          /proc  proc    defaults         0       0
/host/ubuntu/disks/root.disk  /      ext3    loop,errors=remount-ro 0 1
/host/ubuntu/disks/boot       /boot  none    bind             0       0
/host/ubuntu/disks/swap.disk  none   swap    loop,sw          0       0
#
# Mount points under coLinux
/dev/cobd0      /               ext3    errors=remount-ro 0       1
/dev/cobd1      none            swap    sw                0       0

Under coLinux the files "/host/ubuntu/..." would not found and mount will skip these. Under native Ubuntu the "/dev/cobd..." does not known by kernel and will skip. You will see some warnings.

Installing modulesEdit

  • I assume, that cofs0 points to your coLinux installation and the modules exist as archive vmlinux-modules.tar.gz there. Mount cofs0 and install modules as follow:
mount cofs0 -t cofs /mnt
tar xzf /mnt/vmlinux-modules.tar.gz -C /
depmod

Second bootEdit

  • Now, type reboot. After next start, mostly errors should solved and the swap will use.
  • Here are my outputs from commands free and mount:
root@ubuntu:~# free
             total       used       free     shared    buffers     cached
Mem:        255952      70716     185236          0       4156      48432
-/+ buffers/cache:      18128     237824
Swap:       195304          0     195304

root@ubuntu:~# mount
/dev/cobd0 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
cofs1 on /boot type cofs (rw)
securityfs on /sys/kernel/security type securityfs (rw)

Fine tuneEdit

From here we tune up the boot scripts to not have to many errors.

Hardware clockEdit

Disable the access to hardware RTC by editing the file /etc/default/rcS and change or add this entry:

HWCLOCKACCESS=no

Setting up console font and keymap ... has long delayEdit

Edit file /etc/init.d/console-setup and add a bypass for coLinux near line 14. Add the line that is marked with '+':

 set -e
 
+uname -r | grep -qe "-co-" && exit 0
 test -f /bin/setupcon || exit 0
 
 if [ -f /lib/lsb/init-functions ]; then

suppress ACPI errorsEdit

Edit file /etc/init.d/acpi-support and add a bypass for coLinux near line 12. Add the line that is marked with '+':

--- /etc/init.d/acpi-support.orig
+++ /etc/init.d/acpi-support
@@ -9,6 +9,7 @@
 test -f /lib/lsb/init-functions || exit 1
 . /lib/lsb/init-functions
 
+uname -r | grep -qe "-co-" && exit 0
 test -d /var/lib/acpi-support || exit 0
 
 shopt -s nullglob

udev: renamed network interface eth0 to eth2Edit

On my system udev renamed eth0 to eth2. To solve this, first I have changed in the file /etc/udev/rules.d/70-persistent-net.rules the NAME="eth2" into NAME="eth0".

This helps for a while. But here is a better way:

  • Edit file /etc/udev/rules.d/75-persistent-net-generator.rules if it exists and set a bypass for coLinux in same way as xen or UML does it. Add the with + marked lines after the entry Xen (near line 26. If the file doesn't exist, create it by copying /lib/udev/rules.d/75-persistent-net-generator.rules, it should already contain the necessary lines. Make sure that the LABEL defining the end of generation instructions is set near the end of the file, otherwise you'll mess the system...)
 # ignore Xen virtual interfaces
 SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"
 
+# Do not rename coLinux network devices
+DRIVERS=="conet", GOTO="persistent_net_generator_end"
+
 # read MAC address
 ENV{MATCHADDR}="$attr{address}"
  • Then edit file /etc/udev/rules.d/70-persistent-net.rules and remove all lines with "(conet)" in comments, if any. You will mostly find a lot of them. Please remove them all.
Such lines will never be created again, with the changed persistent-net-generator.rules (see above).
Only users of Dualboot should leave lines, that have no "(conet)" in comment.
  • After next reboot eth0 should be the slirp and network will be set automatically from the buildin dhcp.
  • ifconfig eth0 shows this now:
eth0      Link encap:Ethernet  HWaddr 00:ff:b3:da:79:80
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
...

UTF-8Edit

FLTK and NT console don't support UTF-8. It's good idea to disable UTF-8 in the default configuration. I have a German installation, so I used "de_DE" in my examples. Replace de_DE with your language code.

  • Create the locale with this command:
locale-gen de_DE
  • Edit the file /etc/default/locale and remove the UTF-8 from LANG. I changed it from LANG="de_DE.UTF-8" into LANG="de_DE".
  • Edit the file /etc/environment and remove the UTF-8 from LANG.

If you later login with Putty, you can enable UTF-8 inside Putty by exporting the variable LANG with "de_DE.UTF-8" (in menu "Connection" - "Data") and set the "Character set translation on received data" to UTF-8 (in menu "Window" - "Translation").

Fix up long timeout from GDM on shutdownEdit

GDM is not running, so we not need to wait for killing this task.

Edit file /etc/init.d/gdm and add a bypass for coLinux before the message "Stopping GNOME Display Manager". Add the line that is marked with '+':

--- /etc/init.d/gdm.orig
+++ /etc/init.d/gdm
@@ -83,6 +83,7 @@
        fi
   ;;
   stop)
+       uname -r | grep -qe "-co-" && exit 0
        log_begin_msg "Stopping GNOME Display Manager..."
        start-stop-daemon --stop  --quiet --oknodo --pidfile $PIDFILE --name gdm ...
        log_end_msg 0

"vm.mmap_min_addr" is an unknown keyEdit

Edit file /etc/sysctl.d/10-process-security.conf and comment out the line with entry "vm.mmap_min_addr = 65536".

/dev/mem: mmap: Bad addressEdit

This is harmless and I don't have fixed it.

Trouble shootingEdit

System maintain mode Edit

System maintain mode you can activate for Ubuntu 8.10 by adding the word single into coLinux config line as boot parameter.

View into your boot menu from file c:\ubuntu\disks\boot\grub\menu.lst (under Windows) to find the boot parameter on your Ubuntu version in the section with title "recovery mode".

More LinksEdit

Support Request 2485983: Booting a WUBI image from c:\ drive in CoLinux

Around Wikia's network

Random Wiki