Closed gdha closed 7 years ago
Using the following section in Vagrantfile:
config.vm.define "recover", autostart: false do |recover|
#recover.vm.provider "virtualbox" do |recover|
file_to_disk = File.realpath( "." ).to_s + "/recover-dsk.vdi"
recover.vm.box = "pxe_boot"
# Use an empty box
recover.vm.box_url = "https://s3.amazonaws.com/fnichol/vagrant-base-boxes/blank-amd64-20121109.box"
recover.vm.gui = true unless ENV['NO_GUI']
recover.vm.memory = 1024
recover.vm.cpus = 1
# See https://gist.github.com/leifg/4713995 to create a hd
unless File.exist?(file_to_disk)
recover.vm.customize ['createhd', '--filename', file_to_disk, '--size', 40 * 1024]
end
recover.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1,
'--device', 0, '--type', 'hdd', '--medium', file_to_disk]
recover.vm.customize ["modifyvm", :id, "--macaddress1", "auto"]
recover.vm.customize ["modifyvm", :id, "--boot1", "net", "--boot2", "disk"]
recover.vm.network :private_network, type: "dhcp", auto_config: false
end # of |recover|
# end of |vmrecover|
#end
but then we get the following:
$ vagrant up recover
Bringing machine 'recover' up with 'virtualbox' provider...
==> recover: Box 'pxe_boot' could not be found. Attempting to find and install...
recover: Box Provider: virtualbox
recover: Box Version: >= 0
==> recover: Box file was not detected as metadata. Adding it directly...
==> recover: Adding box 'pxe_boot' (v0) for provider: virtualbox
recover: Downloading: https://s3.amazonaws.com/fnichol/vagrant-base-boxes/blank-amd64-20121109.box
recover:
==> recover: Successfully added box 'pxe_boot' (v0) for 'virtualbox'!
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* The following settings shouldn't exist: cpus, customize, gui, memory
$ vagrant up recover
Bringing machine 'recover' up with 'virtualbox' provider...
==> recover: Importing base box 'clink15/pxe'...
==> recover: Matching MAC address for NAT networking...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["modifyvm", "596559d2-1a73-480c-b1d1-3dc240d77aff", "--macaddress1", ""]
Stderr: Oracle VM VirtualBox Command Line Management Interface Version 5.1.8
(C) 2005-2016 Oracle Corporation
All rights reserved.
Usage:
VBoxManage modifyvm <uuid|vmname>
[--name <name>]
[--groups <group>, ...]
[--description <desc>]
[--ostype <ostype>]
[--iconfile <filename>]
[--memory <memorysize in MB>]
[--pagefusion on|off]
[--vram <vramsize in MB>]
[--acpi on|off]
[--pciattach 03:04.0]
[--pciattach 03:04.0@02:01.0]
[--pcidetach 03:04.0]
[--ioapic on|off]
[--hpet on|off]
[--triplefaultreset on|off]
[--apic on|off]
[--x2apic on|off]
[--paravirtprovider none|default|legacy|minimal|
hyperv|kvm]
[--paravirtdebug <key=value> [,<key=value> ...]]
[--hwvirtex on|off]
[--nestedpaging on|off]
[--largepages on|off]
[--vtxvpid on|off]
[--vtxux on|off]
[--pae on|off]
[--longmode on|off]
[--cpu-profile "host|Intel 80[86|286|386]"]
[--cpuid-portability-level <0..3>
[--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]
[--cpuidremove <leaf>]
[--cpuidremoveall]
[--hardwareuuid <uuid>]
[--cpus <number>]
[--cpuhotplug on|off]
[--plugcpu <id>]
[--unplugcpu <id>]
[--cpuexecutioncap <1-100>]
[--rtcuseutc on|off]
[--graphicscontroller none|vboxvga|vmsvga]
[--monitorcount <number>]
[--accelerate3d on|off]
[--accelerate2dvideo on|off]
[--firmware bios|efi|efi32|efi64]
[--chipset ich9|piix3]
[--bioslogofadein on|off]
[--bioslogofadeout on|off]
[--bioslogodisplaytime <msec>]
[--bioslogoimagepath <imagepath>]
[--biosbootmenu disabled|menuonly|messageandmenu]
[--biosapic disabled|apic|x2apic]
[--biossystemtimeoffset <msec>]
[--biospxedebug on|off]
[--boot<1-4> none|floppy|dvd|disk|net>]
[--nic<1-N> none|null|nat|bridged|intnet|hostonly|
generic|natnetwork]
[--nictype<1-N> Am79C970A|Am79C973|
82540EM|82543GC|82545EM|
virtio]
[--cableconnected<1-N> on|off]
[--nictrace<1-N> on|off]
[--nictracefile<1-N> <filename>]
[--nicproperty<1-N> name=[value]]
[--nicspeed<1-N> <kbps>]
[--nicbootprio<1-N> <priority>]
[--nicpromisc<1-N> deny|allow-vms|allow-all]
[--nicbandwidthgroup<1-N> none|<name>]
[--bridgeadapter<1-N> none|<devicename>]
[--hostonlyadapter<1-N> none|<devicename>]
[--intnet<1-N> <network name>]
[--nat-network<1-N> <network name>]
[--nicgenericdrv<1-N> <driver>
[--natnet<1-N> <network>|default]
[--natsettings<1-N> [<mtu>],[<socksnd>],
[<sockrcv>],[<tcpsnd>],
[<tcprcv>]]
[--natpf<1-N> [<rulename>],tcp|udp,[<hostip>],
<hostport>,[<guestip>],<guestport>]
[--natpf<1-N> delete <rulename>]
[--nattftpprefix<1-N> <prefix>]
[--nattftpfile<1-N> <file>]
[--nattftpserver<1-N> <ip>]
[--natbindip<1-N> <ip>
[--natdnspassdomain<1-N> on|off]
[--natdnsproxy<1-N> on|off]
[--natdnshostresolver<1-N> on|off]
[--nataliasmode<1-N> default|[log],[proxyonly],
[sameports]]
[--macaddress<1-N> auto|<mac>]
[--mouse ps2|usb|usbtablet|usbmultitouch]
[--keyboard ps2|usb
[--uart<1-N> off|<I/O base> <IRQ>]
[--uartmode<1-N> disconnected|
server <pipe>|
client <pipe>|
tcpserver <port>|
tcpclient <hostname:port>|
file <file>|
<devicename>]
[--lpt<1-N> off|<I/O base> <IRQ>]
[--lptmode<1-N> <devicename>]
[--guestmemoryballoon <balloonsize in MB>]
[--audio none|null|dsound]
[--audiocontroller ac97|hda|sb16]
[--audiocodec stac9700|ad1980|stac9221|sb16]
[--clipboard disabled|hosttoguest|guesttohost|
bidirectional]
[--draganddrop disabled|hosttoguest]
[--vrde on|off]
[--vrdeextpack default|<name>
[--vrdeproperty <name=[value]>]
[--vrdeport <hostport>]
[--vrdeaddress <hostip>]
[--vrdeauthtype null|external|guest]
[--vrdeauthlibrary default|<name>
[--vrdemulticon on|off]
[--vrdereusecon on|off]
[--vrdevideochannel on|off]
[--vrdevideochannelquality <percent>]
[--usb on|off]
[--usbehci on|off]
[--usbxhci on|off]
[--usbrename <oldname> <newname>]
[--snapshotfolder default|<path>]
[--teleporter on|off]
[--teleporterport <port>]
[--teleporteraddress <address|empty>
[--teleporterpassword <password>]
[--teleporterpasswordfile <file>|stdin]
[--tracing-enabled on|off]
[--tracing-config <config-string>]
[--tracing-allow-vm-access on|off]
[--usbcardreader on|off]
[--autostart-enabled on|off]
[--autostart-delay <seconds>]
[--videocap on|off]
[--videocapscreens all|<screen ID> [<screen ID> ...]]
[--videocapfile <filename>]
[--videocapres <width> <height>]
[--videocaprate <rate>]
[--videocapfps <fps>]
[--videocapmaxtime <ms>]
[--videocapmaxsize <MB>]
[--videocapopts <key=value> [,<key=value> ...]]
[--defaultfrontend default|<name>]
VBoxManage.exe: error: --macaddress: RTGetOpt: Command line option needs argument.
The problem we face with the box clink15/pxe is that it only tries to PXE-boot from net0 and if that fails it stops instead of trying the second net1:
The PXE environment seems only do pxe booting from a NAT interface. The net1 is hostonly. That explains why no other interface is triggered. When we integrate the Vagrantfile https://github.com/rear/rear-workshop/blob/master/centos7/Vagrantfile.virtualbox.recover we will be able to PXE boot from the host server
Is fixed on VirtualBox