Bering
Home
About
Developing
   Section 1
   Section 2
   Section 3
   Section 4
   Section 5
   Section 6
   Section 7

Search Web Pages




4. Kernel & modules development using a virtual Debian/woody box

This virtual machine will be used for Bering kernel & modules development. It is the latest available version of Debian "woody" at this time (November, 3, 2002). The virtual machine is already populated with a Bering patched 2.4.18 linux kernel source file.


4.1. Installing your virtual Debian/woody machine

First of all create a new non-root account (e.g. leafuml) and login to that account. Then:

a) Download a 2.4.XX-YY UML kernel from the Leaf_UML section of the LEAF download area. Unpack it and make it executable:

cd /home/leafuml
bunzip2 linuxuml-2.4.XX-YY.bz2
chmod 755 linuxuml-2.4.XX-YY
Important

Replace XX by the linux kernel "sublevel" number and YY by the UML patch number available for that linux kernel. In the examples below you will have to replace XX and YY by the actual numbers of the UML kernel you have downloaded.

b) Download the Leaf_UML Debian "woody" filesystem with the basic set of packages allowing compilation of LEAF "Bering" kernel and modules. Unpack it:

cd /home/leafuml
bunzip2 root_fs_woody.bz2

You will end up with a 500M root_fs_woody ext2 filesystem. Make sure your linuxuml kernel is executable (chmod 755 linuxuml-2.4.XX-YY)

Make sure everything is working by issuing the command (within an xterm):

./linuxuml-2.4.XX-YY ubd0=root_fs_woody

You should see the kernel boot sequence in your xterm and at the end of the process three new virtual console will pop up. You can now log into your new virtual machine.

Important

The password of the root login is root.

Issue your favorite commands to make sure you are in a linux box :-). Then halt.

4.2. Connecting your virtual machine to the network

First make sure ethertap + netlink_dev or tuntap are compiled within your host kernel or loaded as a module.

Let's assume your host is at IP 192.168.1.1 and belongs to a 192.168.1.0/24 private network connected to the Internet through the 192.168.1.254 gateway (your LEAF box).

Launch your virtual machine by issuing the command (if your host runs ethertap):

./linuxuml-2.4.XX-YY ubd0=root_fs_woody eth0=ethertap,tap0,,192.168.1.100

If your host runs tuntap (which appeared with 2.4 kernels), you will rather issue the following command:

./linuxuml-2.4.XX-YY ubd0=root_fs_woody eth0=tuntap,,,192.168.1.100

Login as root on your UML Debian/woody machine. Then issue the following command:

ifconfig

You should see the address defined in the virtual machine /etc/network/interfaces file defined. Adjust this file if necessary. You should be able to ping your host (192.168.1.1), any external IP's and any domain name (ping www.yahoo.com).

For more information on UML and networking please refer to the UML documentation.

Note

If you issue ifconfig and netstat -ar commands on the host machine you will notice that an ethertap device has been fired at address 192.168.1.100 and a route is now available to the reach the UML. This has been done automatically by the uml_net program which was installed to begin with (See prerequisites).

4.3. Connecting your virtual machine to the host filesystem

This is as easy as:

mount none /mnt -t hostfs -o /some/host/directory

This command, issued within the UML machine, will attach /some/host/directory to the UML /mnt directory.

  • Created on 2004-03-26 12:01:11 by mhnoyes
  • Updated on 2004-05-02 12:09:00 by mhnoyes

 Printable Version


Hosted on Get LEAF Linux Embedded Appliance Framework at SourceForge.net. Fast, secure and Free Open Source software downloads, and powered by phpWebSite.