Chapter 17. Running LEAF Bering-uClibc as guest system in VMware Server

Table of Contents

Goal
Assumptions
Prerequisites
Procedure

Goal

Create a bootable floppy image of LEAF Bering uClibC that will work with VMware Server 1.0.2. (This guide has been written based on LEAF Bering-uClibc version 3.0.2). This boot floppy is a bare minimum configuration to establish TCP/IP connectivity and therefore confirm compatibility.

All other modules and tools have been removed for simplicity. This means that there is no firewall, routing, SSH client or server, DHCP, DNS, etc. It will be up to the user to configure or add any additional functionality. Information on configuring or adding additional functionality can be found on the LEAF Bering uClibC web site (http://leaf.sourceforge.net/doc/index.html) on in various news groups (http://www.nabble.com/LEAF---Linux-Embedded-Appliance-Firewall-f4454.html). Follow the instructions for Bering uClibC 3.

Assumptions

This procedure assumes that the user is new to LEAF Bering uClibC and may be unfamiliar with some of its subtlities. For example, the bin “Bering-uClibc_3.0.2_iso_bering-uclibc-iso.bin” file on the download page is actually an ISO file. Renaming the file with a .ISO extention makes it usable as a boot media for VMware Server. Its contents can be extracted using WinImage.

The entire procedure as explained here assumes that the user is operating from Microsoft Windows. In the author’s case Windows XP Professional with Service Pack 2 is used. The version of Microsoft Windows must be compatible with the VMware product being used, in this case Server 1.0.2.

Even though VMware Server 1.0.2 is used in this example there is no known reason why this could not equally well in other VMware products such as Player, Workstation or ESX Server. This solution has not been tested on other VMware products or other virtualization solutions.

VMware products do not recognize floppy images or physical floppy disks larger than 1.44 MB. Therefore the 1.68 MB floppy image available for download is not suitable. The user will be directed to extract the file bootdisk.ima from the ISO file Bering-uClibc_3.0.2_iso_bering-uclibc-iso.bin as this image is already formatted for 1.44 MB. See the procedure section on how to do this.

The author’s test network consists of a DSL router with the LAN interface configured for the subnet 192.168.1.0 and subnet mask of 255.255.255.0 and default gateway of 192.168.1.1. The reader will need to adjust the procedure below to account for any differences where shown.

Setting up or troubleshooting network connectivity of the user’s Windows system out of scope for this document.

Prerequisites

The following prerequisites are recommended:

  • Microsoft Windows - The user may consider downloading a trial version of Windows Server 2003 from http://www.microsoft.com. This has not been tested by the author. The version of Windows must be compatible with VMware Server 1.0.2.

    The Windows system must be properly configured for network connectivity. The default gateway must be pingable.

  • VMware - The VMware Server can be downloaded from http://www.vmware.com.

  • Floppy disk image editor - The author used a trial copy of WinImage which can be downloaded from http://www.winimage.com.

  • Text editor - The text editor has to be suitable for modifying Linux/Unix text files. Microsoft WordPad might work, but was not tested by the author. The author used PSPad for editing text files. It is available for download from http://www.pspad.com.

Procedure

Download Bering-uClibc_3.0.2_iso_bering-uclibc-iso.bin (or a more recent version) from the LEAF Bering uClibc download page.

Download and install the necessary prerequisites.

Open the file Bering-uClibc_3.0.2_iso_bering-uclibc-iso.bin with WinImage.

Extract the bootdisk.ima file and save to your working folder such as ‘E:\my_new_boot_disk’. This is now the start of the new floppy image.

Extract or edit a copy of syslinux.cfg in floppy image to look like the text below and save in work folder. Remember to use a Linux/Unix compatible file editor such as PSPad or WordPad. The last line starts with “default linux …” and may be wrapped as shown below.

display syslinux.dpy
timeout 0
append reboot=bios
default linux initrd=initrd.lrp init=/linuxrc rw root=/dev/ram0 LEAFCFG=/dev/fd0:msdos boot=/dev/fd0:msdos

Extract or edit leaf.cfg in floppy image to look like this and save in the work directory. Remember to use a Linux/Unix compatible file editor such as PSPad or WordPad.

LRP="root config etc local modules"
PKGPATH=/dev/fd0:msdos
syst_size=16M
log_size=4M

Extract the modules, config.lrp, etc.lrp, initrd.lrp, local.lrp, moddb.lrp, modules.lrp and root.lrp from the same bin/ISO file from which the initial floppy image was extracted in step 1 and save in work folder.

Open the working copy of bootdisk.ima using WinImage. Add the extracted modules plus the new syslinux.cfg and leaf.cfg. Overwrite files when prompted. Save and close floppy image file to work folder.

Create a new floppy image using WinImage.

Find the module pcnet32.o on bin/ISO image and add it to this new floppy image. Save and close this floppy to work folder. Do not add this module to the bootdisk.ima floppy image.

Create a new virtual machine in VMware Server 1.0.

Copy the two floppy image files to the new virtual machine folder.

Configure the virtual machine for:

  • CPU = one

  • RAM = 32 MB

  • NICs = 2 or more. The first NIC must be configured as ‘Bridged’ so that it has connectivity to DSL router

  • HDD = none

  • Floppy = boot floppy file bootdisk.ima in the virtual machine folder

  • Add Floppy 2 = second floppy device to use the second floppy image created in step 6.

Power on the virtual machine. If the virtual machine is configured correctly it will boot from the bootdisk.ima in the virtual machine folder.

Log in as root. The tool lrcfg will launch automatically.

In lrcfg menu enter 3 for 'Packages configuration', 3 for 'modules', 1 for 'kernel modules to load at boot' which brings up '/etc/modules/' in the e3 editor.

Remove comments for crc32, mii and pcnet32. Save and exit editor.

Quit back to main lrcfg screen.

Enter 1 for 'Network configuration', enter 1 for 'interfaces file'. The file /etc/network/interfaces is opened in the e3 editor. Make changes to match the following:

auto eth0
iface eth0 inet static
address 192.168.1.3
# or some other IP address not in use and on the same subnet as the DSL router
netmask 255.255.255.0
# must be same as LAN subnet of DSL router
broadcast 192.168.1.255
gateway 192.168.1.1
#or whatever the default gateway is for your DSL router
auto eth1
iface eth1 inet static
#address can be changed to suite user’s requirements for private subnet
address 10.1.1.1
netmask 255.255.255.0
broadcast 10.1.1.255
# repeat for each NIC configured on the virtual machine

Save changes and quit to go back to the main configuration menu.

Enter s to 'Save configuration'. Enter ‘y’ when prompted.

Exit to command prompt.

Mount second floppy disk which contains a copy of pcnet32.o with the command:

mount –t msdos /dev/fd1 /mnt

Copy pcnet32.o from second floppy to '/lib/modules' with the command:

cp /mnt/pcnet.o /lib/modules

Launch lrcfg, enter m for 'Backup modules'. Enter 'y' when prompted.

Reboot the system with the command:

init 6

Once the system reboots log in as root again and exit from the configuration menu. Check the configuration of the network interfaces with the command:

ip addr show

Check connectivity to the DSL router by pinging the default gateway with the command:

ping 192.168.1.1

If that works, you're done - enjoy running LEAF Bering-uClibc in your VMware environment.