Setting up netboot

Based on

apt-get install live-helper
apt-get install nfs-kernel-server # You need the package nfs-kernel-server. Apparently, nfs-user-server does not work with netboot
apt-get install dhcp3-server
apt-get install tftpd-hpa
apt-get install xinetd

ifconfig eth1

mkdir /srv/debian-live
echo “/srv/debian-live *(rw,sync,no_root_squash)” >> /etc/exports

mkdir mydeblive; cd mydeblive
lh_config -a i386
lh_config –binary-images net
lh_config –net-root-path “/srv/debian-live”
lh_config –net-root-server “”

lh_config –binary-images net \
–net-root-path “/srv/debian-live” \
–net-root-server “”

cp -R binary/ /srv/debian-live
mv /srv/debian-live/binary/live /srv/debian-live

cp -R tftpboot/* /var/lib/tftpboot
mv /var/lib/tftpboot/boot-screens/* /var/lib/tftpboot

iptables -t nat -F
# eth0 is outgoing internet connection (NOT the LAN iface for the netboot machines)
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

edit /etc/default/tftpd-hpa to make sure

vim /etc/xinetd.d/tftp

service tftp
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /var/lib/tftpboot
disable = no
bind =

/etc/init.d/xinetd restart

or just run

in.tftpd -l -a -v -v -p -s /var/lib/tftpboot/

You can place any executable scripts in:

Which will be executed when the image is being created, if you add more
scripts in here or change them, make sure to run lh_clean before lh_build, otherwise
they will NOT be run.

Useful script to go in:

echo “I: update password”
echo “root:nopasswd” | chpasswd

Setting up public key access to SSH host

Rather than manually creating the authorized_keys file in the ‘.ssh’ directory on the host computer
you want to set up public key access for, you can instead use:

ssh-copy-id -i user@host

Which will use the public key and automatically create the file
in the correct users directory.