From b983c3e183fd22d6f5b2202c0a179410dbcef80e Mon Sep 17 00:00:00 2001 From: Henrik Heimbuerger Date: Sun, 12 Jul 2015 13:00:21 +0200 Subject: [PATCH 1/3] Removed --synthcpu flag on vboxmanage modifyvm because it no longer exists in VirtualBox 5. --- virtualbox/machine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualbox/machine.go b/virtualbox/machine.go index dca7ef6..9fe276d 100644 --- a/virtualbox/machine.go +++ b/virtualbox/machine.go @@ -658,7 +658,7 @@ func (m *Machine) Modify() error { "--cpuhotplug", m.Flag.Get(F_cpuhotplug), "--pae", m.Flag.Get(F_pae), "--longmode", m.Flag.Get(F_longmode), - "--synthcpu", m.Flag.Get(F_synthcpu), + //"--synthcpu", m.Flag.Get(F_synthcpu), "--hpet", m.Flag.Get(F_hpet), "--hwvirtex", m.Flag.Get(F_hwvirtex), "--triplefaultreset", m.Flag.Get(F_triplefaultreset), From 1354fff2e241c0b1582d5f9a7af692a5aec76327 Mon Sep 17 00:00:00 2001 From: Henrik Heimbuerger Date: Sun, 12 Jul 2015 13:03:10 +0200 Subject: [PATCH 2/3] Changed the NAT port forwarding commands from controlvm to modifyvm, because the former is only valid against a running VM. I'm not sure how/whether this ever worked, maybe controlvm was valid on stopped VMs in VirtualBox 4.x or something else happened to start the VM in between (which I doubt, because then "boot2docker init" vs. "boot2docker up" doesn't make sense anymore). --- virtualbox/machine.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtualbox/machine.go b/virtualbox/machine.go index 9fe276d..918283d 100644 --- a/virtualbox/machine.go +++ b/virtualbox/machine.go @@ -690,13 +690,13 @@ func (m *Machine) Modify() error { // AddNATPF adds a NAT port forarding rule to the n-th NIC with the given name. func (m *Machine) AddNATPF(n int, name string, rule driver.PFRule) error { - return vbm("controlvm", m.Name, fmt.Sprintf("natpf%d", n), + return vbm("modifyvm", m.Name, fmt.Sprintf("--natpf%d", n), fmt.Sprintf("%s,%s", name, rule.Format())) } // DelNATPF deletes the NAT port forwarding rule with the given name from the n-th NIC. func (m *Machine) DelNATPF(n int, name string) error { - return vbm("controlvm", m.Name, fmt.Sprintf("natpf%d", n), "delete", name) + return vbm("modifyvm", m.Name, fmt.Sprintf("--natpf%d", n), "delete", name) } // SetNIC set the n-th NIC. From 29c9bff4014fd9b07f04039ac687d8857c41fbe1 Mon Sep 17 00:00:00 2001 From: Henrik Heimbuerger Date: Sun, 12 Jul 2015 13:05:29 +0200 Subject: [PATCH 3/3] Added print statements to the host-only network finder, because we need to have created exactly this host-only network with the VBox GUI before running init. --- virtualbox/vbm.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/virtualbox/vbm.go b/virtualbox/vbm.go index ed166dd..3a0ed9e 100644 --- a/virtualbox/vbm.go +++ b/virtualbox/vbm.go @@ -3,6 +3,7 @@ package virtualbox import ( "bytes" "errors" + "fmt" "io" "log" "os" @@ -99,6 +100,11 @@ func getHostOnlyNetworkInterface(mc *driver.MachineConfig) (string, error) { for _, n := range nets { if dhcp, ok := dhcps[n.NetworkName]; ok { + fmt.Printf("IPv4 / DHCP IP: %s == %s\n", dhcp.IPv4.IP, mc.DHCPIP) + fmt.Printf("IPv4 netmask: %s == %s\n", dhcp.IPv4.Mask, mc.NetMask) + fmt.Printf("DHCP lower bound: %s == %s\n", dhcp.LowerIP, mc.LowerIP) + fmt.Printf("DHCP upper bound: %s == %s\n", dhcp.UpperIP, mc.UpperIP) + fmt.Printf("DHCP enabled: %s == %s\n", dhcp.Enabled, mc.DHCPEnabled) if dhcp.IPv4.IP.Equal(mc.DHCPIP) && dhcp.IPv4.Mask.String() == mc.NetMask.String() && dhcp.LowerIP.Equal(mc.LowerIP) &&