vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Vagrant 2.3.2 and Virtualbox 7.0.2 - Private Network Interface

Open Yagoor opened this issue 1 year ago • 7 comments

Debug output

https://gist.github.com/Yagoor/66ca6861f57e2c2b09f34c0821bbb0e7

Expected behavior

The machine is started with a private network interface

Actual behavior

The vagrant up fails

Reproduction information

Reproducible with the Vagrantfile and vagrant up

Provider version

Virtual box: Version 7.0.2 r154219 (Qt5.15.2)

Vagrant version

Vagrant 2.3.2

Host operating system

macOS 11.7

Guest operating system

bento/ubuntu-20.04

Steps to reproduce

  1. Create Vagrantfiles as follows
  2. vagrant up

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-20.04"

  config.vm.network "private_network", ip: "192.168.50.4"
end

Yagoor avatar Oct 21 '22 20:10 Yagoor

I have same question,

Vagrant and Virtualbox Version

$ vagrant --version
Vagrant 2.3.2

$ vboxmanage --version
7.0.2r154219

I guess running the following command is caused by a failure

$ VBoxManage hostonlyif create
0%...NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 105 of file VBoxManageHostonly.cpp

Refer to the workaround on the internet, but I can't find the following file or command

  • /Library/StartupItems/VirtualBox/VirtualBox restart
  • /Library/Application\ Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh restart

identifysun avatar Oct 24 '22 02:10 identifysun

I tried reinstalling Vagrant and Virtualbox, but it still doesn't fix

$ brew reinstall virtualbox vagrant

identifysun avatar Oct 24 '22 02:10 identifysun

Same issue here. I downgraded VirtualBox to v6.1 problem is gone. For now, I will keep it this way till 7 gets fixed.

jav-12 avatar Oct 24 '22 07:10 jav-12

Same issue here.

❯ vagrant up debian11
Bringing machine 'debian11' up with 'virtualbox' provider...
==> debian11: Checking if box 'debian/bullseye64' version '11.20220912.1' is up to date...
==> debian11: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 105 of file VBoxManageHostonly.cpp
vagrant --version
Vagrant 2.3.2

vboxmanage --version
7.0.2r154219

f3l1x avatar Oct 24 '22 18:10 f3l1x

Adding my voice to the choir here. Worked fine prior to this VirtualBox 7.0.2 update when I was using VirtualBox 6.1.40. Might just downgrade VirtualBox 6.1.40 if need be.

I am on macOS Ventura 13.0 (22A380) right now and only installed VirtualBox 7.0.2 after upgrading to Ventura in the past day.

vagrant --version
Vagrant 2.3.2
vboxmanage --version
7.0.2r154219

This is the output I get when running vagrant up on my setup:

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

Command: ["startvm", "f74b9e88-7ff6-402f-92fe-f7d195d6d890", "--type", "headless"]

Stderr: VBoxManage: error: Host-only adapters are no longer supported!
VBoxManage: error: For your convenience a host-only network named 'Legacy vboxnet0 Network' has been created with network mask '255.255.255.0' and IP address range '192.168.56.101' - '192.168.56.254'.
VBoxManage: error: To fix this problem, switch to 'Host-only Network' attachment type in the VM settings.
VBoxManage: error:  (VERR_NOT_FOUND)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

JackSzwergold avatar Oct 24 '22 22:10 JackSzwergold

Same problem here on OSX:

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

Command: ["startvm", "ab1ae5b6-0789-4cbe-8421-b43ed2f280c1", "--type", "headless"]

Stderr: VBoxManage: error: Host-only adapters are no longer supported!
VBoxManage: error: For your convenience a host-only network named 'Legacy vboxnet0 Network' has been created with network mask '255.255.255.0' and IP address range '192.168.56.101' - '192.168.56.254'.
VBoxManage: error: To fix this problem, switch to 'Host-only Network' attachment type in the VM settings.
VBoxManage: error:  (VERR_NOT_FOUND)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

splunkenizer avatar Oct 25 '22 12:10 splunkenizer

encountering the same; issue attempted a fix for virtualbox driver 7_0... replaced hostonlyifs with hostonlynets as a host only network works with 7.x base machines. Only thing is not familiar with the code base to know if there needs to be a os specific switch added as I'm not sure if windows users experience the same issue.

MacCracken avatar Oct 25 '22 23:10 MacCracken

Same issue here as well

DeanWronowski avatar Oct 27 '22 10:10 DeanWronowski

Anyone facing this issue do the following:

  1. Downgrade to 6.1.32 https://download.virtualbox.org/virtualbox/6.1.32/VirtualBox-6.1.32-149290-OSX.dmg
  2. On the installer uninstall the current version, chances are you will need to go into settings and allow it to run
  3. Run the following
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
  1. This will trigger a permissions issue, go into settings and allow Oracle to run, then reboot, it should ask you to
  2. On startup run 3) again and then vagrant up this works for me. 3) will need to be ran on every boot

alexpotter avatar Oct 27 '22 11:10 alexpotter

Anyone facing this issue do the following:

  1. Downgrade to 6.1.32 https://download.virtualbox.org/virtualbox/6.1.32/VirtualBox-6.1.32-149290-OSX.dmg
  2. On the installer uninstall the current version, chances are you will need to go into settings and allow it to run
  3. Run the following

Thanks, works for me!

mgascoyne avatar Oct 27 '22 11:10 mgascoyne

While to VirtualBox 6.1 — unsure why @alexpotter is recommending 6.1.32 when 6.1.40 is the latest in the 6.1.x releases — will “solve” the issue but that his not really a solution: Changes need to be made in Vagrant to handle VirtualBox 7.0.2.

JackSzwergold avatar Oct 27 '22 13:10 JackSzwergold

That version did not work for me @JackSzwergold 🤷‍♂️ not that a minor bump should be of significant difference to anyone so does not matter anyway

alexpotter avatar Oct 27 '22 13:10 alexpotter

It looks like the kernel extensions past version 6.1.32 are not trusted by Apple and cannot be loaded anymore. I found this Stackoverflow thread to the problem:

https://stackoverflow.com/questions/74211930/vagrant-up-fails-on-macos-13-x-ventura-with-latest-2-3-2-vagrant-release

mgascoyne avatar Oct 27 '22 14:10 mgascoyne

Same issue on this end:

Guest operating system: bento/ubuntu-20.04 Host Machine: Macbook pro - M1 Max Host operating system: macOS 12.3 Provider version: Virtual box: Version 7.0.2 r154219 (Qt5.15.2) Vagrant version: Vagrant 2.3.2

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

Command: ["hostonlyif", "create"]

Stderr: 0%...NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 105 of file VBoxManageHostonly.cpp

EnSabanNur avatar Oct 27 '22 19:10 EnSabanNur

VirtualBox 7.0.2 (released October 20 2022)
[...]
macOS hosts: Re-introduced support for internal networking, this is considered a bit experimental still

[...]

VirtualBox 7.0.0 (released October 10 2022)
[...]
macOS host: Dropped all kernel extensions. VirtualBox relies fully on the hypervisor and vmnet frameworks provided by Apple now. At the moment the implementation lacks "Internal Networking" functionality. This will be provided at a later date.
  • https://www.virtualbox.org/wiki/Changelog-7.0

trevor avatar Oct 27 '22 22:10 trevor

Compiling what I have found. I have not tried this. Think I'll wait for the official solution, but have heard the following works.

  1. Disable SIP.
  2. Then run the
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;

I updated VirtualBox and Vagrant when I updated to macOS Ventura.

$ sw_vers
ProductName:		macOS
ProductVersion:		13.0
BuildVersion:		22A380

$ vboxmanage --version
7.0.2r154219

$ vagrant --version
Vagrant 2.3.2

csherrell avatar Oct 28 '22 22:10 csherrell

same problem here.

mintplo avatar Oct 31 '22 07:10 mintplo

Any news on this?

mmihalev avatar Oct 31 '22 12:10 mmihalev

same problem here.

walznet avatar Oct 31 '22 14:10 walznet

same problem

skabrits avatar Nov 01 '22 15:11 skabrits

Same; Ventura 13.0 | Vagrant 2.3.2 | Virtual Box 7.0.2.

barryhughes avatar Nov 01 '22 20:11 barryhughes

Same problem here, with the same versions as mentioned above.

Phally avatar Nov 02 '22 15:11 Phally

I found some solution. ss

Few steps: (Apple stackexchange) 1) sudo su csrutil clear 2) Unistall from official unistaller and re-install Vbox 3) If prompted, go to System Preferences - Privacy - General and accept the extensions 4) Reebot 5) Add at Vagrant file virtualbox__intnet: true to your config.vm.network -> Discuss hashicorp 6) VirtualBoxVM --startvm vagrant vagrant up

This works for me.

JakubSzczerba avatar Nov 03 '22 08:11 JakubSzczerba

I found some solution. ss

Few steps: (https://apple.stackexchange.com/questions/408154/macos-big-sur-virtualbox-error-the-virtual-machine-has-terminated-unexpectedly-d) 1) sudo su csrutil clear 2) Unistall from official unistaller andre-install Vbox 3) If prompted, go to System Preferences - Privacy - General and accept the extensions 4) Reebot 5) Add at Vagrant file virtualbox__intnet: true to your config.vm.network -> https://discuss.hashicorp.com/t/vagrant-up-fails-on-macos-13-x-ventura-with-latest-2-3-2-vagrant-release/46043/13 6) VirtualBoxVM --startvm vagrant vagrant up

This works for me.

image

Thanks @JakubSzczerba , It 's Ok for me.

identifysun avatar Nov 03 '22 09:11 identifysun

Duplicate of #12959

chrisroberts avatar Nov 03 '22 18:11 chrisroberts

Anyone facing this issue do the following:

  1. Downgrade to 6.1.32 https://download.virtualbox.org/virtualbox/6.1.32/VirtualBox-6.1.32-149290-OSX.dmg
  2. On the installer uninstall the current version, chances are you will need to go into settings and allow it to run
  3. Run the following
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
  1. This will trigger a permissions issue, go into settings and allow Oracle to run, then reboot, it should ask you to
  2. On startup run 3) again and then vagrant up this works for me. 3) will need to be ran on every boot

This workaround is working for me with version 6.1.40. I wasn't getting the the notice to grant the permissions on version 6.1.32. Not sure if it's mandatory but I rebooted between uninstalling the old version and installing the new version as well.

It's a bit of a hassle having to run the kexload commands every time after boot but at least this works for now.

Jos-de-Boss avatar Nov 04 '22 08:11 Jos-de-Boss

same problem Can't we solve this problem without downgrading VM?

Gekko0114 avatar Nov 04 '22 14:11 Gekko0114

@Gekko0114 Please look at this comment at the linked/related issue:

“Currently the only workaround is to not configure a private network for your guest. Work is currently in progress to handle the new way host only networks are configured and used in macOS.”

The reality is the kernel extension hacks are a complete hack. There is no need for the kernel extensions for host only access in macOS 13 (Ventura) and the solution is to wait for Vagrant and possibly VirtualBox to be patched. Nothing more and nothing less.

JackSzwergold avatar Nov 05 '22 05:11 JackSzwergold

I am just using innet (inter network) as a workaround for now.

  config.vm.define "n2" do |n2|
      n2.vm.hostname = "n2"
      n2.vm.network "private_network", ip: "192.168.56.11",
        virtualbox__intnet: true
  end

d4n3sh avatar Nov 05 '22 14:11 d4n3sh

When I use virtualbox__intnet: true, my vagrant machine is up and running. I can connect via SSH, but I have no public IP address, and I cannot ping or connect to any port directly via IP. So, my machine is useless :/

Any idea?

Kolesar avatar Nov 07 '22 14:11 Kolesar