nix-community / nixbox

NixOS Vagrant boxes [maintainer=@ifurther]
https://app.vagrantup.com/nixbox/
MIT License
314 stars 101 forks source link

Support for Virtualbox 7.0+ #87

Closed pmaterer closed 2 months ago

pmaterer commented 1 year ago

I was trying to build virtualbox-iso.virtualbox on macOS 12.4 using Virtualbox 7.0.4, and I noticed the HTTP server Packer creates was not reachable. After some research I found the issue here. With VBox 7.0+, the config option --nat-localhostreachable was introduced and is set to off by default.

So to fix the issue something like this will need to be done:

source "virtualbox-iso" "virtualbox" {
...
  vboxmanage           = [["modifyvm", ..., "--nat-localhostreachable1", "on"]]
...
}

With that in place the build works on Virtualbox 7.0+. However I haven't tested if this breaks builds with older versions of VBox.

pdietl commented 10 months ago

Hello @pmaterer, I submitted a fix for this to the virtual box plugin directly: https://github.com/hashicorp/packer-plugin-virtualbox/pull/122

ifurther commented 10 months ago

It's not working old version

pdietl commented 10 months ago

Yeah @ifurther the PR I mentioned above should work on old and new versions.