Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

E_ACCESSDENIED when creating a host-only interface on virtualbox via vagrant [closed]

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
like image 307
knahdiya Avatar asked Oct 26 '21 18:10

knahdiya


People also ask

Can I disable VirtualBox host-only network?

Show activity on this post. Open "Network connections" right click on the adapter you want delete and select properties. Under Networking -> click on configure. go to Driver tab on the popup and click on uninstall. This will remove it from the list.

Why do I have VirtualBox host-only network?

Host-only Networking Description With host-only networking, virtual box doesn't try to use a physical network adapter on the host. Instead in VirtualBox you can create one or more (up to 8) virtual adapters for connections between the host and virtual machines created in VirtualBox on the host.


Video Answer


3 Answers

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.

like image 72
Michael Ambrose Avatar answered Oct 18 '22 03:10

Michael Ambrose


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.

like image 37
jaqque Avatar answered Oct 18 '22 04:10

jaqque


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
like image 2
OpControl Avatar answered Oct 18 '22 04:10

OpControl