Page 1 of 1

NAT PXE Boot?

Posted: 6. Oct 2010, 15:21
by p.brantner
hi,
I've got a problem with my VirtualBox host. I want to do a pxe-boot over the network.
I use VirtualBox on my Windows Host and in my network there's a TFTP/PXE Server where OS-Images are located.
The problem: It's not possible for me to install a dhcp-service on my server that gives the client information about the bootfile because it would interfere with the existing dhcp-server of the network.
I did some research and found out that it is possible to use NAT on my virtual machine and create a "TFTP"-folder in my VB directory where a bootloader is located that will be bootet automatically. When I want to start the networkboot in my virtual machine it doesn't get an IP address from the dhcp server of virtual box. I already created the folder with the right bootloader but it doesn't work. In addition I found the VBoxManage where I was able to reconfigure the services (in our case TFTP) of VB:

Code: Select all

VBoxManage modifyvm "My VM" --nattftpserver1 10.0.2.2
VBoxManage modifyvm "My VM" --nattftpfile1 /srv/tftp/boot/MyPXEBoot.pxe 
I used the IP address of my server and also used the right path to the pxe-file.

So my question: is it possible to configure this scenario?

PS: the tftp-/pxe-server works fine with a dhcp-server, but i have to test it without a dhcp-server.

Re: NAT PXE Boot?

Posted: 6. Oct 2010, 20:11
by Sasquatch
From the user manual, chapter 6.3.2:
6.3.2. PXE booting with NAT
PXE booting is now supported in NAT mode. The NAT DHCP server provides a boot file name of the form vmname.pxe if the directory TFTP exists in the directory where the user's VirtualBox.xml file is kept. It is the responsibility of the user to provide vmname.pxe.
This means you put a folder called TFTP in your %appdata%\.VirtualBox folder and put the .pxe file there. That's all.

Re: NAT PXE Boot?

Posted: 6. Oct 2010, 22:56
by p.brantner
Yeah I've read that too and createt a folder called "TFTP" and coppied my bootloader in that folder and named it [vmname].pxe. When I want to do a networkboot it waits for an IP address from the dhcp server but my virtual machine gets no.

Re: NAT PXE Boot?

Posted: 13. Oct 2010, 17:39
by p.brantner
I tried it again and again and now there is a TFTP-problem.
I configured following options with VBoxManage:

Code: Select all

VBoxManage modifyvm "My VM" --nattftpserver1 10.114.1.146
VBoxManage modifyvm "My VM" --nattftpfile1 /var/lib/tftpboot/pxelinux.0
10.114.1.146 is the address of the TFTP server and on that machine the path to the boot loader is /var/lib/tftpboot/pxelinux.0.

The server is a VBox VM too, but configured with "Bridged" on a different PC. I can ping both PCs and the virtual Server from all machines and the IP addresses are all in the same subnet.

I get following output:

Code: Select all

CLIENT MAC ADDR: 08 00 27 BF 19 F5 GUID: [....]
CLIENT IP: 10.0.2.15 MASK: 255.255.255.0 DHCP IP: 10.0.2.2
GATEWAY IP: 10.0.2.2
TFTP.
PXE-T01: File not found
PXE-E3B: TFTP Error - File Not found
PXE-M0F: Exiting Intel PXE ROM.
FATAL: Could not read from the boot medium! System halted.

Re: NAT PXE Boot?

Posted: 15. Apr 2015, 01:29
by tigerike
I think that the path to the boot file is from the root of the tftp server not for the root drive (ie: /pxelinux.0).
This worked for me:

I added my virtual host to my solaris jumpstart server:

ll /tftpboot/*010800278B5E95*
lrwxrwxrwx 1 root root 26 Apr 13 19:35 010800278B5E95 -> pxegrub.I86PC.Solaris_10-1
lrwxrwxrwx 1 root root 26 Apr 13 19:36 nbp.010800278B5E95 -> pxegrub.I86PC.Solaris_10-1
-rw-r--r-- 1 root root 316 Apr 14 23:10 menu.lst.010800278B5E95

VBoxManage modifyvm "vagrant-solaris-10" --nattftpserver1 [tftp_boot_server]
VBoxManage modifyvm "vagrant-solaris-10" --nattftpfile1 010800278B5E95

I havent tried this out with our redhat kickstart yet but I am assuming that it works the same

Now I can package these up as vagrant boxes for puppet module testing against host that significantly resemble our actual hosts :)


Forgot that you also have to add some config in other spots on the jumpstart server so that your VM will get the correct profile installed:
#/jumpstart/rules
hostname vagrant-solaris-10 - pro.virt sol10-post

#/etc/hosts
10.0.2.15 vagrant-solaris-10

#/etc/ethers
08:00:27:8B:5E:95 vagrant-solaris-10

#regenerate rules.ok
cd /jumpstart
sudo ./check