Professional Documents
Culture Documents
Pxe Boot
Pxe Boot
Chen Jin
Bharath Pattabiraman
Patrick Foley
What is PXE?
Preboot eXecution Environment - a standard for booting
an OS from the network. Most machines BIOSes
support PXE. But, the BIOS used by Palacios does not.
Capability to boot independent of data storage devices
(like hard disks) or installed OS'es.
Defined on the foundation of widely used internet
protocols such as DHCP, and TFTP.
Our Goal
Add PXE network boot support to a Palacios guest so
that we can network-boot VMs.
o Change the BIOS (or)
o Find any other alternative solution
How does it work?
Client side
o Kitten/Palacios running on another Qemu
Server side Setup
DHCP Server configuration:
group {
next-server 172.21.0.2;
host test {
fixed-address 172.21.0.50;
hardware ethernet 52:54:00:12:34:57;
filename "pxelinux.0";
}
}
Server side Setup
TFTP Server setup:
When a client boots up it will check if there is a file
corresponding to its own MAC address in the
/var/lib/tftpboot/pxelinux.cfg/ directory.
However after trying several options it will fall back to
requesting a default file.
So, we simply changed to default file to contain the
configuration we want.
DEFAULT kitten
LABEL kitten
kernel bzImage
append serial.baud=115200 console=serial initrd=init_task
The pxelinux.0, bzImage and init_task files were
placed in the tftpboot directory
Implementation
Create a test bench for PXE booting, which
need consider both server and client
o Hard drive image
o Tap device
o VLAN
Boot guest os in kitten
o Boot PXE on client direcly to make sure rom omatic approcach
working
o NIC problems
Server
Hard drive image
o in order to avoid reconfiguring the system
every time we use the Qemu, we decided to
create hard drive image which saves all the
configuration status.
Server (cont'd)
Default
o "-net nic -net user
Tap device
o Host
Create the /dev/net/tun device node
mkdir /dev/net
mknod /dev/net/tun c 10 200
o guest
-net tap,ifname=tap0
enter 192.168.100.2 as the ip address
Tap Device
-net tap,ifname=tap0
Server-client connection
VLAN
-net nic,vlan=0,macaddr=52:54:00:12:34:56,model=e1000
tap
Guest NIC VLAN 0
OS socket
VLANs
-net nic,vlan=0,macaddr=52:54:00:12:34:56,model=e1000
-net socket,vlan=0,listen=localhost:9000
-net nic,vlan=2,macaddr=52:54:00:12:34:57,model=ne2k_pci
-net socket,vlan=2,connect=localhost:9000
tap
Guest VLAN 0
A NIC
socket
Guest VLAN 2
tap
B NIC
socket
gPXE
Reboot the client machine with gpxe iso
image
http://rom-o-matic.net/
It worked, yeah!
Happiness didnt last long
Final Step
Is it possible to start a VM that contains
just gpxe.
Reboot Guest in kitten/palacios
PCI NICs
o E1000 / rtl8139
DMA execution: the devices write to Guest physical
memory directly. (offset is needed)
o ne2k_pci (there is no gpxe iso image available)
ne2k_isa
o Requests from client are delivered, however the packets
sent from server are dropped
o Port I/O to receive the packets
o NIC device interrupt is not handled
Modification in Palacios
o v3_hook_passthrough_irq(...)
o v3_raise_irq(...)
A lot of thanks to Prof.Dinda and Lei Xia!