Debian Squeeze PXE Netboot For VirtualBox

This is the second article in a multi-part series that describes how to use Oracle’s VirtualBox to automatically set up Debian Squeeze VMs on a host machine. All the scripts used in these articles are available for download.

The articles are available here:

  1. Headless Debian VirtualBox Setup
  2. Debian Squeeze PXE Netboot For VirtualBox
  3. Need An Ultralight WebServer? You Need Mongoose!
  4. Preseeding a Debian Squeeze Netboot Install

Contents

Introduction

This article is part of a series that describes my system for easily setting up Debian Squeeze VMs using VirtualBox. Specifically, we’ll go though setting up a PXE boot environment that takes advantage of the VirtualBox built-in TFTP server for NAT interfaces.

Resources

Setting Up The PXE Boot Files

The instructions for netbooting Debian Squeeze are pretty good, except there is a wrinkle if you are booting a VirtualBox machine – the default drivers in the netboot image from the Debian site don’t support the VirtualBox hard drives. So we need to do some patching which involves grabbing an initrd.gz image that has the drivers and transplanting them into the netboot image. Rather than walk you through this step by step, I’ll just show the script that I use.

The script creates a d-i_firmare under your $HOME/tmp directory, and we’ll use the results in the TFTP setup later to serve up the actual netboot image.

If you run this script, you’ll be most of the way to getting a PXE bootable image together – in fact it does all the symlinking necessary to get us to the next step in the process, which is actually booting the machine.

If the network interface that is configured for NAT is set up as the priority boot interface, everything should just work. In the next article, we’ll discuss how to customize the boot files so that the installer is started automatically, and we’ll also investigate automating the entire install process using preseeding.