PXE boot problems
I've created an PXE boot server to automate the deployments of operating systems to all of my Up boards. The server is up and running, and when I test it with other systems it is working perfect. But when using it on the up board it just boots the OS that's currently on there.
You can watch this video and see what's happening:
[video width=425 height=344 type=youtube]g0abTuk7id8[/video]
So after it goes to PXE boot, it says "succeed to download nbp file" but after that it starts the OS currently installed on the board.
I took a screenshot from the video where you can see that it does download the pxelinux.0 file:
I tried a lot of stuff but I have no idea what to do now, did someone manage to set it up? Maybe someone had this problem before?
Thanks guys!
Comments
-
I got it working!
Apparantly pxelinux.0 is BIOS only and the upboard is UEFI. So after I followed this UEFI guide I got it working in several minutes: https://wiki.ubuntu.com/UEFI/PXE-netboot-install -
Thanks for sharing! Good job!
-
After playing some time with grub EFI net boot I found that it is not very suitable option for large installation when different upboards need to download some custom image/configuration. Also it turned out to be very slow due to some bug (tftp download of initrd was taking 10-15 sec), so i had to use 'shim.efi'. That improved download speed but still was not perfect solution. iPXE (http://www.ipxe.org/) seems to be much better choice. Besides tftp it can download kernel/ininitd over http, and much more flexible from configuration point of view.
Here is a part of my dhcpd.conf :
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.2.255;
option ntp-servers 192.168.2.1;
next-server 192.168.2.50;
if exists user-class and option user-class = "iPXE" and substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00007" {
filename "upboard/boot.ipxe";
} elsif substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00007" {
filename "upboard/ipxe.efi";
} else {
filename "Correct_This";
}
host uph1 { hardware ethernet 00:07:32:3e:17:2b; fixed-address 192.168.2.101; option host-name "uph1"; }
.....
}
boot.ipxe:
set menu-timeout 2000
set menu-default bootNormal
set rootURI http://192.168.2.50:8080/upboard
set kernelName vmlinuz-4.4.0-2-upboard
set initrdName initrd.img-4.4.0-2-upboard
set rootfsName vwRootFileSystem_090217v1.squashfs
set localDiskName /dev/mmcblk0
set rootPart=/dev/disk/by-partlabel
:start
menu iPXE boot menu for ${initiator-iqn}
item --gap --
Available options
item --key n bootNormal Normal Boot
item --key i bootForceInit Force Initialize Disk
item --key s bootNone Skip loading Root File System
item --gap --
item shell Drop to iPXE shell
item reboot Reboot computer
item --key x exit Exit iPXE and continue BIOS boot
choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel
set menu-timeout 0
goto ${selected}
:bootNormal
echo Normal Boot
kernel --name vmlinuz ${rootURI}/${kernelName}
initrd --name initrd.img ${rootURI}/${initrdName}
imgargs vmlinuz initrd=initrd.img consoleblank=0 net.ifnames=0 boot=live fetch=${rootURI}/${rootfsName} union=aufs todisk=${rootPart} swap=true initDisk=${localDiskName} --
boot || goto failed
...... -
@Nikolay Arbuzov said:
After playing some time with grub EFI net boot I found that it is not very suitable option for large installation when different upboards need to download some custom image/configuration. Also it turned out to be very slow due to some bug (tftp download of initrd was taking 10-15 sec), so i had to use 'shim.efi'. That improved download speed but still was not perfect solution. iPXE (http://www.ipxe.org/) seems to be much better choice. Besides tftp it can download kernel/ininitd over http, and much more flexible from configuration point of view.
Here is a part of my dhcpd.conf :
subnet 192.168.2.0 netmask 255.255.255.0 {
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.2.255;
option ntp-servers 192.168.2.1;
next-server 192.168.2.50;
if exists user-class and option user-class = "iPXE" and substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00007" {
filename "upboard/boot.ipxe";
} elsif substring(option vendor-class-identifier, 0, 20) = "PXEClient:Arch:00007" {
filename "upboard/ipxe.efi";
} else {
filename "Correct_This";
}
host uph1 { hardware ethernet 00:07:32:3e:17:2b; fixed-address 192.168.2.101; option host-name "uph1"; }
.....
}
boot.ipxe:
set menu-timeout 2000
set menu-default bootNormal
set rootURI http://192.168.2.50:8080/upboard
set kernelName vmlinuz-4.4.0-2-upboard
set initrdName initrd.img-4.4.0-2-upboard
set rootfsName vwRootFileSystem_090217v1.squashfs
set localDiskName /dev/mmcblk0
set rootPart=/dev/disk/by-partlabel
:start
menu iPXE boot menu for ${initiator-iqn}
item --gap -- Available options item --key n bootNormal Normal Boot
item --key i bootForceInit Force Initialize Disk
item --key s bootNone Skip loading Root File System
item --gap -- item shell Drop to iPXE shell
item reboot Reboot computer
item --key x exit Exit iPXE and continue BIOS boot
choose --timeout ${menu-timeout} --default ${menu-default} selected || goto cancel
set menu-timeout 0
goto ${selected}
:bootNormal
echo Normal Boot
kernel --name vmlinuz ${rootURI}/${kernelName}
initrd --name initrd.img ${rootURI}/${initrdName}
imgargs vmlinuz initrd=initrd.img consoleblank=0 net.ifnames=0 boot=live fetch=${rootURI}/${rootfsName} union=aufs todisk=${rootPart} swap=true initDisk=${localDiskName} --
boot || goto failed
......I've been trying to use iPXE but can't seem to figure out the proper way to boot the iso.
How did you get this working?