Saturday, 13 September 2014

Certain machines can't boot from linux PXE server, pxelinux.0 file not found

What:

PXE boot server on Raspberry PI, Lenovo ThinkCentre A70z client

Problem:

When I am trying to boot from the network I get:

PXE-T01: file not found
PXE-E3B-TFTP Error file not found
PXE-M0F exiting Intel boot agent

Solution:

All files on TFTP server are in correct locations, also DHCP provides good config, boot fails only on certain pc's.

Below solution will only work with tftp-hpa TFTP server.

Troubleshooting


Let's see what file is actually being called.
 vi /etc/default/tftpd-hpa
Set the verbose flag, which will send all messages to the syslog
TFTP_OPTIONS="--secure --ipv4 --verbose --verbosity 5"
Restart tftp server to apply changes.
/etc/init.d/tftpd-hpa restart
Confirm that daemon is running with verbose flag set.
ps aux | grep tftpd
Watch a log file.
tail -f /var/log/syslog
Try to boot from the network again.

In syslog you should see that client is looking for the below file.
pxelinux.0�
It has some weird character added at the end, hence it can't find the original file.

You can also sniff packets with tcpdump.
tcpdump -ni eth0 -v -T tftp 'udp'
Output:
pxelinux.0M-^?

Solution

Apparently some old PXE stacks have a bug. What's added to the file name is a hex value 0xFF, which encodes to ÿ.

1. From Ubuntu desktop ssh to TFTP server (if you haven't already).
2. In gnome-terminal change encoding, Terminal > Set Character Encoding > Add or Remove, select ISO-8859-1
3. Now if you try to boot your client again in log you should see encoded character.
4. Check if your tftp-hpa supports map file.
/usr/sbin/in.tftpd -V
5. If yes, then let's create one.
echo 'rg (.*)ÿ$ \1' > /etc/default/tftpd-hpa.map
6. Add map file to your configuration
vi /etc/default/tftpd-hpa
TFTP_OPTIONS="--secure --ipv4 --map-file /etc/default/tftpd-hpa.map"
 /etc/init.d/tftpd-hpa restart
7. Now client should boot fine.

No comments:

Post a Comment