Tuesday, August 23, 2011

Installing Tinycore linux in virtualbox for GNS3 IPv6

The 0.8.1 GNS3 release now easily supports virtualbox hosts, and Tinycore linux is a nice easy way to add hosts to your topologies without consuming hefty amounts of memory and CPU.  First, download it from the tinycore linux downloads site  Then create a vm in virtualbox with at least 64 meg of memory, and a gig or  two of drive space (I created it as linux other, since there wasn't a tiny core linux type).  Set that vm to boot from the iso downloaded from tinycore linux earlier.  Then boot it.  It should come up quickly.  The follow steps will install a bootable tinycore on the VM's drive:

  • Go to the app browser (click anywhere on the desktop and select it from the 'system tools' menu) click the "Connect" button to get a list and search for cfdisk.  Click the "go" button to download and install it.
  • Then search the app browser for grub, and download/install grub-0.97-splash.tcz
  •  Then open a terminal (click anywhere on the desktop and select it from the 'system tools' menu)
  • enter "sudo su" to get to root.  The prompt should be "root@box"
  • type "cfdisk /dev/hda" to make a new partition.  Select 'new', and 'bootable', then 'write'.  After that, quit
  • type "mkfs.ext3 /dev/hda1" to put a filesystem on the new partition
  • type "reuildfstab" so its available to mount.
  • type "mount /dev/hda1" to mount it.

The bootable parts are either in /dev/hdb or /dev/hdc.  Try mounting either with "mount /dev/hdb" or "mount /dev/hdc".  Then look in /mnt/hdb and/or /mnt/hdc for a boot directory that has a file named "bzImage"  We'll assume its in /dev/hdb for now.  Continuing on:

  • Type “mkdir -p /mnt/hda1/boot”, then type “mkdir -p /mnt/hda1/boot/grub”
  •  Type “mkdir –p /mnt/hda1/tce”
  •  Type “touch /mnt/hda1/tce/mydata.tgz”
  • Type “cp -p /usr/lib/grub/i386-pc/* /mnt/hda1/boot/grub/”
  •  Type “vi /mnt/hda1/boot/grub/menu.lst”, type “i” to enter Interactive mode, then type:
default 0
timeout 5
title tinycore
kernel /boot/bzImage quiet
initrd /boot/tinycore.gz
  • Press <Esc> then type “:x” to save and exit vi
  • Type “grub”  once at the grub> prompt, type:
root (hd0,0)
setup (hd0)
quit
  • Type "cp /mnt/hdb/boot/bzImage  /mnt/hda1/boot/"
  • Type "cp /mnt/hdb/boot/tinycore.gz /mnt/hda1/boot/"
  • Type “umount /mnt/hda”
  • shutdown, and remove the tinycore iso from the VM's storage devices.
  • Start the VM.

If you want IPv6, go to the app browser, and search for IPv6.  Download/install ipv6-2.6.33.3-l1-rt19 and ipv6-2.6.33.3-tinycore.  Reboot, open a terminal and enter the command "ifconfig", if you see an IPv6 address, you're now able to communicate via IPv6.  Try ping6 to hit an IPv6 address you know will respond.  There are tons of other goodies like firefox (did I say 64M of RAM above? Oops), dillo, traceroute, openssh, tftp, nmap, ethtool, tcpdump, web servers like lighthttp, - the list goes on and on.  One thing I haven't done is figure out the virtualbox guest extensions for tinycore, and so mouse focus is a bit dodgy, although far from unworkable.

No comments:

Post a Comment