Page 1 of 1
How can I specify which NICs to PXE boot?
Posted: 30. May 2017, 20:58
by danielp
Hi,
I have setup a Host-only network with my own DHCP/TFTP server; I then have a VM with two NICs, the first on NAT for Internet access, the second on the host-only network I've setup so it boots off my DHCP/TFTP. I would like the VM to attempt a PXE boot only on the 2nd NIC. I've enabled 'network' boot under Settings > System > Motherboard > boot order and observed it attempts a PXE boot on NIC 1 and seems to pick up the VB DHCP PXE booting but then quits as expected since I haven't setup the <host>.pxe file. I would like to disable PXE for NIC1 and enable for NIC2; is this possible?
Re: How can I specify which NICs to PXE boot?
Posted: 30. May 2017, 21:04
by socratis
Possibly... Change NIC1 to be the HostOnly one, and NIC2 to be the NAT one.
Re: How can I specify which NICs to PXE boot?
Posted: 30. May 2017, 22:02
by danielp
That's a simple workaround; should have thought of it, thanks. Based on your response, do I assume correctly that VB only attempts PXE on NIC1, and there's no way to change/specify alternate behavior?
Re: How can I specify which NICs to PXE boot?
Posted: 30. May 2017, 22:07
by socratis
I've never done PXE booting, so don't go "based on my response". I came up with this "based on your experience"
I don't know if it's going to work or not. But, if I take a step back, on my other system, a Win PC with two NICs, I don't recall being able to specify
which NIC it should try booting from. I vaguely remember being just NIC-1, but I don't have a PXE server at home as well...
Re: How can I specify which NICs to PXE boot?
Posted: 30. May 2017, 23:08
by Martin
A search through the manual found
chapter 8.8.2 , the network settings parameters of VBoxManage.
Have a look at "--nicbootprio<1-N>"

Re: How can I specify which NICs to PXE boot?
Posted: 30. May 2017, 23:30
by danielp
@socratis - Your suggestion does work: VB seems to attempt PXE on only NIC1, so switching them around works for me.
@Martin - looks like that's it, sweet!
Re: How can I specify which NICs to PXE boot?
Posted: 31. May 2017, 00:04
by socratis
@danielp: Sweet!
(I haven't heard that "Sweet!" in more than 10 years, you woke up memories
)
@Martin: Excellent call! I didn't even know that was there. I went in the source code (my latest hobby) and I found this comment that explains the priorities:
So, it seems that in a sense the 'nicbootprio' tricks the PXE ROM by "reshuffling" the PCI order of the NIC cards as they're presented to the boot ROM.