| # How to boot a diskless VM with iPXE over NFS using only IPv6 | # How to boot a diskless VM with iPXE over NFS using only IPv6 | ||||
| I have encountered so many issues and countless hours trying to figure this out, but I finally succeeded. Reading source code, strace'ing binaries trying to figure out what was wrong with them. | |||||
| I have encountered many issues and countless hours trying to figure this out, but I finally succeeded. Reading source code, strace'ing binaries trying to figure out what was wrong with them. | |||||
| # iPXE | # iPXE | ||||
| iPXE will do IPv4 DHCP first and then IPv6 SLAAC/DHCP. This is not a problem, it's just annoying. IPv4 DHCP has a default timeout in iPXE of 10 seconds. | iPXE will do IPv4 DHCP first and then IPv6 SLAAC/DHCP. This is not a problem, it's just annoying. IPv4 DHCP has a default timeout in iPXE of 10 seconds. | ||||
| * enable IPv6 -> `src/config/general.h` -> `#define NET_PROTO_IPV6` | * enable IPv6 -> `src/config/general.h` -> `#define NET_PROTO_IPV6` | ||||
| * mangle IPv4 DHCP timeout -> `src/config/dhcp.h` -> `#define DHCP_DISC_END_TIMEOUT_SEC 1` | * mangle IPv4 DHCP timeout -> `src/config/dhcp.h` -> `#define DHCP_DISC_END_TIMEOUT_SEC 1` | ||||
| Debian/Ubuntu ipxe-qemu patching | |||||
| ``` | |||||
| apt-get update | |||||
| apt-get source ipxe-qemu | |||||
| apt-get build-dep ipxe-qemu | |||||
| cd ipxe-1.0.0+git-20180124.fbe8c52d # or whatever your version is | |||||
| dch -n "add support for serial console / IPv6" | |||||
| # apply the modifications above | |||||
| debuild -b -uc -us | |||||
| cd .. | |||||
| dpkg -i ipxe-qemu_*.deb | |||||
| ``` | |||||
| # Kernel options | # Kernel options | ||||
| Make sure you pass the right kernel options for initramfs/initrd to know exactly what you want to do. (replace eth0 with the name of your PXE interface) | Make sure you pass the right kernel options for initramfs/initrd to know exactly what you want to do. (replace eth0 with the name of your PXE interface) |