User Tools

Site Tools


usersguide:bootingovernetworkusingpxe

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision Both sides next revision
usersguide:bootingovernetworkusingpxe [2014/11/11 14:52]
127.0.0.1 external edit
usersguide:bootingovernetworkusingpxe [2015/01/21 12:03]
antoineleca Add Bochs setup for PXE booting (qEmu should be similar, feel free to add)
Line 1: Line 1:
 +<div round info>
 +**Stale page**
 +
 +The contents of this page must be revised to reflect the current state of MINIX3. Mainly the fact that we do not have anymore the USB image, as referenced.
 +</​div>​
 +
 +====== Introduction ======
 +It is possible to boot the MINIX 3 usb image over network using pxelinux and memdisk. This makes use of the PXE protocol supported in some network cards. The network card loads its boot files over network and boot the PC from these files.
 +
 +====== Setup ======
 +PXE booting involves two machines, one which is hosting the files and can be used for many other tasks, and the other which will be booting MINIX 3 through the PXE protocol.
 +===== Physical host system =====
 +==== Host system ====
 +As a host, use for example Ubuntu 10.04.1. And install the following packages:
 +
 +  * dhcp3-server
 +  * tftpd-hpa
 +  * syslinux
 +
 +==== DHCP server ====
 +Setup the network interface of the host to a static IP. For example:
 +<​code>​
 +ifconfig eth0 192.168.0.1 netmask 255.255.255.0
 +</​code>​
 +It is important that eth0 has an IP in the dhcpd IP subnet, otherwise the dhcpd does not work.
 +
 +Edit the configuration file of the DHCP server **/​etc/​dhcp3/​dhcpd.conf**:​
 +<​code>​
 +...
 +subnet 192.168.0.0 netmask 255.255.255.0 {
 +  range 192.168.0.10 192.168.0.20;​
 +  filename "​pxelinux.0";​
 +}
 +...
 +</​code>​
 +
 +You should now proceed to [[#​TFTP|TFTP]] setup.
 +===== Virtual machine host =====
 +As an alternative,​ you can set up most (all?) virtual machine software to provide a PXE booting environment. Details vary between VM environments,​ we will use [[.:​runningonbochs|Bochs]] as an example here.
 +
 +In addition to the VM software installed, you will need the PXE //BIOS option ROM// for the emulated network adapter; using ''​ne2k''​ as an example, go to [[http://​rom-o-matic.net/​etherboot/​etherboot-git/​etherboot.git/​contrib/​rom-o-matic/​|ROM-o-matic.net]] for Etherboot-git service, choose ''​ns8390:​rtl8029''​ (this should match the PCI ids for the emulated NIC) as NIC/ROM type and //Binary ROM image// as output format, and press the button to download the resulting ''​eb-git-rtl8029.zrom''​ image which ROM-o-Matic just compiled for you.
 +
 +==== Bochs virtual machine ====
 +Now, create a new virtual machine configuration file ''​bochsrc.txt''​ as
 +<​code>​
 +megs: 768
 +romimage: file=$BXSHARE/​BIOS-bochs-latest
 +vgaromimage:​ file=$BXSHARE/​VGABIOS-lgpl-latest
 +pci: enabled=1, chipset=i440fx,​ slot1=pcivga,​ slot2=ne2k
 +ne2k: mac=B0:​C4:​00:​12:​34:​65,​ ethmod=slirp,​ ethdev=/​var/​lib/​tftpboot,​ script="​slirp.conf",​ bootrom=eb-git-rtl8029.zrom
 +log: bochsout.txt
 +mouse: enabled=0
 +boot: network
 +</​code>​
 +Note that the //ethdev=// parameter matches the usual Linux setting, but you can use anything you want.
 +
 +You also need to create a SLiRP configuration file ''​slirp.conf'',​ which only needs to contain
 +<​code>​
 +# slirp config
 +bootfile = pxelinux.0
 +</​code>​
 +===== TFTP =====
 +Now copy the following files to ''/​var/​lib/​tftpboot''​ (the dir the TFTP daemon reads its files from, adjust if needed):
 +  * /​usr/​lib/​syslinux/​memdisk (memdisk can emulate a disk drive from an image using bios int 13h)
 +  * /​usr/​lib/​syslinux/​pxelinux.0 (the first file)
 +  * /​usr/​lib/​syslinux/​menu.c32 (for the menu)
 +  * the minix 3 usb image from the [[http://​www.minix3.org/​download|download page]], call it mnxusb.img
 +
 +Now create the directory ''/​var/​lib/​tftpboot/​pxelinux.cfg''​ and create the file ''/​var/​lib/​tftpboot/​pxelinux.cfg/​default'':​
 +
 +<​code>​
 +default menu.c32
 +timeout 100
 +
 +label X
 +menu label  Minix3
 +kernel memdisk
 +append initrd=mnxusb.img
 +</​code>​
 +====== Boot ======
 +Now start the MINIX machine, with network card. On this machine choose LAN boot or PXE boot as boot option. If everything goes well, the menu should popup. ​ Press enter, and the USB image is transferred via network (this can take a while (~40 s), the image is over 400MB :P). When this is done, the system is loading boot sector and MINIX 3 is started from a ramdrive.
 +
 +====== Troubleshooting ======
 +====== VirtualBox ======
 +This method has been reported **not to work** on VirtualBox version 3.2.8 and 3.1.4.
 +
 +====== ArchLinux ======
 +To allow incoming tftp connections,​ extend **/​etc/​hosts.allow**
 +
 +<​code>​
 +...
 +tftpd: ALL
 +in.tftpd: ALL
 +...
 +</​code>​
 +===== DHCPD =====
 +If your DHCP does not work, make sure the network address of your network card is in the subnet specified in the dhcpd configuration.
  
usersguide/bootingovernetworkusingpxe.txt · Last modified: 2016/03/22 18:27 by jeanbaptisteboric