Gerard Braad

F/OSS & IT Consultant on Openness and Interoperability

You can follow more frequent updates via my Identi.ca profile (feed).

Friday, March 20, 2009

openSUSE 11.1 on coLinux

To ease cross-platform .NET development, I have installed openSUSE on coLinux. This allows me to develop from Windows and also test and debug the binary on Linux. Advantages are: No need to dual boot and a much better performance than using VMware or other virtualization solution. In this article you can find the base system and I will describe how I did the base installation.

Take note, these instructions do NOT provide any details about the .NET environment. Those are published on my .NET blog.

Monodevelop

The files to install and run the environment 'colinux-opensuse-11.1.exe' can be found at [VIPeers], [dropbox] (113Mb). This file contains the base system.img, a swap image and start commands. If you don't want to install it yourself, you can at least immediately start to use openSUSE on coLinux. Take note, network has not been configured yet (see notes). The user account is 'root' with the password 'password'.

Preparation
The installation closely follows the instructions I wrote for CentOS. You will need a clean system.img which you can find in the colinux-centos52-base.rar. Copy the Debian businnesscard init ramdisk to install_initrd.gz. And of course you need to download the openSUSE 11.1 DVD from http://www.opensuse.org/. This file will be about 4.25GB in size.

You can perform a RPM installation, but since openSUSE provides an image-based installation I will use this for the base of the coLinux environment. My main purpose was to keep the installation easy to perform (and if possible small in size). Copy the files base-i386.tar.lzma, base-meta-i386.tar.lzma and common-base-i386.tar.lzma from the openSUSE 11.1 DVD. It is located in the directory images. Since the Debian initrd does not contain the lzma binary, so you will need to decompress the archives with a tool like 7-Zip. The resulting files will be standard tape-archives. Place them in a directory called 'images'. The install.bat will map it to cofs1.

Installation
If you have the install files from the opensuse-11.1.exe file, the images, debian's install_initrd.gz and the system.img from the centos52-base.rar, you are ready to go.

Start the install.bat. You will see a debian installation screen... toggle with ALT-F2 to a console and press Enter.

Please press Enter to activate this console.

Please press Enter to activate this console. BusyBox v1.10.2 (Debian 1:1.10.2-2) built-in shell (ash) Enter 'help' for a list of built-in commands.

From here you can perform the following commands. The line which says 'tar -C /mnt/linux -xf $i' will unpack the image to the system.img. Just be sure to have some coffee ready since it might take some time.


mkswap /dev/cobd7
swapon /dev/cobd7

mkdir /mnt/linux
mkdir /mnt/win
mount /dev/cobd0 /mnt/linux
mount -t cofs cofs0 /mnt/win

mkdir /mnt/images
mount -t cofs cofs1 /mnt/images
cd /mnt/images

for i in *.tar
do
tar -C /mnt/linux -xf $i
done

mkdir -p /mnt/linux/media/cdrom
mount /dev/cobd1 /mnt/linux/media/cdrom

chroot /mnt/linux
cd /media/cdrom/suse/i586

rpm -ivh openSUSE-release-[0-9]*.rpm \
openSUSE-release-dvd-[0-9]*.rpm

echo password | passwd - stdin root

cat > /etc/fstab << END
/dev/cobd0 / ext3 acl,user_xattr 1 1
/dev/cobd7 swap swap defaults 0 0
proc /proc proc defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
END

exit


After this you can halt the system. And start it for the first time.

Post-install
To finish the installation you need to start it with the coLinux initrd once. The script runonce.bat will take care of that... after you have run it, openSUSE will start properly. Log on and halt again. After this you can start it without a initrd being specified. The script run.bat will start the final system.

openSUSE 11.1 started on coLinux 0.7.3

It might give some startup errors... nothing serious. I didn't configure the network inside the base system. This can be done using yast or perform the following command:


for i in 0 1
do
cat > /etc/sysconfig/network/ifcfg-eth$i << END
BOOTPROTO='dhcp'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NAME=''
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
USERCONTROL='no'
END
done


This enables both eth0 and eth1 to use DHCP. Kernel modules can be installed with the same RPM I have provided earlier. Just use the following commands:


zypper in http://gbraad.fedorapeople.org/files/kernel-modules-2.6-co0.7.3.i386.rpm


Alternative installation
If you want to perform a RPM-based installation you will still need to install the base-i386.tar image. I tried without, but ended up with a lot of errors during installation. The can find the installation instructions in the file instructions-rpm.txt which is included in the archive. Eventually I have not further tested this alternative installation...

Notes
I have tried to only use the files provided by openSUSE, but somehow they seem to consume too much time. The common filesystem did not provide all the tools I needed (similar to the stage2.img from redhat). If you know another way to install it, let me know. Qemu can also install it, but it consumes a lot more time in my opinion; install, dd, etc.

For the moment it is not possible to perform an image installation without the openSUSE DVD installation media. I do hope they will provide a single CD image installer or provide the images from their 11.1 download site. If it is possible, please enlighten me?!

If you want to install additional software, you will need to add the openSUSE repositories. This can easily be done using zypper.


zypper ar http://download.opensuse.org/distribution/11.1/repo/oss/ openSUSE111
zypper ar http://download.opensuse.org/distribution/11.1/repo/non-oss/ openSUSE111_NonOSS
zypper ar http://download.opensuse.org/update/11.1/ openSUSE-11.1-Updates


Now you can install Gnome by using a command like:


zypper in -t pattern gnome


More information about installing software can be found on openSUSE Tutorials.

Have a lot of fun...

4 comments:

Henry said...

Hello Gerard,

very nice idea to create fresh coLinux image files without Qemu. Thanks for your step guide here and the CentOS!

Henry N.

Hannes said...

Works all very well.

Very good explantion.

My problem is, i dont know SUSE good enugh to get the networking set up correctly.

Could generate the two eth0 and eth1 with:

for i in 0 1
do
cat > /etc/sysconfig/network/ifcfg-eth$i << END
BOOTPROTO='dhcp'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR=''
MTU=''
NAME=''
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
USERCONTROL='no'
END
done


Using yast was not possible, becaus yast complained about missing hardware driver.

Would apriciate if you could make an extra blog about setting up the network.

axelh said...

Hi Gerard,
would it be possible to install opensuse from the 11.2 boot cd as a network based installation with coLinux?
Cordially,
Axel

gbraad said...

Hi Axel,
That did not work for me for any of the distros. But have to admit I did not put a lot of thought and time into it to resolve it. I am more familiar to the from-scratch approach as described on my blog. Sounds too simple, but try to ask in the forum on sf.net. I might try to create a new image someday...

Followers