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


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: