Skip to content

Instantly share code, notes, and snippets.

@benley
Created August 5, 2012 08:06
Show Gist options
  • Save benley/3262785 to your computer and use it in GitHub Desktop.
Save benley/3262785 to your computer and use it in GitHub Desktop.
A quick and dirty netinstall method for Debian

A quick and dirty netinstall method for Debian

Requirements:

  • An existing computer (or virtual machine) running Linux. Other unix variants may work, but no guarantees. You need root access.
  • An internet connection. Duh.
  • The target machine and your netboot server must be on the same vlan (Ethernet segment). If you're doing this at home, they probably are.
  • The target machine must be connected to the network via wired ethernet, not wifi. PXE booting doesn't work with wifi.

For purposes of this document, I'm going to assume that you are installing Debian on an x86 or amd64 system.

How to do it

Get and build the netboot daemon:

git clone https://github.com/ITikhonov/netboot.git
cd netboot
gcc -o netboot netboot.c

Download the debian netboot bits:

rsync -avP \
    rsync://ftp.us.debian.org/debian/dists/stable/main/installer-i386/current/images/netboot/ \
    debian_stable_i386_netboot

This will be ~100mb of stuff. You can replace i386 with amd64 based on the CPU in the target computer. The architecture of your netboot server doesn't matter here.

Start the netboot server:

cd debian_stable_i386_netboot
sudo ../netboot <broadcast ip> <interface ip> <ip to assign> <mac address>

Definitions:

Term Explanation
broadcast ip The broadcast address for your subnet. If your computer's IP is in the range 192.168.1.(1-255), then your broadcast IP is almost certainly 192.168.1.255.
interface ip The IP address of your netboot server. This is relevant if you have more than one network interface in your system.
ip to assign The IP address to assign to the target computer. Make sure it's an available address, and that it is in the correct subnet. Ideally use one that your network's dhcp server would normally assign, but which isn't currently in use.
mac address The MAC address of the target computer.

Netboot!

At this point, make sure that your target system is configured to boot to the network. PXE needs to be enabled on it, etc. Boot it up! The Debian installer should start. After a while, the installer will complain that it can't connect to the internet, and will ask you what to do. At this point, you need to kill the netboot server, so just press ctrl-c on the system running the netboot app. Then tell the Debian installer to retry network autoconfiguration, and it will get a fresh dhcp lease from your network's normal router and continue.

That should be it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment