myspaghetti / macos-virtualbox

Push-button installer of macOS Catalina, Mojave, and High Sierra guests in Virtualbox on x86 CPUs for Windows, Linux, and macOS
GNU General Public License v2.0
13.46k stars 1.11k forks source link

Extra Data Parameters #597

Closed enigma0456 closed 2 years ago

enigma0456 commented 2 years ago

Just used your script to fix my friend's 2011 iMac with i7 and 16gb ram. Now running Xubuntu and Virtualbox with Monterey - he is very excited. Had a problem with the video which lead me to look at the parameters. Adjusted the graphics resolution to match the IMacs and now it works flawlessly. So ... Comparing stock creations of MacOS guests, none of these extra parameters are present. The only difference I can see is the OSType which seems to be the release number and processor ie: MacOS1013_64 for High Sierra. I see that you set that parameter in your script. On the VMs that I upgraded from Catalina to Monterey I had gone back and set the OS type to just MacOS_64 with the gui and noticed no difference. A number of the other values that you set do show up in the "About this Mac" screen and I assume they account for why your script works so flawlessly. Some of them seem very specific like DmiBardProduct and others seem rather whimsical like DmiSystemUuid (CAFECAFE-CAFE etc) which I take must be a series of hex digits separated by hyphens in specific groups. I even changed a couple of them slightly to see if they had any effect and they didn't seem to (I stayed with hex numbering of course). So ... My question - I would like to understand the significance of these extra data items that you add into the virtual machine. Where could I find that information? Clearly a couple of them are immutable like DmiSystemVendor but others look like they might be adjustable and if they are what would be the effect? Secondly - reading the script, it seems to me (although I'm not clear yet) that you create a recovery partition to "restore" the OS to the new vm disk but when it is done there is no longer a recovery disk. I ask because when we ran the script for the iMac my friend mistakenly interacted with the OS during installation and we had to start over. We found left behind what seemed to be a recovery disk image. Sadly we were pressed for time and I didn't really get to study it so .. My question - is there a recovery disk created during the installation and could it be saved and attached to the VM just like the recovery disk is on a physical Mac? There is a recovery vmdk for Mojave floating around on the net and I have attached it and used it to get to recovery on a VM (I restored a physical Lion from a machine to a vdi in a virtual machine and it worked)

Sorry to be a nuisance but your work has mad it possible to experiment with all kinds of interesting things with MacOS and VB. Any info you care to provide would be appreciated.

myspaghetti commented 2 years ago

Sure, since I'm not working much on the script these days I don't mind explaning the inner workings.

DmiSystemFamily="MacBook Pro"          # Model Name
DmiSystemProduct="MacBookPro11,2"      # Model Identifier
DmiBIOSVersion="string:MBP7.89"        # Boot ROM Version
DmiSystemSerial="NO_DEVICE_SN"         # Serial Number (system)
DmiSystemUuid="CAFECAFE-CAFE-CAFE-CAFE-DECAFFDECAFF" # Hardware UUID
ROM='%aa*%bbg%cc%dd'                   # ROM identifier
MLB="NO_LOGIC_BOARD_SN"                # MLB SN stored in NVRAM
DmiBoardSerial="${MLB}"                # MLB SN stored in EFI
DmiBoardProduct="Mac-3CBD00234E554E41" # Product (board) identifier
SystemUUID="aabbccddeeff00112233445566778899" # System UUID

The hardware UUID. ROM, MLB, and system UUID are unique identifiers that are used by iMessage and other iCloud-connected services to identify the device. The model name, identifier, boot ROM version, and board identifier are non-unique parameters about the hardware, that are used to identify the device.

you create a recovery partition to "restore" the OS to the new vm disk

Close. macOS comes with a recovery image. VirtualBox boots that recovery image, and then the script runs a few commands in Terminal that create a macOS installer on a separate virtual disk image. Then the installer boots and installs onto yet another separate virtual disk image, the target disk.

The script was created when I wanted to automate the process of creating a macOS bootable installer on a USB drive so I could fix non-booting Macs when a physical Mac was not available. I just reckoned more people would be interested in a virtual machine with macOS than a virtual machine with JUST a macOS installer, so I added the final steps.

enigma0456 commented 2 years ago

More questions on Extra Data Parameters if you have a moment. The only Mac I have is a MacBook 2,1 Mid 2007 that I have upgraded to Lion. Using an external drive, I cloned the hard drive. Then I plugged it into my host machine and did a P2V to get a working VM of Lion. I set the VM Version to Mac OS 10.7 Lion and it runs perfectly. Looking at the Extra Parameters, VB saw it as an iMac11,3. There are significantly less parameters than in the machines generated by your script. Cloning that machine I used a usb installer and installed Monterey over it. I also changed the VM Version to the generic Mac OSX 64 bit. VB sees it as an iMac11,3 (2010-2011) and yet Monterey runs fine, gets updates, etc. I would think it would be too old to get anything. Thoughts? Also it has a CPU profile parameter that shows a Xeon processor which my HP laptop surely does not have. Here are the parameters apparently inserted by VirtualBox and not me. I'd be curious to hear any comments you might make. I'm wondering what changing them might do. Presently, the VM runs very well and is quite responsive.

    <ExtraData>
      <ExtraDataItem name="GUI/Fullscreen" value="true"/>
      <ExtraDataItem name="GUI/LastCloseAction" value="Shutdown"/>
      <ExtraDataItem name="GUI/LastNormalWindowPosition" value="0,86,640,480,max"/>
      <ExtraDataItem name="GUI/LastScaleWindowPosition" value="0,86,1600,814,max"/>
      <ExtraDataItem name="VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" value="Iloveapple"/>
      <ExtraDataItem name="VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" value="iMac11,3"/>
      <ExtraDataItem name="VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" value="1.0"/>
      <ExtraDataItem name="VBoxInternal/Devices/smc/0/Config/DeviceKey" value="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"/>
      <ExtraDataItem name="VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" value="1"/>
      <ExtraDataItem name="VBoxInternal2/EfiGraphicsResolution" value="1600x900"/>
    </ExtraData>
    <Hardware>
      <CPU CpuProfile="Intel Xeon X5482 3.20GHz">
        <PAE enabled="true"/>
        <LongMode enabled="true"/>
        <HardwareVirtExLargePages enabled="false"/>
      </CPU>
myspaghetti commented 2 years ago

Some of these parameters were created by a different script or tutorial.