Sunday, 12 December 2010

The problem that I'm facing is that I need to boot a PC in a LTSP's environment to do some debugging and testing. Unfortunately, the PXE's BIOS functionality of that PC seems to be broken.

In case you need to boot a thinclient via PXE but its firmware doesn't support that function, you can solve the problem with gPXE as long as the network card is recognized as a PCI device (sadly that doesn't work if the device is PCMCIA or USB on most occasions). Also you'll must have a block device where to install grub (in this case grub2).

As I don't want to loose the data in that PC, installing gPXE directly in the HD (and thus converting the PC in a thinclient) is not an option. That would have been done by:

dd if=gPXE-for-usb.img of=/dev/sda

Don't do that ;-)

I know I can use a gPXE image for USB or CD, but that is a bit odd. The best option for me is to add an entry tro grub, so I can choose at grub menu to boot into my PC's own OS or doing a netboot.

Hands on!

The first thing we will do is getting a gPXE image from rom-o-matic.net. In order to get it we'll leave the default options as they are, and we'll just specify that the type of image we want is a «Linux kernel bootable image (.lkrn)»

Once we have it, we'll put the resulting .lkrn image at /boot/ directory:

/boot/gpxe-1.0.1-gpxe.lkrn

The way of working with grub2 is quite different from the classic grub; now we cannot edit a menu.lst. Instead, to add new entries in the grub menu we'll have to edit the file /etc/grub.d/40_custom (at least for debian or ubuntu).