System: Debian Wheezy
Packages: syslinux, debootstrap, dnsmasq
create tftpboot directory
# mkdir -p /opt/tftpboot/
copy PXE loader to /opt/tftpboot/
# cp /usr/lib/syslinux/pxelinux.0 /opt/tftpboot/
# cp /usr/lib/syslinux/menu.c32 /opt/tftpboot/
# cp /usr/lib/syslinux/memdisk /opt/tftpboot/
# cp /usr/lib/syslinux/mboot.c32 /opt/tftpboot/
# cp /usr/lib/syslinux/chain.c32 /opt/tftpboot/
prepare netboot kernel & initrd
# mkdir -p /opt/tftpboot/debian32
# wget http://mirrors.kernel.org/debian/dists/wheezy/main/installer-i386/current/images/netboot/debian-installer/i386/linux -O /opt/tftpboot/debian32/vmlinuz
# wget http://mirrors.kernel.org/debian/dists/wheezy/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz -O /opt/tftpboot/debian32/initrd.img
# mkdir -p /opt/tftpboot/debian64
# wget http://mirrors.kernel.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/debian-installer/amd64/linux -O /opt/tftpboot/debian64/vmlinuz
# wget http://mirrors.kernel.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/debian-installer/amd64/initrd.gz -O /opt/tftpboot/debian64/initrd.img
create PXE config
# mkdir -p /opt/tftpboot/pxelinux.cfg
create /opt/tftpboot/pxelinux.cfg/default
default menu.c32
prompt 0
timeout 50
ONTIMEOUT local
MENU TITLE PXE Boot Menu
LABEL Debian_Wheezy_32
MENU LABEL Debian Wheezy ^32
KERNEL debian32/vmlinuz
APPEND initrd=debian32/initrd.img root=/dev/nfs nfsroot=192.168.1.9:/opt/nfsroot/wheezy32 ip=dhcp
LABEL Debian_Wheezy_64
MENU LABEL Debian Wheezy ^64
KERNEL debian64/vmlinuz
APPEND initrd=debian64/initrd.img root=/dev/nfs nfsroot=192.168.1.9:/opt/nfsroot/wheezy64 ip=dhcp
LABEL memtest86
MENU LABEL ^memtest86
KERNEL memtest86.bin
setup dhcp / tftp (/etc/dnsmasq.conf)
# Set the boot filename for netboot/PXE. You will only need
# this is you want to boot machines over the network and you will need
# a TFTP server; either dnsmasq's built in TFTP server or an
# external one. (See below for how to enable the TFTP server.)
#dhcp-boot=pxelinux.0
# The same as above, but use custom tftp-server instead machine running dnsmasq
dhcp-boot=pxelinux.0,pxeserver,192.168.1.9
...
# Enable dnsmasq's built-in TFTP server
enable-tftp
# Set the root directory for files available via FTP.
tftp-root=/opt/tftpboot
...
create rootfs (i386)
# mkdir /opt/nfsroot/wheezy32
# debootstrap --arch=i386 wheezy wheezy32 http://mirrors.kernel.org/debian
# chroot /opt/nfsroot/wheezy32
# aptitude install openssh-server
# aptitude install linux-image-486
# aptitude install memtest86
create rootfs (amd64)
# mkdir /opt/nfsroot/wheezy64
# debootstrap --arch=amd64 wheezy wheezy64 http://mirrors.kernel.org/debian
# chroot /opt/nfsroot/wheezy64
# aptitude install openssh-server
# aptitude install linux-image-amd64
# aptitude install memtest86
create /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/opt/nfsroot/wheezy32 *(rw,sync,no_subtree_check,no_root_squash)
/opt/nfsroot/wheezy64 *(rw,sync,no_subtree_check,no_root_squash)