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 
    vm_config.vm.box_url  = 
"https://s3.amazonaws.com/fnichol/vagrant-base-boxes/blank-amd64-20121109.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.box      = "boot-from-iso"
vm_config.vm.box_url  = 
"https://dl.dropboxusercontent.com/u/7196/boot-from-iso.box”
    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.

-- 
Simon McCartney

On 11 September 2015 at 00:08:57, Joaquin Menchaca ([email protected]) wrote:

Say, if I wanted to do like, a pxeboot server, would my vagrant file look like 
this (assuming my server has dhcpd on it)?

Vagrant.configure("2") do |config|
  config.vm.define "server" do |server|
    server.vm.box = "hashicorp/precise64"  # Heisenbug
    server.vm.hostname = "pxeboot"
    server.vm.network :private_network, ip: "10.1.1.1"
  end

  config.vm.define "client" do |client|
    client.vm.gui = true
    client.vm.customize ["modifyvm", :id, "--boot1", "net", "--boot2", "disk"]
    client.vm.network :private_network, type: "dhcp", auto_config: false
  end

end
--
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/f783ad03-303b-4083-be7c-e7368bfefa5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/etPan.55f34ee5.7fd1eb8a.b0c1%40Simons-MacBook-Pro.local.
For more options, visit https://groups.google.com/d/optout.

Reply via email to