NAT PXE Boot?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
p.brantner
Posts: 6
Joined: 4. Oct 2010, 11:54
Primary OS: MS Windows XP
VBox Version: OSE Debian
Guest OSses: Linux

NAT PXE Boot?

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: NAT PXE Boot?

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
p.brantner
Posts: 6
Joined: 4. Oct 2010, 11:54
Primary OS: MS Windows XP
VBox Version: OSE Debian
Guest OSses: Linux

Re: NAT PXE Boot?

Post 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.
p.brantner
Posts: 6
Joined: 4. Oct 2010, 11:54
Primary OS: MS Windows XP
VBox Version: OSE Debian
Guest OSses: Linux

Re: NAT PXE Boot?

Post 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.
tigerike
Posts: 1
Joined: 15. Apr 2015, 01:20

Re: NAT PXE Boot?

Post 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
Post Reply