hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.02k stars 4.42k forks source link

`vagrant package` doesn't include .nvram file (macOS VM not bootable) #12509

Open frankosterfeld opened 2 years ago

frankosterfeld commented 2 years ago

A manually created macOS Big sur Virtualbox contains a .nvram file, which is required to boot the VM. vagrant package does not include the .nvram file in the box, thus a VM created this way isn't functional. One can work around this using the --include option to bundle the .nvram file and then copy it manually in the Vagrant file (using a trigger after the VirtualBox import), but that's cumbersome. It would be nice if this would work automatically.

Vagrant version

2.2.18

Host operating system

macOS Big Sur 11.5.2

Guest operating system

macOS Big Sur 11.5.2 (also affects e.g. macOS Catalina 10.15.7)

Debug output

https://gist.github.com/frankosterfeld/ddd544d95a76ce4aff3d45023ad288e8

Expected behavior

"vagrant package" automatically includes the .nvram file from the existing VirtualBox VM. "vagrant up" copies it using the expected name (${vmname}.nvram).

Actual behavior

The .nvram isn't included in the box and the VM doesn't boot.

What actually happened?

.nvram file is ignored and not included in the box.

Steps to reproduce

  1. Manually create a VirtualBox macOS VM (might also affect other VMs using EFI/nvram) (assuming name "BigSurTest")
  2. Verify that the virtualbox folder contains a .nvram file
  3. vagrant package --base BigSurTest
  4. tar xvf package.box. Verify that there's no .nvram file included.
greg-compass commented 2 years ago

@frankosterfeld - can you give some info on the post import hook? I'm running into this same problem myself and would love to work around it.