Using gPXE with QEMU
PXE stands for Pre eXecution Environment. It is used to boot off from a network. The PXE code is usually contained in a ROM on your network card. It is supplied by your card manufacturer. These PXE ROMs conform to a PXE specification laid out by Intel Corporation (I guess).
Now, coming to gPXE, it is a PXE ROM which is open source and which conforms to the Intel PXE specs. Isn’t it interesting ?? It can be burnt onto your Ethernet card by a software given by Intel. gPXE is mainly used to boot Linux kernel by fetching it from remote locations, from a TFTP or a HTTP server.
Now I hear you asking, “Is there a way to test this cool stuff without risking my Ethernet card ?”. The answer is “Yes, you can!“. Now, Lets see how to do it. The things you need are,
- gPXE source code (obtained from http://www.etherboot.org )
- QEMU – An open source multi architecture emulator.
Next, build the gPXE from source following the instructions in the source tarball. You’ll see a gpxe.usb file in src/bin/ directory. Thats the USB image of the gPXE ROM which can be put into an USB mass storage device directly. Now execute the following command
qemu -hda bin/gpxe.usb -net nic -net user -bootp http:/etherboot.org/gtest/gtest.gpxe
http://quark.entity.com/gtest/gtest.gpxe is the location where a kernel is located.
Once you’ve booted successfully, you may now be proud that you’ve booted across from a thousand miles away! Fun! Isn’t it ?




Linux boots, but it gives me a kernel panic.
Would it be possible to correct this?
zoobab
June 14, 2008
@zoobab
Yes, definitely. Its mostly that the kernel could not mount the root filesystem. How have you specified your root filesystem ?
balajirrao
June 14, 2008
I just typed:
“qemu -hda bin/gpxe.usb -net nic -net user -bootp http://quark.entity.com/gtest/gtest.gpxe“
zoobab
June 17, 2008
It works now. I have the tomsrtbt root shell.
zoobab
July 22, 2008
It might be great to provide a simple webserver that is serving the kernel+initrd on the localhost.
Just for the pleasure to test other kernels and initrds.
After that, write a script that find kernels and initrds in an ISO file.
zoobab
July 24, 2008