Exporting/Importing nvram

Discussions about using Mac OS X guests (on Apple hardware) in VirtualBox.
Post Reply
ShoddyGuard
Posts: 2
Joined: 13. Dec 2021, 17:02

Exporting/Importing nvram

Post by ShoddyGuard »

I've recently put together a macOS 11 VM that I need to export from one MacBook and import onto others, if I export the VM OVA/OVF I can import it on the secondary machine but it fails to boot as the NVRAM file is missing (dumps me at the EFI shell), as soon as I copy over the nvram file everything works beautifully.

Is there any way to ensure these get exported (and imported) along with the virtual HDD and OVF file?
I've scoured the vboxmanage user manual but couldn't find anything documented. :(

I'm building this VM in CI/CD pipeline so it's a little bit tedious to have to copy the files over manually each time.

Thanks in advance.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Exporting/Importing nvram

Post by scottgus1 »

I am not entirely sure that the OVF format, or at least Virtualbox's present implementation of it, is compatible with NVRAM.

If you are distributing the VM only to Virtualbox Mac hosts, not to other hypervisors, then you can copy the VM's folder to other hosts, as raw data or zipped/unzipped, then on the new host register the VM's .vbox file with Virtualbox. The VM folder defaults to containing all files the VM uses, including the NVRAM file.
granada29
Volunteer
Posts: 690
Joined: 3. Mar 2015, 07:27
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Linux, macOS, Windows

Re: Exporting/Importing nvram

Post by granada29 »

If you do copy the VM folder to a new machine (which I think is the best way to go about it), after you have added the VM to VirtualBox on the target machine be sure to go to the network settings for the VM and change the interface MAC address(es). If you don't do this, you will have problems if you ever have the VM running simultaneously on your 2 machines.
ShoddyGuard
Posts: 2
Joined: 13. Dec 2021, 17:02

Re: Exporting/Importing nvram

Post by ShoddyGuard »

Thanks all for the responses.

I've managed to cobble together some scripting in the CI/CD process to copy the NVRAM file and package it up with the OVF file.
Unfortunately it doesn't seem like there's any way to change the NVRAM path from absolute to relative in the OVF configuration so instead the CI/CD process munges the XML a bit to set it to a pre-defined path on the receiving system.
Finally we package all that up with a script that copies everything to the right places and it seems to work beautifully.

Massive hack but it does the job until Oracle can make the experience that little bit better.

As an aside if anyone knows of somewhere I can view reference material for the OVF XML that would be helpful, I've managed to find some of the information but not a complete rundown (e.g. info for the BIOS section in particular).
Post Reply