actions / runner-images

GitHub Actions runner images
MIT License
10.08k stars 3.04k forks source link

VirtualBox / Vagrant with private network is failing #4431

Closed chkpnt closed 2 years ago

chkpnt commented 2 years ago

Description

I've a Vagrantfile for VirtualBox with a private_network. This worked before (Oct 16th), but now I'm getting an error Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available).

Virtual environments affected

Image version and build link

Environment: macos-10.15 Version: 20211029.1 Included Software: https://github.com/actions/virtual-environments/blob/macOS-10.15/20211029.1/images/macos/macos-10.15-Readme.md Image Release: https://github.com/actions/virtual-environments/releases/tag/macOS-10.15%2F20211029.1

https://github.com/chkpnt/chkpnt-mailserver/runs/4131323135?check_suite_focus=true

Is it regression?

Yes, this run from Oct. 16th worked well: https://github.com/chkpnt/chkpnt-mailserver/runs/3914480447?check_suite_focus=true

Expected behavior

The VMs should be created as expected.

Actual behavior

Vagrant aborts with the following report:

[...]
 ==> ns: 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", "ipconfig", "vboxnet0", "--ip", "10.0.3.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

Repro steps

  1. Execute the workflow run-tests on branch github-workflow at https://github.com/chkpnt/chkpnt-mailserver/
dibir-magomedsaygitov commented 2 years ago

Hello @chkpnt. Thank you for your report. We will take a look.

dibir-magomedsaygitov commented 2 years ago

Hello @chkpnt. Looks like updated VirtualBox is causing some issues. Could you please try following workaround and check if it helps to resolve the issue:

brew uninstall virtualbox
cd $(brew --repo homebrew/cask)
git checkout 8670a72380c57c606d6582b645421e31dad2eee2
brew install --cask virtualbox
chkpnt commented 2 years ago

Thanks for your time and suggestion! I haven't tried it, but I think this won't work either as VirtualBox needs an activated kernel extension and a reboot.

Idenpendently, I have some new insights: After I've updated Vagrant and VirtualBox locally, Vagrant gave me the decisive notice!

The IP address configured for the host-only network is not within the
allowed ranges. Please update the address used to be within the allowed
ranges and run the command again.

Address: 10.0.3.2
Ranges: 192.168.56.0/21

Valid ranges can be modified in the /etc/vbox/networks.conf file. For
more information including valid format see:

https://www.virtualbox.org/manual/ch06.html#network_hostonly

As I didn't get this with my GitHub workflow, I guess the macos environment isn't using the latest vagrant version.

After I changed the ip addresses of my VMs, the build works again. 😀

See also https://github.com/hashicorp/vagrant/issues/12557

Evico-tr commented 2 years ago

Thanks for your time and suggestion! I haven't tried it, but I think this won't work either as VirtualBox needs an activated kernel extension and a reboot.

Idenpendently, I have some new insights: After I've updated Vagrant and VirtualBox locally, Vagrant gave me the decisive notice!

The IP address configured for the host-only network is not within the
allowed ranges. Please update the address used to be within the allowed
ranges and run the command again.

Address: 10.0.3.2
Ranges: 192.168.56.0/21

Valid ranges can be modified in the /etc/vbox/networks.conf file. For
more information including valid format see:

https://www.virtualbox.org/manual/ch06.html#network_hostonly

As I didn't get this with my GitHub workflow, I guess the macos environment isn't using the latest vagrant version.

After I changed the ip addresses of my VMs, the build works again. 😀

See also hashicorp/vagrant#12557

This worked for me.

If you're a mac user, go do this:

  1. cat ~/Library/VirtualBox/VirtualBox.xml to check the allowed IP addresses. You may see an upper and lower IP address limit.
  2. Edit your Vagrantfile to use an IP address that falls within that range.