Archive

Archive for the ‘Howtos’ Category

Setting up Ubuntu with vsFTP for network install

August 11th, 2009 matt No comments

This is the next post in the series of using Ubuntu to PXEboot other Linux installations.
Click Here to read on how to set up the TFTPboot server on Ubuntu

In our last post, we configured TFTP on the Ubuntu server and successfully tested it using VMware or a second PC. Using a menu-based system, we can select and retrieve the memtest image over network and can test memory with out setup. This is fine and dandy, and with the right hardware, (I use a Compaq Presario desktop) can prove advantageous for testing the random bits of RAM you have without the hassle of finding your UBCD or fiddling with floppy disks.

This article will cover the incorporation of Centos 5 into our TFTP server and covers setting up VSFTPd on the Ubuntu server as well as copying/merging the distribution CDs into a single installation directory. Although some information here is CentOS specific (like where the network boot floppy image is stored on the CD iso for instance) these steps can be used for any distribution of Linux that supports an install from network option. Just about everything from RedHat 6.2 all the way up to the RHEL series, Ubuntu and Ubuntu Server, Mandrake/Mandriva and the rest have a prebuilt network boot disk image to use. This is required unless you fancy building your own network boot images and initrds. (which I do not. :P )

Prerequisites:

  • Ubuntu computer with TFTP server installed and working
  • SCP/SSH access to the Ubuntu computer
  • A copy of WinSCP is highly recommended
  • Centos 5 CD images, already downloaded from a mirror listed from CentOS.org
  • An FTP client helps to diagnose connection issues but is not required.
  • We’re going to start off by copying the ISO images to the Ubuntu server first so we can perform some checks on the images to make sure they were downloaded properly. Use WinSCP to establish a connection to your Ubuntu server and create your temporary directory. Hit “F5″ to create a directory and call it something descriptive so you know what’s in there. I called mine “Centos5″.

    Copy all the files into the new directory. This is going to take a while (even on gigabit) so while we are copying the files, we can set up the FTP server. Before we get into the commands, let’s discuss the difference between HTTP and FTP for these installations.

    HTTP:Most installers support installation via HTTP. This is accessed by a URL, even when on a local network like: http://192.168.0.2/install/CentOS5/initrd.img

    FTP:Some installers support FTP installation as well which means that you don’t necessarily have to have Apache running in order to perform the installation.

    There really is no difference which distribution method you use. I have used Apache and FTP many times with great success for performing LAN installs. I do want to warn you that using Apache on a machine to distribute your installation images is not recommended as this might end up killing the server should a bunch of people discover your repository and start performing installs. If you do decide to use Apache, look for information on how to set up your own virtual host so you don’t spread your repository across the world and make sure that only people on your local network can access that directory.

    I’m using FTP because I have Apache configured for serving pages to the Internet and don’t want to saturate my internet connection with people performing distribution installs and my FTP server is blocked by my router/firewall so I know that no one on the outside can access it.

    So enough of talking, let’s get to doing stuff!

    Setting up VSFTPd

    Be sure that your user account has SUDO access before you begin. If you don’t like SUDOing all the time, you can “sudo bash” to stay as root user until you are done. You will need to be the root user to set up VSFTP and perform the necessary configuration. Go ahead and install VSFTpd:
    sudo apt-get install vsftpd

    This instructs apt-get (the package manager) to install vsftpd on the server and start it. You should now be able to connect to the Ubuntu server:

    C:\Documents and Settings\Administrator>ftp 192.168.0.2
    Connected to 192.168.0.2.
    220 (vsFTPd 2.0.6)
    User (192.168.0.2:(none)): anonymous
    331 Please specify the password.
    Password:
    230 Login successful.
    ftp> dir
    200 PORT command successful. Consider using PASV.
    150 Here comes the directory listing.
    226 Directory send OK.
    ftp> ls -la
    200 PORT command successful. Consider using PASV.
    150 Here comes the directory listing.
    drwxr-xr-x 2 0 65534 4096 Aug 11 16:53 .
    drwxr-xr-x 2 0 65534 4096 Aug 11 16:53 ..
    226 Directory send OK.
    ftp: 119 bytes received in 0.00Seconds 119000.00Kbytes/sec.
    ftp> quit
    221 Goodbye.

    The snip above shows that the FTP server is up and running, accepts anonymous connections (ideal) and is ready. By default, the VSFTPd server starts up accepting only anonymous connections requiring no password and with read only access. It is not needed to create a user for vsftpd unless you want to as the default install is pretty secure as is. Anonymous users don’t need write access and they need to be able to read from the installation media.

    Now, unlike previous FTP servers, there is no /var/lib/ftp or /var/ftp directories. Instead, VSFTP has its own directory in /home/ftp/. Unlike adding a new user to the system, there are no “dotfiles” (files with a leading . in the filename like .bash_history) like there are for normal users. This is because vsFTP uses this as the root of the FTP server and there are no need for these configuration files in the home directory.

    I would recommend keeping your distributions organized in some semblance of order. For this server, I am going to use the following structure as I plan to add more installation disks to this server later on:

    / - the root of the FTP server (from the client's perspective) This is /home/ftp on the server.
    /bootdisks - This will be for some network boot floppy images just in case I have a NIC that doesn't support TFTP
    /dist - This is the main distribution directory
    /dist/iso - This is where I'll keep the ISO images once I'm done with copying them
    /dist/installer - This is where each distribution will have its own directory for their install files..
    /dist/installer/Centos5 - This is where CentOS's installation files go

    This is recommended to keep your FTP server clean. If you use your FTP server for many different things, you will know at-a-glance what a directory is for and what it contains. It’s just good housekeeping to keep your server tidy. If you want to use this structure, then you can use the following code to get the directories set up.


    cd /home/ftp && mkdir bootdisks && mkdir dist &&\
    mkdir dist/iso && mkdir dist/installer && mkdir dist/installer/centos5

    MD5SUM check the ISOs

    Hopefully by now, the ISO images have been copied. If available, make sure you copy the MD5sum file along with them to your temporary directory on the server.

    CD into the directory and we can use MD5 to check these files using the syntax below:

    root@littleblackbox:~/Centos5# md5sum -c md5sum.txt

    This command ‘md5sum’ generates an MD5 hash which should be identical to what is in md5sum.txt. The MD5 hash is like a special checksum validation that you can use to validate that downloaded files match their sources on the server you downloaded them from. Using the above command, I get the below results indicating a valid match. If one of the files had been changed by even so much as a comma in a configuration file on the ISO, the test would have failed.

    root@littleblackbox:~/Centos5# md5sum -c md5sum.txt
    CentOS-5.3-i386-bin-1of6.iso: OK
    CentOS-5.3-i386-bin-2of6.iso: OK
    CentOS-5.3-i386-bin-3of6.iso: OK
    CentOS-5.3-i386-bin-4of6.iso: OK
    CentOS-5.3-i386-bin-5of6.iso: OK
    CentOS-5.3-i386-bin-6of6.iso: OK
    root@littleblackbox:~/Centos5#

    If you don’t have the md5sum.txt, you can still use the md5sum application. Use the command below to generate the MD5 checksums of the ISO images:

    root@littleblackbox:~/Centos5# md5sum *.iso

    This command will output the MD5 checksum and the filename for each of the files. You then compare this to what is listed on the server where you got them and compare the numbers. If they do not match, you know you got a corrupted download. Here is the MD5sums of the ISO images I have:

    dd93a6da1b900548825159206099603c CentOS-5.3-i386-bin-1of6.iso
    5441ae0a3c9efd47cd8bfab873fe20c1 CentOS-5.3-i386-bin-2of6.iso
    024ca72da4e14f79522a90bf8f4fdf9f CentOS-5.3-i386-bin-3of6.iso
    95e5e446754e76b3fa07aaf4946c0aa9 CentOS-5.3-i386-bin-4of6.iso
    0cda242797ded4b6b2ea0469984aca82 CentOS-5.3-i386-bin-5of6.iso
    889ff6389108a85780a06cd38b7375e7 CentOS-5.3-i386-bin-6of6.iso

    Mount, copy, Lather, Rinse, Repeat

    We have our FTP server and we have our validated ISO images. Now it’s time to get messy. The next part comes in mounting these CD iso images, then copying their contents to the FTP directory we made earlier. This can be tedious and can be done incorrectly, rendering a good amount of time wasted if you aren’t careful.

    We’ll start off by creating a temporary directory within the temporary directory called “source” and another one called “destination” and then mount the first ISO image into the source directory by use of the loopback option. Once mounted, we’re going to copy everything from source and put it in destination, then unmount the ISO image and repeat for the other 5 images. You can see the commands I used below:

    root@littleblackbox:~/Centos5# mkdir source
    root@littleblackbox:~/Centos5# mkdir destination
    root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-1of6.iso /source
    root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
    root@littleblackbox:~/Centos5# umount ./source
    root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-2of6.iso ./source
    root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
    root@littleblackbox:~/Centos5# umount ./source
    root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-3of6.iso ./source
    root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
    root@littleblackbox:~/Centos5# umount ./source
    root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-3of6.iso ./source
    root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
    root@littleblackbox:~/Centos5# umount ./source
    root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-4of6.iso ./source
    root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
    root@littleblackbox:~/Centos5# umount ./source
    root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-5of6.iso ./source
    root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
    root@littleblackbox:~/Centos5# umount ./source
    root@littleblackbox:~/Centos5# mount -o loop CentOS-5.3-i386-bin-6of6.iso ./source
    root@littleblackbox:~/Centos5# cp -R ./source/* ./destination
    root@littleblackbox:~/Centos5# umount ./source

    What we’ve done now, is created a directory called “destination” and copied every CD to that directory, overlapping them. What this does is it puts all the CentOS install packages into one directory and adds the necessary additional files to the root of the directory where the installer can find them. Now that we’ve done this, we can move the ISO files to the FTP server’s ISO directory and the “destination” files to the centos5 directory. It is important to keep your files organized to prevent confusion so I also moved the md5sum.txt and renamed it to CentOS5-i386-MD5SUM.txt. I also went ahead and assigned the group permissions to our new files as well.

    root@littleblackbox:~/Centos5# mv *.iso /home/ftp/dist/iso
    root@littleblackbox:~/Centos5# mv md5sum.txt /home/ftp/dist/iso
    root@littleblackbox:~/Centos5# mv /home/ftp/dist/iso/md5sum.txt /home/ftp/dist/iso/CentOS-5.3-i386-MD5.txt
    root@littleblackbox:~/Centos5# mv destination/* /home/ftp/dist/installer/centos5/
    root@littleblackbox:~/Centos5# cd /home/ftp
    root@littleblackbox:/home/ftp# chgrp -R nogroup *

    Ok, so that’s the hard part. Now we have our installation files in place, our ISOs are in place (in case we need them again) and we’re ready to get those bootdisk images. Let’s take a look and see what we’re up against:

    root@littleblackbox:/home/ftp# ls dist/installer/centos5/images
    boot.iso diskboot.img minstg2.img pxeboot README stage2.img TRANS.TBL xen

    Something interesting is that pxeboot directory. Rather than having to mount a network-boot floppy and copy the files in it like demonstrated in the first Howto, they have already created the necessary images for us. This is going to speed things up a lot.

    root@littleblackbox:/home/ftp/dist/installer/centos5/images# cd pxeboot/
    root@littleblackbox:/home/ftp/dist/installer/centos5/images/pxeboot# ls
    initrd.img README TRANS.TBL vmlinuz

    Let’s copy the files over to the /tftpboot/images directory and finish up configuring the images for booting.

    More copying, Configuring the PXE Menu for tftpboot

    Remember what I said about wanting to keep things organized? Here’s where it comes into play. The initrd.img and vmlinuz files are generic filenames. They are VERY specific however and don’t play well with others. I can’t use this initrd with the vmlinuz of the Redhat 7.3 install disk we configured in the last howto as they are very different kernels and very different operating systems. This is why I mention that keeping your server clean with descriptive filenames for your images is important!

    We’ll start off by copying the files into /tftpboot/images (where we put the disk images) and rename them into something more relevant:

    root@littleblackbox:/home/ftp/dist/installer/centos5/images/pxeboot# cp * /tftpboot/images
    root@littleblackbox:/home/ftp/dist/installer/centos5/images/pxeboot# cd /tftpboot/images
    root@littleblackbox:/tftpboot/images# mv vmlinuz vmlinuz-Centos5-netboot
    root@littleblackbox:/tftpboot/images# mv initrd.img initrd-Centos5-netboot
    root@littleblackbox:/tftpboot/images# rm README -f
    root@littleblackbox:/tftpboot/images# rm TRANS.TBL -f
    root@littleblackbox:/tftpboot/images# ls
    initrd-Centos5-netboot initrd-rh73-netboot memdisk memtest vmlinuz-Centos5-netboot vmlinuz-rh73-netboot

    Now we have descriptive filenames along with the proper files in place. All that remains is to edit the menu file and we’ll be ready to test. Open up /tftpboot/menus/main.mnu and add the following text:

    label Install Centos 5
    kernel /images/vmlinuz-Centos5-netboot
    append initrd=/images/initrd-Centos5-netboot

    This code adds the “Install Centos 5″ option to our Main Menu and tells the Menu system which kernel to boot and which initial ramdisk to append to the kernel so that the installer can run. That’s all there is to needing to configure the menu system.

    Testing!

    Ok, so now we have the files in place in /home/ftp, we have the images in /tftpboot/images and we have the menu configured for our new install option. Fire up your VMware workstation or test computer and try it out.

    If you have performed all the steps necessary, after a moment of text on the screen, you should be looking at the installer for CentOS 5. Go through the normal language and keyboard options and when you get to the “Installation Method” screen, be sure you select FTP.

    When prompted, use your FTP server’s IP or hostname as the FTP “site name” then use the directory path we created “/dist/installer/centos5/” and see what happens. Since we are using vsftp’s default anonymous only mode, there’s no need to do anything further with the prompt. Hit OK and see if you get any errors.

    If all was done well, you should get a “Retrieving images” screen. If that’s the case, then congratulations! You have completed your addition of CentOS5 to your tftp server and can now do a CD-less installation of CentOS across the network. Kick back, finish the installer if you want (or power off the test machine/VMware window if you don’t want to).

    Troubleshooting

    Yeah, because even I make mistakes, here are some troubleshooting items you can use if yours just doesn’t work.

  • Timeout while contacting TFTP server
  • This means that the test computer couldn’t reach your TFTP server or the TFTP server doesn’t have the process running. You can check it by using “ps auwx | grep in.tftpd” and seeing if it is running. (The ps command may show your command “grep in.tftpd”. This doesn’t count. :P

  • Menu item shows up but says file not found
  • This means that the main.mnu has the incorrect path to the kernel image file. Check the main.mnu file and make sure that all paths start off with /images/ since this is where we put the images in our installation steps.

  • Kernel panic = no init found?
  • This means that when the network install kernel was mounted and executed, but something happened to the initial ramdisk (the initrd). Check your path in the “append” line of main.mnu and make sure it points to the correct file in /images/

  • The CentOS installer says it can’t find the installation media
  • This means that the directory you provided to the FTP site were incorrect. You may need to check with a regular FTP client. In our guide, I used “/dist/installer/centos5″ as the root path to the installation CD images. If you used something different, use that path instead.

    Afterword

    I had a lot of fun writing this HOWTO and the one before it so I hope you have fun reading it and doing the steps involved and hope that yours is up and working too. Please feel free to leave some comments regarding your experience in setting up TFTP or suggestions that you have in regards to these articles. I always appreciate people’s comments. :)

    Categories: Howtos Tags: , , ,

    Ubuntu TFTPBoot with no hairloss (8.10 Hardy Heron)

    August 5th, 2009 matt No comments

    I found out something today that made me want to rip my hair out. The installation and configuration of Ubuntu for TFTP booting was insane and with no authoritative means to do it, spent way longer on trying to get the service working than should have been necessary

    I was looking to get tftpd installed and working so I can start netbooting install images to the network for devices without a CDROM drive but could boot from the network. A long time ago, I had a Red Hat 8.0 box running the DHCP server and it was quite trivial to install, configure and add images to the box for network installation.

    Well, time has certainly passed since then and the RedHat box succumbed to a faulty power supply. Now I have an Ubuntu box on the network handing out IP addresses. Now, mind you, there are thousands of these howtos on the Internet and a good bit of them will reference inetd.conf or the INET superserver, or xinetd or somewhat. If you are going to be doing this and you don’t want to install unnecessary services, here’s what I did and works just fine.

    Prerequisites

    You will need the following:

  • A copy of Ubuntu Hardy Heron running on a computer with a NIC
  • A copy of the Ultimate Boot CD (for pretty menus) available here: http://www.ultimatebootcd.com/
  • A copy of pxelinux.0 from here:Syslinux Wiki
  • (Optional) A copy of VMWare Server setup with a VM with network boot as primary boot device OR a second computer to test your booting
  • Installing and configuring tftpd-hpa

    Install the tftpd-hpa service:
    # apt-get install tftpd-hpa

    Edit the /etc/default/tftpd-hpa:
    #Defaults for tftpd-hpa
    RUN_DAEMON="yes"
    OPTIONS="-l -s /tftpboot"


    The -l parameter tells tftpd-hpa to run in “Listen” mode to accept connections and -s sets the root of the TFTP server. I don’t like using the /var/lib/tftpboot directory (old skool RedHat, I guess) so I specified a new directory. Be sure to set “RUN_DAEMON” to “yes” otherwise it will never start. Don’t start the service just yet.

    You will need to edit the DHCP server’s subnet declaration. Add these lines, replace {tftp server} with the IP address, not the host name of the server:

    next-server {tftp server};
    filename "/tftpboot/pxelinux.0";

    This tells the DHCP server that if the client supports network booting to give the client the IP of the TFTP server along with the path to the pxelinux.0 file. Make sure you restart the dhcp server otherwise you will not get the tftp server to work.

    Get the /tftpboot directory set up

    We have the service set up, now it’s time to set up the /tftpboot directory. We’ll start off by creating some directories:
    # mkdir /tftpboot
    # mkdir /tftpboot/menus
    # mkdir /tftpboot/images
    # mkdir /tftpboot/pxelinux.cfg

    The menus directory is where we will keep our menu structure and the images directory will contain the boot disk images of the items we present in the menus.
    Copy the files from the UBCD mount point into the /tftpboot directory:

  • copy the menu.c32 and chain.c32 from the UBCD to /tftpboot drectory
  • copy the defaults.cfg from the UBCD’s menus directory to /tftpboot/menus
  • copy the memtest image from the UBCD into /tftpboot/images
  • copy the pxelinux.0 from the SYSLINUX download into the /tftpboot directory
  • Edit the /tftpboot/pxelinux.cfg/default file:
    default main
    prompt 1
    timeout 600
    label main
    kernel menu.c32
    append menus/main.mnu

    This is the default configuration file that pxelinux looks for when it is loaded on the netbooting computer. It is mandatory that it go in pxelinux.cfg/ as just leaving it in the /tftpboot directory will result in a failure.

    Let’s make a menu

    Now that we have the configuration files in place, let’s write a menu.
    Edit the file main.mnu, save it as /tftpboot/menus/main.mnu:

    MENU INCLUDE /menus/defaults.cfg
    LABEL memtest
    MENU LABEL Memtest86 V3.3
    KERNEL /images/memtest
    APPEND -

    Here’s what the lines do:

  • The MENU INCLUDE includes the defaults.cfg file. This controls how our menus look, color, etc…
  • The LABEL defines the name of the image which is not shown. You will want to have a unique entry for all items in the menus
  • MENU LABEL is the item that is displayed for us to choose from.
  • KERNEL should point to the image to boot from (in this case, it’s memtest)
  • the APPEND statement is not used for this particular image, but is required for others that need additional options on the boot line.
  • Save the file and let’s test it out.

    Let’s test it out

    Now that we have everything set, let’s try it. Boot the test machine and it should give you a lot of fast scrolling text before it goes to the boot menu. Unfortunately, I can’t provide a screenshot, but it will display some configuration text then you’ll be dropped to a “boot:” prompt. If all goes well, you should see a blue menu with the Memtest 86 v3.3 displayed. Hit ENTER and see if it loads. If all goes well, Memtest should be running. If not, take a look at the “Troubleshooting” section.

    More Menus, Boot from hard drives and adding images

    So we have our first netbooting image, you can use the menus to generate additional sub-menus or distribution lists. You can use the menus on the UBCD as an example, but if you’re impatient, here’s some code snippets:

    Menus within menus

    To make a menu show up as an entry in another menu (like the “Mainboard Tools” submenu on the UBCD) use this code:

    LABEL mainboard
    MENU LABEL Mainboard Tools
    KERNEL menu.c32
    APPEND /menus/mboard.mnu

  • LABEL must be unique across all menus
  • MENU LABEL is the entry presented in the parent menu
  • KERNEL must remain menu.c32 (this is what renders the menus)
  • APPEND points to the menu file to load. In this case “mboard.mnu”

    Boot local Hard Drives

    If you want to boot the local hard drive (useful if you accidentally forget to tell the BIOS not to boot from network), add this entry:
    LABEL boothdd0
    MENU LABEL *Boot First Hard Disk
    KERNEL chain.c32
    APPEND hd0

  • Adjust hd0 to which hard drive you want. hd0 translates to primary master, HD3 would be secondary slave, etc…

    Add a Linux Bootdisk to the mix

    Adding a Linux Bootdisk is a lot easier than it sounds, and although I will not cover setting up the FTP server for it in this HOWTO, you’ll still want to boot the disk from the network. (Yes, I’ll write a follow up to this one that includes the FTP portion).

    For now, let’s assume you have the network boot floppy image that you want to add to the menu system. In this section, I’m going to use the RedHat 7.3 net boot floppy image, but any floppy image should work.
    First off, mount the floppy image:
    #mount -o loop bootnet.img /mnt/floppy
    Replace bootnet.img with the filename of the image to mount, and /mnt/floppy with a valid mountpoint.
    change directory to that mountpoint and look for a file called “syslinux.cfg”.
    You should see a listing that looks like this:
    default linux
    prompt 1
    timeout 600
    display boot.msg
    F1 boot.msg
    F2 general.msg
    F3 param.msg
    F4 rescue.msg
    F7 snake.msg
    label linux
    kernel vmlinuz
    append initrd=initrd.img lang= devfs=nomount ramdisk_size=8192 vga=788
    label text
    kernel vmlinuz
    append initrd=initrd.img lang= text devfs=nomount ramdisk_size=8192
    label expert
    kernel vmlinuz
    append expert initrd=initrd.img lang= devfs=nomount ramdisk_size=8192
    label ks
    kernel vmlinuz
    append ks initrd=initrd.img lang= devfs=nomount ramdisk_size=8192
    label nofb
    kernel vmlinuz
    append initrd=initrd.img lang= devfs=nomount nofb ramdisk_size=8192
    label lowres
    kernel vmlinuz
    append initrd=initrd.img lang= lowres devfs=nomount ramdisk_size=8192

    The syslinux.cfg contains the menu for the bootdisk, (much like our main.mnu file from earlier) and will give us what we need to copy in order to add the proper entries in our boot configuration and get the menu working. This file has the same basic syntax that our menu files do and they also tell us what we need to copy. In the example above, we need to copy vmlinuz and initrd.img as both files are referenced in the configuration:
    # cp vmlinuz /tftpboot/images/vmlinuz-rh73-netboot
    # cp initrd.img /tftpboot/images/initrd-rh73-netboot

    I highly recommend that you use this method of copying files. This will help you keep your images directory organized. Nothing sucks worse than deleting an “unused” file only to find that was the ramdisk image needed for another distribution’s installer!

    To add the image to the menu, we need to edit the /tftpboot/menus/main.mnu file again and add the following (that we got from the syslinux.cfg)
    label linux7.3
    menu label Install Redhat 7.3
    kernel /images/vmlinuz-rh73-netboot
    append initrd=/images/initrd-rh73-netboot lang= devfs=nomount ramdisk_size=8192 vga=788

    This is copied from the floppy image’s syslinux.cfg file and edited to reflect the paths to the images we copied to /tftpboot/images earlier. The only exception is the adding of the menu label line and the change of the label line for uniqueness.

    To test it out, just reboot the test computer, select “Install Redhat 7.3″ and you should be looking at the installer after a few minutes.

    Troubleshooting

    My TFTP server isn’t responding!

    Most commonly, this is due to something not right in /etc/default/tftpd-hpa, but you can check it by running this command:
    # /etc/init.d/tftpd-hpa start && ps auwx | grep tftp
    which should return something like the following code. If it doesn’t, check your tftpd-hpa file in /etc/default:
    root@littleblackbox:/tftpboot# /etc/init.d/tftpd-hpa start && ps auwx | grep tftp
    Starting HPA's tftpd: in.tftpd.
    root 11280 0.0 0.0 2220 276 ? Ss 21:26 0:00 /usr/sbin/in.tftpd -l -s /tftpboot
    root 11282 0.0 0.0 3004 768 pts/1 S+ 21:26 0:00 grep tftp
    The second line shows us that tftpd is running, and that the path is set to /tftpboot. This is the correct setup for our tftpboot installation and should work.

    TFTP says File Not Found!

    This is more than likely an issue with Ubuntu. It’s really fond of having multiple configurations in obscure places for the same file. You can check it to see what path is configured for it by running the following command:
    root@littleblackbox:/tftpboot# ps auwx | grep tftp
    root 11280 0.0 0.0 2220 276 ? Ss 21:26 0:00 /usr/sbin/in.tftpd -l -s /tftpboot
    root 11405 0.0 0.0 3004 760 pts/1 R+ 21:33 0:00 grep tftp

    The -s parameter is important, it’s how you set the root directory for the server. If you show something than other than tftpboot, check your /etc/default/tftpd-hpa file and make sure that the correct option is set.

    Menu item doesn’t show up correctly

    Go into the .mnu file and check that each “LABEL” entry has a MENU LABEL entry to go with it. Otherwise, it will fall back to the LABEL text.

    My image for {favorite tool} doesn’t work!

    If you are trying to install an image off of the UBCD and it uses dosubcd.gz, it likely will not work. dosubcd is a freeDOS implementation and once loaded will then load the files off of the CDROM. These images will not work as there’s no CDROM drive to load from (otherwise, what’s the point of using TFTPd?)

    If you’re installing something else not on the UBCD, you can try using the “generic” menu entry however, depending on how the image was created this may or may not work:

    label GenericMenu
    menu label Generic Menu Item
    kernel Kernelnamegoeshere
    append -

    Replace Kernelnamegoeshere with the kernel of the tool you wish to use. If this still doesn’t work, read the tool’s documentation and see if there is a way to get it to work by burning it onto a CD. If so, then the image will not work. The TFTP server can not distribute ISO images as bootable image files to work.

    Afterword and Credits

    I hope that you find this information useful. If you do a lot of work with linux installations, then by using this HOWTO and setting up an FTP server, you can minimize the CD-swapping hell that is most installations. You can also avoid having to find a DVD burner and a DVDROM that will read it. In my installation, I have set up Redhat 7.3, Ubuntu 8.04 and a couple of other proprietary firmwares by having the TFTP server available and at the ready.

    I would like to thank the guys that made the UBCD, as it is with their code on the Ultimate Boot CD that I was even able to find that a menu based image selection system was possible. They wrote the menu.c32 and the other files referenced as coming from the UBCD with the exception of Memtest86 which came from http://www.memtest86.com/

    All other names, trademarks and other such legal nonsense belong to whoever originally created them or whatever. All I did was write this process from information found by inspecting the configuration files downloaded from freely available sites on the Internet. Don’t sue me for copyright infringement because I am broke as hell.

    If you have any questions, feel free to post them here and as always, thank you for reading.

  • Categories: Howtos Tags: , , ,