Ok, Debian Squeeze is out for a while and now it`s time to setup a new FAI (Fully Automatic Installation) install server. In this tutorial, I will describe, how to setup FAI with dhcpd3 or dnsmasq for bootp and DHCP.
purpose
This document describes how to set up a FAI install server 3.4.8 on Debian Linux 6.x with dhcpd3 or dnsmasq
list of references
related article
- PXE network boot of grml rescue system
- Tutorial: booting SystemRescueCd with PXE/NFS
- http://thekelleys.org.uk/dnsmasq/doc.html
- http://www.isc.org/software/dhcp
prerequisite
software
The FAI install server is installed with a Debian Squeeze 6.x, and apt-cacher is installed.
Hardware
I will use the following network and hardware informations (MAC address), change these settings for your setup!
- FAI install server, Debian Squeeze 6.x, IP 192.168.2.245, Hostname fai.local
- Client debian-vm-01, MAC address 00:16:3e:1c:64:9b, IP: 192.168.2.240
install FAI
Add the FAI repository to a new configuration file named /etc/apt/sources.list.d/fai.list
deb http://fai-project.org/download squeeze koeln
To verify the packages from fai-project, add the following gpg key
c
|
1 |
gpg -a --recv-keys AB9B66FD; gpg -a --export AB9B66FD | apt-key add - |
Now we install the FAI packages and some helper tools
|
1 |
apt-get install fai-server fai-client fai-doc fai-setup-storage fai-quickstart makepasswd dnsmasq |
Answer all questions during the installation with the default answer.
setup FAI
FAI2>
fai logging user
During the installation, clients will send logfiles to the “fai” user.
|
1 |
useradd -d /home/fai -m -s /bin/bash -c "FAI logging" fai |
/etc/fai/fai.conf
Open /etc/fai/fai.conf in your favourite editor and add/edit the following options.
FAI_CONFIG_SRC=nfs://192.168.2.245/srv/fai/config
LOGUSER=fai
FAI_DEBMIRROR=192.168.2.245:/srv/mirror/debian-squeeze
MNTPOINT=/media/mirror
FAI=/var/lib/fai/config
Use the makepasswd command, to create a new password, and add the encrypted password to the FAI_ROOTPW variable in the /etc/fai/make-fai-nfsroot.conf configuration file. (default password is fai)
|
1 2 |
user@host:/ # makepasswd --crypt-md5
e2TjmLPMW $1$zu3UkGiA$ylbHHsa7WQ1VJm3d4YkQQ/ |
fai-setup
Run the fai-setup command to create the nfs root directory, NFS exports and to add the FAI user to the system.
|
1 2 |
fai-setup -v
cp -a /usr/share/doc/fai-doc/examples/simple/* /srv/fai/config/ |
NFS exports
Add the following NFS exports to /etc/exports and restart the NFS Kernel Daemon:
|
1 2 3 4 5 6 |
cat >> /etc/exports << "EOF"
/srv/fai/config 192.168.2.0/255.255.255.0(async,ro,no_subtree_check)
/srv/fai/nfsroot 192.168.2.0/255.255.255.0(async,ro,no_subtree_check,no_root_squash)
/srv/mirror/debian-squeeze 192.168.2.0/255.255.255.0(async,ro,no_subtree_check)
EOF
/etc/init.d/nfs-kernel-server restart |
FAI / Debian mirror
The fai-mirror script creates a mirror of the needed Debian packages (defined in /srv/fai/config/package_config/)
|
1 2 |
mkdir -p /srv/mirror/debian-squeeze
fai-mirror /srv/mirror/debian-squeeze/ |
NFS root
With the following command we will create the FAI nfsroot:
|
1 |
make-fai-nfsroot -v |
Add to the nfsroot apt sources configuration (/srv/fai/nfsroot/live/filesystem.dir/etc/apt/sources.list) the apt-cacher proxy (including Debian backports repositories) – Check the releated articled for the apt-cacher setup.
deb http://192.168.2.44/apt-cacher/ftp.de.debian.org/debian/ squeeze main non-free contrib
deb http://192.168.2.44/apt-cacher/security.debian.org/ squeeze/updates main non-free contrib
deb http://192.168.2.44/apt-cacher/fai-project.org/download squeeze koeln
Set the boot NFS option in /srv/fai/nfsroot/live/filesystem.dir/etc/initramfs-tools/initramfs.conf to NFS
BOOT=nfs
setup PXE
pxelinux.cfg
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# copy the menu binary
cp /usr/lib/syslinux/menu.c32 /srv/tftp/fai
cat > /srv/tftp/fai/pxelinux.cfg/default << "EOF"
DEFAULT menu.c32 # Prompt user for selection PROMPT 0
menu color tabmsg 37;40 #80ffffff #00000000
menu color hotsel 30;47 #40000000 #20ffffff
menu color sel 30;47 #40000000 #20ffffff
menu color scrollbar 30;47 #40000000 #20ffffff
MENU WIDTH 80
MENU MARGIN 10
MENU PASSWORDMARGIN 3
MENU ROWS 12
MENU TABMSGROW 18
MENU CMDLINEROW 18
MENU ENDROW 24
MENU PASSWORDROW 11
MENU TIMEOUTROW 20
TIMEOUT 100
ALLOWOPTIONS 1
MENU TITLE PXE Boot Menu
LABEL local
menu label ^Boot local harddisk
menu default
localboot 0
LABEL install
menu label Debian Squeeze Install
KERNEL vmlinuz-2.6.32-5-amd64
APPEND ip=dhcp boot=live netboot=nfs nfsroot=192.168.2.245:/srv/fai/nfsroot root=/dev/nfs initrd=initrd.img-2.6.32-5-amd64 FAI_FLAGS="createvt,sshd,verbose" FAI_ACTION=install panic=60
EOF |
tftpd
Setup the tftpd-hpa daemon in /etc/default/tftpd-hpa to serve the kernel and initrd file to the install client.
TFTP_USERNAME=”tftp”
TFTP_DIRECTORY=”/srv/tftp/fai”
TFTP_ADDRESS=”0.0.0.0:69″
TFTP_OPTIONS=”–secure”
DHCP/bootp
Decide, if you want to use dnsmasq, or dhcpd3
dnsmasq
|
1 2 3 4 5 6 7 |
cp /etc/dnsmasq.conf /etc/dnsmasq.conf.backup
cat > /etc/dnsmasq.conf << "EOF"
dhcp-range=192.168.2.235,192.168.2.240,static
dhcp-host=00:16:3e:1c:64:9b,debian-vm-03
dhcp-boot=pxelinux.0
log-queries
log-dhcp |
dhcp
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.backup
cat > /etc/dhcp/dhcpd.conf << "EOF"
log-facility local7;
option dhcp-max-message-size 2048;
use-host-decl-names on;
deny unknown-clients;
allow bootp;
allow booting;
option domain-name "local";
option domain-name-servers 192.168.2.245;
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option broadcast-address 192.168.2.255;
}
group {
filename "pxelinux.0";
next-server 192.168.2.245;
option root-path "192.168.2.245:/srv/fai/nfsroot";
host test1 {
hardware ethernet 00:16:3e:1c:64:9b;
fixed-address 192.168.2.240;
}
}
EOF |
Install the client
Boot the client with PXE boot enabled (enable PXE in the Clients BIOS) and select “Debian Squeeze Install” from the menu.
FAI Installation
[img src=http://www.frederikkonietzny.de/wordpress/wp-content/flagallery/fai-install-2011/thumbs/thumbs_virt-viewer-debian-install03.png]PXE boot menu


Pingback: How to setup a FAI Install server on debian squeeze | Frederik … | Linux Blog