Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

VirtualBox 6.1 does not support setting NVRAM parameters with VBoxManage setextradata (efi/0/LUN#0) #135

Closed
rafaelsteil opened this issue Dec 11, 2019 · 26 comments
Assignees
Labels
bug Something isn't working non-script Not likely an issue with the script

Comments

@rafaelsteil
Copy link

rafaelsteil commented Dec 11, 2019

So I was using the script downloaded around 2019-12-11 at 1PM EST (revision 9b00b0240) and it didn't boot at all, with VirtualBox complaining about VERR_PDM_CFG_MISSING_DRIVER_NAME.

Aftrer a lot of trial and error I found out that removing the tag below from macOS.vbox "fixed" the issue:

<ExtraDataItem name="VBoxInternal/Devices/efi/0/LUN#0/Config/Vars/0003/Value" value="bytes:EA=="/>

After this I was able to proceed with the installation.

00:00:01.130272 ********************* End of CFGM dump **********************
00:00:01.130322 HM: HMR3Init: VT-x w/ nested paging and unrestricted guest execution hw support
00:00:01.130322 MM: cbHyperHeap=0x200000 (2097152)
00:00:01.130741 GUI: UIMediumEnumerator: Medium-enumeration finished!
00:00:01.135346 CPUM: fXStateHostMask=0x7; initial: 0x7; host XCR0=0x7
00:00:01.136628 CPUM: Matched host CPU INTEL 0x6/0x9e/0x9 Intel_Core7_KabyLake with CPU DB entry 'Intel Core i7-6700K' (INTEL 0x6/0x5e/0x3 Intel_Core7_Skylake)
00:00:01.136762 CPUM: MXCSR_MASK=0xffff (host: 0xffff)
00:00:01.136819 CPUM: Microcode revision 0x000000B4
00:00:01.136833 CPUM: Changing leaf 13[0]: EBX=0x340 -> 0x340, ECX=0x440 -> 0x340
00:00:01.136844 CPU: CPUID(0).EAX 0x906e9 -> 0x10671 (uMaxIntelFamilyModelStep=0x61701, uCurIntelFamilyModelStep=0x69e09
00:00:01.136852 CPUM: MSR/CPUID reconciliation insert: 0x0000010b IA32_FLUSH_CMD
00:00:01.136874 CPUM: SetGuestCpuIdFeature: Enabled PAE
00:00:01.137217 PGM: Host paging mode: AMD64+PGE+NX
00:00:01.137235 PGM: PGMPool: cMaxPages=4144 (u64MaxPages=4136)
00:00:01.137239 PGM: pgmR3PoolInit: cMaxPages=0x1030 cMaxUsers=0x2060 cMaxPhysExts=0x2000 fCacheEnable=true 
00:00:01.188737 TM: GIP - u32Mode=3 (Invariant) u32UpdateHz=100 u32UpdateIntervalNS=10000000 enmUseTscDelta=2 (Practically Zero) fGetGipCpu=0x15 cCpus=8
00:00:01.188774 TM: GIP - u64CpuHz=2 808 000 002 (0xa75eae02)  SUPGetCpuHzFromGip => 2 808 000 002
00:00:01.188784 TM: GIP - CPU: iCpuSet=0x0 idCpu=0x0 idApic=0x0 iGipCpu=0x4 i64TSCDelta=0 enmState=3 u64CpuHz=2808000000(*) cErrors=0
00:00:01.188790 TM: GIP - CPU: iCpuSet=0x1 idCpu=0x1 idApic=0x1 iGipCpu=0x5 i64TSCDelta=0 enmState=3 u64CpuHz=2808000005(*) cErrors=0
00:00:01.188794 TM: GIP - CPU: iCpuSet=0x2 idCpu=0x2 idApic=0x2 iGipCpu=0x2 i64TSCDelta=0 enmState=3 u64CpuHz=2808000011(*) cErrors=0
00:00:01.188799 TM: GIP - CPU: iCpuSet=0x3 idCpu=0x3 idApic=0x3 iGipCpu=0x3 i64TSCDelta=0 enmState=3 u64CpuHz=2807999936(*) cErrors=0
00:00:01.188803 TM: GIP - CPU: iCpuSet=0x4 idCpu=0x4 idApic=0x4 iGipCpu=0x0 i64TSCDelta=0 enmState=3 u64CpuHz=2808000002(*) cErrors=0
00:00:01.188807 TM: GIP - CPU: iCpuSet=0x5 idCpu=0x5 idApic=0x5 iGipCpu=0x1 i64TSCDelta=0 enmState=3 u64CpuHz=2807975585(*) cErrors=0
00:00:01.188811 TM: GIP - CPU: iCpuSet=0x6 idCpu=0x6 idApic=0x6 iGipCpu=0x7 i64TSCDelta=0 enmState=3 u64CpuHz=2808000000(*) cErrors=0
00:00:01.188815 TM: GIP - CPU: iCpuSet=0x7 idCpu=0x7 idApic=0x7 iGipCpu=0x6 i64TSCDelta=0 enmState=3 u64CpuHz=2808000000(*) cErrors=0
00:00:01.188889 TM: cTSCTicksPerSecond=2 808 000 002 (0xa75eae02) enmTSCMode=3 (Dynamic)
00:00:01.188891 TM: TSCTiedToExecution=false TSCNotTiedToHalt=false
00:00:01.189700 EMR3Init: fIemExecutesAll=false fGuruOnTripleFault=true 
00:00:01.189807 IEM: TargetCpu=CURRENT, Microarch=Intel_Core2_Penryn
00:00:01.189862 GIM: Using provider 'Minimal' (Implementation version: 0)
00:00:01.189870 CPUM: SetGuestCpuIdFeature: Enabled Hypervisor Present bit
00:00:01.189951 AIOMgr: Default manager type is 'Async'
00:00:01.189958 AIOMgr: Default file backend is 'NonBuffered'
00:00:01.190048 BlkCache: Cache successfully initialized. Cache size is 5242880 bytes
00:00:01.190057 BlkCache: Cache commit interval is 10000 ms
00:00:01.190061 BlkCache: Cache commit threshold is 2621440 bytes
00:00:01.199311 SUP: Loaded VBoxDDR0.r0 (/Applications/VirtualBox.app/Contents/MacOS/VBoxDDR0.r0) at 0xXXXXXXXXXXXXXXXX - ModuleInit at XXXXXXXXXXXXXXXX and ModuleTerm at XXXXXXXXXXXXXXXX using the native ring-0 loader
00:00:01.200089 VMSetError: /Users/vbox/tinderbox/mac-rel/src/VBox/Devices/EFI/DevEFI.cpp(2521) int efiConstruct(PPDMDEVINS, int, PCFGMNODE); rc=VERR_PDM_CFG_MISSING_DRIVER_NAME
00:00:01.200089 VMSetError: Can't attach Nvram Storage driver
00:00:01.200089 PDM: Failed to construct 'efi'/0! VERR_PDM_CFG_MISSING_DRIVER_NAME (-2822) - The attached driver configuration is missing the 'Driver' attribute.
00:00:01.204724 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={872da645-4a9b-1727-bee2-5585105b9eed} aComponent={ConsoleWrap} aText={Can't attach Nvram Storage driver (VERR_PDM_CFG_MISSING_DRIVER_NAME)}, preserve=false aResultDetail=-2822
00:00:01.204832 Console: Machine state changed to 'PoweredOff'
00:00:01.211930 Power up failed (vrc=VERR_PDM_CFG_MISSING_DRIVER_NAME, rc=NS_ERROR_FAILURE (0X80004005))
00:00:01.718008 GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen 0 to 800x600
00:00:01.718067 ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={4680b2de-8690-11e9-b83d-5719e53cf1de} aComponent={DisplayWrap} aText={The console is not powered up}, preserve=false aResultDetail=0
00:00:01.718113 GUI: Aborting startup due to power up progress issue detected...
@myspaghetti myspaghetti self-assigned this Dec 11, 2019
@myspaghetti myspaghetti added bug Something isn't working non-script Not likely an issue with the script labels Dec 11, 2019
@myspaghetti
Copy link
Owner

This issue looks like it depends on a specific CPU architecture on Mac hosts. You might want to report this issue to VirtualBox devs.

@myspaghetti myspaghetti changed the title VERR_PDM_CFG_MISSING_DRIVER_NAME (workaround included) VirtualBox 6.1 NVRAM driver fails with VERR_PDM_CFG_MISSING_DRIVER_NAME Dec 12, 2019
@myspaghetti myspaghetti reopened this Dec 12, 2019
@myspaghetti
Copy link
Owner

Issue exists on all VirtualBox 6.1 platforms. This means that NVRAM parameters (LUN#0 devices) have to be unset to run the virtual machine in VirtualBox 6.1, and that iMessage etc will not work.

@myspaghetti
Copy link
Owner

Workaround in version 0.76.8. This means iCloud, iMessage, and other Apple-connected services will not work. NVRAM works on VirtualBox 6.0 and 5.2, you may want to use those versions instead until the bug is resolved.

@myspaghetti
Copy link
Owner

https://www.virtualbox.org/wiki/Changelog-6.1

EFI: Switch to newer firmware code base and add NVRAM support, should improve compatibility with OSes significantly

🤔

@dadons7
Copy link

dadons7 commented Dec 17, 2019

Must Run Virtualbox 6.1 due to Ubuntu 19.10 host and guests. Can't boot Mac guests 10.13, 10.14 or 10.15. Tried all of the above workarounds and still will not boot. Tried installing using your script and it will not boot the second restart when installing. Disabled sip in your script. Any other changes that can be implemented in order to install any recent version of MacOS?

ERROR: Can't attach Nvram Storage driver (VERR_PDM_CFG_MISSING_DRIVER_NAME)

@myspaghetti
Copy link
Owner

@dadons7 What version of the script are you using? Version 0.76.8 (and version 0.77.0 I uploaded right now) works on VirtualBox 6.1 with macOS 10.13 and 10.14 guests, but nothing works with 10.15.2 guests at the moment due to EFI issues. macOS 10.15.0 and 10.15.1 guests work fine, but aren't available from Apple software update servers. Enabling/disabling SIP has no effect with the latest script version on VirtualBox 6.1 because the script skips LUN#0 (NVRAM) settings. If you're trying to use an existing VM, remove all lines with LUN#0 from the .vbox file.

@dadons7
Copy link

dadons7 commented Dec 17, 2019

Was running Version 0.76.8. Will try 0.77.0. Thank you for the LUN#0 suggestion. Will try that with existing VM.

@dadons7
Copy link

dadons7 commented Dec 17, 2019

Used 0.77.0 script. Ran unchanged from Root terminal. The new mac window pops up and terminates. Any ideas?
mohave-install-screen-capture-1

@myspaghetti
Copy link
Owner

Please attach VBox.log. You can try running the script without elevated/root privileges because elevated privileges create permissions issues for VirtualBox.

@dadons7
Copy link

dadons7 commented Dec 17, 2019

log.txt

Was able to import backup VM's and then comment out the LUN#0 as you suggested. These do boot. Did try installing as the logged-in user and not root. Got a little further then errored out...

@myspaghetti
Copy link
Owner

@dadons7 There are no errors in the log, could you specify the last few errors that you received?

@myspaghetti myspaghetti added help wanted Extra attention is needed and removed non-script Not likely an issue with the script labels Dec 20, 2019
@myspaghetti
Copy link
Owner

If anyone knows what's the name of the NVRAM Storage driver VirtualBox is looking for, please post it. Apparently it is set with the variable VBoxInternal/Devices/efi/0/LUN#0/Driver

@myspaghetti
Copy link
Owner

Looks like this isn't a bug, it's a feature. Oracle removed the NVRAM driver from VirtualBox.

@myspaghetti myspaghetti added non-script Not likely an issue with the script and removed help wanted Extra attention is needed labels Dec 20, 2019
@shawnz
Copy link

shawnz commented Dec 20, 2019

What about this "NVRAM file" that's been added in that commit, could the properties be set in the file instead on 6.1?

@myspaghetti
Copy link
Owner

The new NVRAM code is here. I'm not a software developer, if someone wants to take a crack at it by all means.

@myspaghetti myspaghetti pinned this issue Dec 25, 2019
@alexandre-janniaux
Copy link

Hi,

The changeset doesn't include an alternative and cleaned up this code, so the alternative might be already present.

DevEFI driver [1] has a specific list of variable that can be set, so cannot be used instead here. However, it has a NvramFile which can be used to introduce the efi variables [2]. If I'm understanding the installation script correctly, that's why LUN#0 was used at the beginning.

Maybe the way to fix it is to provide this NVRAM file for efivars? I didn't found a way to craft it though.

[1] https://www.virtualbox.org/svn/vbox/trunk/src/VBox/Devices/EFI/DevEFI.cpp
[2] https://wikileaks.org/ciav7p1/cms/page_26968084.html

@myspaghetti
Copy link
Owner

There's hope, I think I found a workaround using the EFI shell's dmpstore command.

@myspaghetti myspaghetti added help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Jan 22, 2020
@myspaghetti myspaghetti changed the title VirtualBox 6.1 NVRAM driver fails with VERR_PDM_CFG_MISSING_DRIVER_NAME VirtualBox 6.1 does not support setting NVRAM parameters with VBoxManage setextradata (efi/0/LUN#0) Jan 23, 2020
@myspaghetti
Copy link
Owner

Implemented binary NVRAM support in version 0.80.0

@myspaghetti myspaghetti unpinned this issue Jan 24, 2020
@alexandre-janniaux
Copy link

Hi, nice work ! Thank you very much !

Do you have details for the migration of an existing VM ?

@myspaghetti
Copy link
Owner

Migrating VBox 6.0 VMs to VBox 6.1

  • Delete all the lines containing "efi/0/LUN#0" from the .vbox configuration file. This is all you need to do for the default case.

iMessage connectivity

  • All those efi/0/LUN#0 lines you just deleted? Those are the NVRAM parameters you need to run iMessage.
  • Edit the script with the parameters you need and run it with macos-guest-virtualbox.sh configure_vm create_nvram_files create_macos_installation_files_viso
  • Attach the VISO to the VM
  • Boot the VM and mount the EFI partition from Terminal:
mkdir EFIROOT
sudo su # this will prompt for the logged-in user's password
mount_msdos /dev/disk0s1 EFIROOT
cp /path/to/VISO/startup.nsh ./EFIROOT/
cp /path/to/VISO/*.bin ./EFIROOT/EFI/NVRAM/
  • Reset the VM and immediately press Esc when the VirtualBox logo appears
  • If the EFI Internal Shell boots, startup.nsh should load automatically and update the NVRMA values. If the boot menu boots, select Boot Manager and then EFI Internal Shell

@bjeanes
Copy link

bjeanes commented Apr 23, 2020

I have followed these steps closely but am not seeing the new serial number or other metadat reflected in system profiler or "about this mac".

The EFI shell output scrolls by too quickly to determine if startup.nsh has any useful output and there doesn't appear to be related output in the log either.

The new values are reflected in the .vbox file but I still see old other details :\

@myspaghetti
Copy link
Owner

Since version 0.80.0 the script's ESP directory structure has changed to comply with OpenCore. See the documentation for up-to-date information. With version 0.90.0 the EFI files are stored in /path/to/VISO/ESP and its subdirectories. They can be copied with the following commands:

mkdir ESP
sudo su # this will prompt for a password
diskutil mount -mountPoint ESP disk0s1
cp -r /Volumes/path/to/VISO/ESP/* ESP/

@bjeanes
Copy link

bjeanes commented Apr 23, 2020

OK, so repeated reboots never yielded updated values. However, a total shutdown of the VM and then re-starting it did reveal the new serial number etc in "About This Mac"

@bjeanes
Copy link

bjeanes commented Apr 24, 2020

Since version 0.80.0 the script's ESP directory structure has changed to comply with OpenCore

Sorry I didn't see this before my second comment was posted somehow. I had the right commands and file locations. It just appears that a cold boot of the VM was necessary for them to take full effect.

@cat903
Copy link

cat903 commented Jan 28, 2021

i am having trouble to understand this line cp -r /Volumes/path/to/VISO/ESP/* ESP/
i am getting error "Too many icloud using this device" when trying to create an apple id

@myspaghetti
Copy link
Owner

  1. On the host, find the .nvram file (it's usually in one of these directories) and delete it
  2. On the host, run the script with the command-line options configure_vm create_nvram_files create_macos_installation_files_viso
  3. Attach the macOS_installation_files.viso to the virtual machine
  4. Boot the virtual machine
  5. On the virtual machine guest macOS, start Terminal
  6. Enter the commands as specified in the documentation, replacing /Volumes/path/to/VISO with the correct path to the VISO, You will recognize the correct path because it's under /Volumes and contains a directory called ESP

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working non-script Not likely an issue with the script
Projects
None yet
Development

No branches or pull requests

7 participants