Almost, I’ve had more reliable success if you ensure that the private network of the server & primary network of the client are forced on to the vbox network (assuming you are using Virtualbox.)
# PXE Server
config.vm.define "jumpstart" do |jumpstart|
jumpstart.vm.network :private_network, :ip => "10.241.19.11"
# force the secondardy nic to the same vboxnet as the PXE node
jumpstart.vm.provider "virtualbox" do |virtualbox|
# put primary network interface into hostonly network segement
virtualbox.customize ["modifyvm", :id, "--nic1", "hostonly"]
virtualbox.customize ["modifyvm", :id, "--hostonlyadapter2", "vboxnet7"]
end
# PXE client
config.vm.define :"node01" do |vm_config|
vm_config.vm.box = "blank-amd64”
# Use an empty box
# wait up to 10min before declaring the node dead (from Vagrant's POV)
# the user can still just ctrl-c the `vagrant upi node01` and
# vagrant will clean up
vm_config.vm.boot_timeout = 600
vm_config.vm.provider "virtualbox" do |virtualbox|
virtualbox.gui = true unless ENV['NO_GUI’]
# generate a new mac address for each node, to make them unique
virtualbox.customize ["modifyvm", :id, "--macaddress1", "auto"]
# put primary network interface into hostonly network segement
virtualbox.customize ["modifyvm", :id, "--nic1", "hostonly"]
virtualbox.customize ["modifyvm", :id, "--hostonlyadapter1", "vboxnet7"]
# pxe boot the node
#virtualbox.customize ["modifyvm", :id, "--boot1", "net"]
end
end
I’ve also noticed that the version of iPXE that ships with Virtualbox is quite old, and didn’t like some of the kernels I was working with, luckily it’s easy enough to use the ipxe.iso from
ipxe.org to use newer versions of the iPXE code (the alternative box below is needed because Fletcher’s box used above doesn’t have an IDE interface defined):
vm_config.vm.provider "virtualbox" do |virtualbox|
virtualbox.gui = true unless ENV['NO_GUI']
# VirtualBox ship old iPXE code, so boot off an up to date
# iPXE ISO instead
virtualbox.customize ["modifyvm", :id, "--boot1", "dvd"]
virtualbox.customize ["storageattach", :id, "--storagectl",
"IDE", "--port", "0", "--device", "0", "--type", "dvddrive",
"--medium", "ipxe.iso"]
Hope that helps - if not ping me, I’m working on 2 different PXE projects in Vagrant at the moment.