Diff for "Installation/LocalNet"


Differences between revisions 30 and 31
Revision 30 as of 2007-06-06 20:08:35
Size: 8625
Editor: ipn36372-c52610
Comment:
Revision 31 as of 2007-06-06 20:16:01
Size: 8850
Editor: ipn36372-c52610
Comment:
Deletions are marked like this. Additions are marked like this.
Line 19: Line 19:
root@sahara:/var/lib/tftpboot/ubuntu/edgy$ mount -o loop edgy-alternate-i386.iso alternate/ root@sahara:/var/lib/tftpboot/ubuntu/feisty$ mount -o loop feisty-alternate-i386.iso alternate/
Line 39: Line 39:
filename="ubuntu/edgy/alternate/install/netboot/pxelinux.0"; filename="ubuntu/feisty/alternate/install/netboot/pxelinux.0";
Line 50: Line 50:
At this point in time my goal has shifted from a typical install like if you just booted from CD to a Hands Off Install where all the questions have been answered and fed to the installer as preseed. I may get back to the interactive setup, but for now I am focused on using preseed.cfg.
The above is for an interactive install, just as if you booted from CD. The following addresses preseeding, which enables a Hands Off Install where all the questions have been answered and fed to the installer. In addition, the following does not pull anything from the Internet.
Line 53: Line 52:

My configs to make a Hands Off Install that does not pull anything from the internet.
Line 88: Line 84:
# The 'kernel' and 'initrd' paths must identify files under tftpboot.
# For example, on my system I have /var/lib/tftpboot/ubuntu-feisty/linux and /var/lib/tftpboot/ubuntu-feisty/initrd.gz.
Line 89: Line 87:
        append initrd=ubuntu-feisty/initrd.gz ramdisk_size=14984 root=/dev/rd/0 rw preseed/locale=en_US kbd-chooser/method=us netcfg/wireless_wep= netcfg/choose_interface=eth1 netcfg/get_hostname= preseed/url=http://192.168.1.7/preseed-feisty.cfg vga=6 --         append initrd=ubuntu-feisty/initrd.gz ramdisk_size=14984 root=/dev/rd/0 rw preseed/locale=en_US kbd-chooser/method=us netcfg/wireless_wep= netcfg/choose_interface=eth0 netcfg/get_hostname= preseed/url=http://192.168.1.7/preseed-feisty.cfg vga=6 --
Line 93: Line 91:
netcfg/choose_interface=eth1 - for laptops, I want it to setup the wifi card, not the wired port. Problem I am having is that some use eth1 and some wlan0. What would be great is if the DHCP server could somehow pass this too.

note: The DHCP server c
an't pass it, but pretending that the MAC address of your wireless card is 12 : CD : 56 : AB : 78 : EF you can specify a custom pxelinux.cfg/01-12-dc-56-ab-78-ef (lowercase) instead. If you are using static dhcp, you can also use the IP address in hex for a per-machine or per-subnet or per-network configuration. See http://syslinux.zytor.com/pxe.php#config for more information.

Basically, say you have three wireless cards where the IP in hex translated to caf12d5e, caf12d6b, caf124ea, you could specify pxelinux.cfg/caf12d and pxelinux.cfg/caf12. The first two would match to the first config file and the third would match to the second config file.
netcfg/choose_interface=eth0 - You may wish to specify eth1 or wlan0 for laptops if you want it to setup the wifi card, not the wired port.

Note for client-specific
PXE configurations: The DHCP server can't pass it, but pretending that the MAC address of your wireless card is 12 : CD : 56 : AB : 78 : EF you can specify a custom pxelinux.cfg/01-12-dc-56-ab-78-ef (lowercase) instead. If you are using static dhcp, you can also use the IP address in hex for a per-machine or per-subnet or per-network configuration. See http://syslinux.zytor.com/pxe.php#config for more information. Basically, say you have three wireless cards where the IP in hex translated to caf12d5e, caf12d6b, caf124ea, you could specify pxelinux.cfg/caf12d and pxelinux.cfg/caf12. The first two would match to the first config file and the third would match to the second config file.
Line 102: Line 98:
d-i mirror/http/hostname string 192.168.1.22
d-i mirror/http/directory string /ubuntu
d-i mirror/suite string feisty
d-i mirror/http/hostname string sahara # This is whatever HTTP server you have set up
d-i mirror/http/directory string /ubuntu # This is the /ubuntu directory from the install CD copied (or linked) under the webroot of your HTTP server
d-i mirror/suite string feisty # Name your ubuntu version here

Other Languages: ComoNetbootInstall Espanol

[new] good news! It works with Feisty Alternate and Server CDs.

This is a work in progress. It is also a mix of Basic Internet Install and Local Net Install that are similar to just installing from the CD, and Hands Off Install that uses a preseed file to automate the whole thing.

sahara is the server for dhcp, tftp, and http. (Each of these can be run on a separate server if desired.) shaz is the blank box that I am installing on.

  1. Install Trivial File Transfer Protocol server and enable it (default tftp config uses inetd)

    root@sahara:/ # apt-get install tftpd-hpa
    root@sahara:/ # vi /etc/default/tftpd-hpa  
  2. Mount the CD (media or image) under the tftpboot dir

    root@sahara:/var/lib/tftpboot/ubuntu/feisty$ mount -o loop feisty-alternate-i386.iso alternate/
    If you wish, you can instead copy the contents of the CD onto the server permanently instead of leaving the ISO mounted.
  3. Setup Apache

    root@sahara:~ # apt-get install apache2
  4. Make a symlink from apache's doc Root to the CD

    root@sahara:/var/www # ln -s /var/lib/tftpboot/ubuntu/
    Or copy the /ubuntu directory from the CD into here.
  5. Install dhcp server.

    root@sahara:~ # apt-get install dhcp3-server
  6. Set the dhcp server to tell the clients what to boot. I added a default host name, you don't need it but it comes in handy for other things.

    root@sahara:~ # cat /etc/dhcp3/dhcpd.conf
    subnet 192.168.1.0  netmask 255.255.255.0 {
            range 192.168.1.10 192.168.1.254;
             }
    # put your DNS IP's here:
    option domain-name-servers 192.168.1.7, 68.87.66.196 ;
    filename="ubuntu/feisty/alternate/install/netboot/pxelinux.0";
    
    root@sahara:~ # /etc/init.d/dhcp3-server restart
    Stopping DHCP server: dhcpd3.
    Starting DHCP server: dhcpd3.
  7. Boot up the client box, config the bios to net boot and you should get the Ubuntu screen and Boot: prompt. Yippee!

The above steps should give you an interactive setup, very similar to if you had booted from the CD.

--- The above is for an interactive install, just as if you booted from CD. The following addresses preseeding, which enables a Hands Off Install where all the questions have been answered and fed to the installer. In addition, the following does not pull anything from the Internet.


A handfull of preseed options need to be passed via kernel options. The kernel only supports 255 chars, so things are cramped. To accomodate this, I dumped some of the paths and made symlinks. That gave me just enough space for now. Note that the path/name of the kernel gets appended, so even trimming that helped.

{{{root@sahara:/var/lib/tftpboot # ln -s ubuntu-installer/i386/initrd.gz root@sahara:/var/lib/tftpboot # ln -s ubuntu-installer/i386/linux}}}

/var/lib/tftpboot/pxelinux.cfg/default

# pxelinux.cfg/default

# display u0buntu-installer/i386/boot-screens/syslinux.txt

default menu
prompt 1
timeout 150
ontimeout boothd

label menu
# makes a menu out of this file, allows editing the options on the client
        kernel menu.c32

label boothd
        # boot from the first HD
        # (this is what happens if nothing is pressed for 15 seconds)
        localboot 0

label ubuntu-feisty-normal
# ubuntu instaler
        kernel ubuntu-feisty/linux
        append vga=normal initrd=ubuntu-feisty/initrd.gz ramdisk_size=14984 root=/dev/rd/0 rw  --

label ubuntu-feisty-hands-off
# ubuntu instaler
# The 'kernel' and 'initrd' paths must identify files under tftpboot.
# For example, on my system I have /var/lib/tftpboot/ubuntu-feisty/linux and /var/lib/tftpboot/ubuntu-feisty/initrd.gz.
        kernel ubuntu-feisty/linux
        append initrd=ubuntu-feisty/initrd.gz ramdisk_size=14984 root=/dev/rd/0 rw preseed/locale=en_US kbd-chooser/method=us netcfg/wireless_wep= netcfg/choose_interface=eth0 netcfg/get_hostname= preseed/url=http://192.168.1.7/preseed-feisty.cfg vga=6 --

netcfg/get_hostname= Is blank so that it will pick up the host-name supplied by the DHCP server.

netcfg/choose_interface=eth0 - You may wish to specify eth1 or wlan0 for laptops if you want it to setup the wifi card, not the wired port.

Note for client-specific PXE configurations: The DHCP server can't pass it, but pretending that the MAC address of your wireless card is 12 : CD : 56 : AB : 78 : EF you can specify a custom pxelinux.cfg/01-12-dc-56-ab-78-ef (lowercase) instead. If you are using static dhcp, you can also use the IP address in hex for a per-machine or per-subnet or per-network configuration. See http://syslinux.zytor.com/pxe.php#config for more information. Basically, say you have three wireless cards where the IP in hex translated to caf12d5e, caf12d6b, caf124ea, you could specify pxelinux.cfg/caf12d and pxelinux.cfg/caf12. The first two would match to the first config file and the third would match to the second config file.

Originally found at http://archive.ubuntu.com/ubuntu/dists/feisty/main/installer-i386/current/doc/manual/en/apcs01.html and saved to /var/www/preseed.cfg, here are the important changes:

d-i     mirror/country          string enter information manually
d-i     mirror/http/hostname    string sahara # This is whatever HTTP server you have set up
d-i     mirror/http/directory   string /ubuntu # This is the /ubuntu directory from the install CD copied (or linked) under the webroot of your HTTP server
d-i     mirror/suite            string feisty # Name your ubuntu version here
d-i     mirror/http/proxy       string 

(See http://www.debian.org/releases/etch/example-preseed.txt for another example.)

Here is my current dhcpd.conf

ping-check = 1;
log-facility local7;

option domain-name "sahara.net";
option time-servers  192.168.1.1;
option broadcast-address 192.168.1.255;

option domain-name-servers 63.240.76.4, 204.127.198.4;
option routers  192.168.1.1;

subnet 192.168.1.0  netmask 255.255.255.0 {
        range 192.168.1.10 192.168.1.254;
         }

# Hoary test boxes
group {
        filename="pxelinux.0" ;

        # You need a next-server option if TFTP and DHCPd aren't on the same system.
        next-server sahara;
        
        # 192.168.1.2 does not exist on my lan.
        # I am setting it like this to make sure the box doesn't find
        # a repo on the net to pull sources from.
        # It would be good I can figure out how to i
        #  limit these setting to the install phase 
        #  (including the 2nd part after the reboot )
        
        option domain-name-servers 192.168.1.2 ;
        option routers 192.168.1.2 ;

        host dwl650p { 
                hardware ethernet 00:05:5d:5a:81:f0 ; 
                option host-name "dwl650p" ; }
        
        # tsp2 6100 - a=wired, b=wifi
        host tsp2a { 
                hardware ethernet 00:00:39:fa:ff:f3 ;
                option host-name "tsp2a" ; }
        
        host tsp2b { 
                hardware ethernet 00:02:2d:b0:c8:6c ;
                option host-name "tsp2b" ; }

        host tsp1 { 
                hardware ethernet 00:00:39:88:31:a6 ; 
                option host-name "tsp1" ; }

        host e400 { 

                hardware ethernet 00:60:08:b0:62:0d ; 
                # fixed-address 192.168.1.181 ;
                option host-name "e400" ; }

       }


If your box doesn't have the option to boot from lan (like one of mine) you can make a boot disk that will do that part.

http://etherboot.sourceforge.net

http://rom-o-matic.net

I am pleased to say that I was able to read, download, build, run, make the floppy in under 30 min.

"Etherboot does not (yet) offer support for PCMCIA cards." so the older laptops will have to wait.


Pile of PXE related links:

http://freshmeat.net/projects/syslinux/

http://syslinux.zytor.com/memdisk.php

http://support.3com.com/infodeli/tools/nic/mba.htm New Universal NDIS Driver for DOS

http://www.qualystem.com/en/dualboot.html

http://unattended.sourceforge.net/step-by-step.php

http://unattended.sourceforge.net/advanced.php#pxe

http://syslinux.zytor.com/archives/2003-June/002185.html

http://www.intel.com/design/network/drivers/int21143.htm

http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/

http://www.winimage.com/winimage.htm

http://www.weird-solutions.com/docs/pxe_booting.pdf

http://www.weird-­solutions.com/bin/util/tftp_root.zip

http://marc.herbert.free.fr/linux/win2linstall.html Install GNU/Linux without any CD, floppy, USB-key, nor any other removable media.

http://osdev.berlios.de/netboot.html - Network-booting Your Operating System - the part I like: "...loads the GRUB, the second-stage loader, off the server." --- PPC Mac related links

http://www.macgeekery.com/hacks/how_to_install_debian_via_network_boot_from_a_mac

http://davespicks.com/writing/programming/mackeys.html#boot

SmartBootManagerHowto

CategoryDocumentation CategoryCleanup

Installation/LocalNet (last edited 2011-10-03 20:08:53 by chello084115174066)