22

When attempting to run vagrant up after upgrading to VirtualBox 6.1.28, the following error message is received

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "ipconfig", "vboxnet0", "--ip", "192.168.33.1", "--netmask", "255.255.255.0"]

Stderr: VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp
4
  • 4
    hey, this is the exact duplicate of stackoverflow.com/questions/69722254/… - please don't post twice the same question Oct 26, 2021 at 18:55
  • I'm not using ubuntu so that solution doesn't work for me. Thanks for trying
    – knahdiya
    Oct 26, 2021 at 19:55
  • Why would a downgrade not work on your system? How did you try to run vagrant? Has it worked in the past? Did you try to do it as an administrator as the error might indicate insufficient permission to change network settings?
    – Seth
    Oct 27, 2021 at 16:56
  • This question is marked as closed, but it should really be marked as a duplicate of stackoverflow.com/questions/69722254/…
    – Glenjamin
    Nov 4, 2021 at 17:55

3 Answers 3

50

Follow-up: This is due to a change that Virtual Box recently introduced where the available IP range for hostonly networks is limited unless you manually override it in a config file in VirtualBox.

Vagrant just merged a change that looks for this to be able to provide a better error message when you try to use an IP outside the configured allowed range: github.com/hashicorp/vagrant/pull/12564

The proper fix is to update /etc/vbox/networks.conf per https://www.virtualbox.org/manual/ch06.html#network_hostonly

Original: I'm having the same issue on Arch on VirtualBox 6.1.28. It does not seem to be related to Vagrant.

Weirdly enough I can change the IPv4 address of the adapter (either via VBoxManage or the GUI) but only between 192.168.56.1 and 192.168.63.254. anything outside this range fails.

8
  • Good workaround, thanks. I was using 192.168.22.101 as my box's private_network IP, and it was producing that error. It worked when I changed it to 192.168.62.101.
    – Jethro Cao
    Nov 3, 2021 at 18:56
  • 4
    @JethroCao This is actually due to a change that Virtual Box recently introduced where the available IP range for hostonly networks is limited unless you manually override it in a config file in VirtualBox. Vagrant just merged a change that looks for this to be able to give a better error message when you try to use an IP outside the configured allowed range: github.com/hashicorp/vagrant/pull/12564 The proper fix is to update /etc/vbox/networks.conf per virtualbox.org/manual/ch06.html#network_hostonly Nov 4, 2021 at 16:26
  • @MichaelAmbrose this comment appears to be the correct answer. Would you mind re-posting it as an answer to the question so it can be up-voted and accepted?
    – Glenjamin
    Nov 4, 2021 at 17:52
  • @Glenjamin good point, I just updated my original answer Nov 4, 2021 at 20:34
  • 1
    I came across this answer whilst looking to get Docker running on a Mac, and thought it would be worth pointing out that this answer is not just for Vagrant--modifying the networks.conf file worked perfectly. Mar 24, 2022 at 23:59
6

I see this exact error on macOS Monterey (12.0.1), Vagrant (2.2.18), VirtualBox (6.1.28 r147628). I had to manually enable the kernel extensions

sudo kextload -b org.virtualbox.kext.VBoxDrv
sudo kextload -b org.virtualbox.kext.VBoxNetFlt
sudo kextload -b org.virtualbox.kext.VBoxNetAdp
sudo kextload -b org.virtualbox.kext.VBoxUSB

from here

Bringing up the machine in the GUI, stoping it, then running vagrant up worked, with setting gui to true.

2
  • Did you run these commands within vagrant ssh or on the host?
    – Simeon
    Sep 4, 2022 at 14:05
  • These are on the host.
    – jaqque
    Sep 5, 2022 at 20:52
2

I ran into this issue on CentOS 7 with vagrant version 2.2.13 and VirtualBox version 6.1.28. I downgraded VirtualBox to 6.1.26 and that seemed to fix the issue:

$ sudo yum downgrade VirtualBox-6.1.x86_64

Not the answer you're looking for? Browse other questions tagged or ask your own question.