DirkRockface

BigSur Install

Jun 11th, 2021 (edited)
3,913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.86 KB | None | 0 0
  1. Probably best to clean out all previous failed attempts... delete the two helper scripts, remove old docker, erase appdata/macinabox folder... start fresh!
  2.  
  3. If you plan to passthru any devices (GPU, USB Card, etc) go to the Tools -> System Devices and put check marks next to the devices you want to passthru... then bind them to VFIO at boot. You may need to also tell your bios to NOT use the GPU you want to passthru so it doesn't get grabbed by UNRAID (even with the bind at VFIO stuff checked with my motherboard i had to tell it to use another video card as the primary so it wouldn't touch my GT710 at Unraid startup)
  4.  
  5. You'll also want to use Legacy mode for your unraid... like spaceinvader one said, you may not need to, you can try both, but he seemed to have better luck in legacy mode. I honestly changed so many variables at once in all my trouble shooting that when i finally got it working, i happened to be in legacy mode... the below steps MAY work great in UEFI mode... but i'm too nervous to change it now and retest :D
  6.  
  7. 1) Use macinabox to install bigsur with the following variables:
  8. Operating System Version: Big Sur
  9. Install Type: Auto Install
  10. Vdisk Size: 100G (or whatever you want... if doing passthru harddrive just pick a small number as you will never actually use the vdisk and you will end up deleting it afterward)
  11. VM Images Location (x2): If you change these, you will need to edit one of the helper scripts. I changed mine to nvme drive and will point out the place that needs to be edited later on in this guide.
  12. Isos Share Location: wherever you want the install files to be stored
  13. Download Method: i used method 1
  14. Run Mode: i did macinabox with virtmanager
  15.  
  16. Show more settings:
  17. i changed custom ovmf location to on the nvme to match where i keep my system folder (this requires editing the xml later to match)
  18. i also changed all the appdata folders to nvme (with the rest of my appdata). NOTE: The first one changed automatically as it pulled from my default appdata location... the other two i had to edit.
  19. RUN
  20.  
  21. 2) Go to your user scripts under settings and change the vmready notify script to match appdata location (if you changed it in step 1 above) then run in background to let you know when ready.
  22.  
  23. 3) Once the vmready script says you are done downloading... open the helper script and edit the four places that you MAY have changed the location of your files. The easiest way to do this is to search for "mnt"
  24. The first will be where the custom ovmf files are. Change that to match the location you set when you installed the docker (ONLY IF YOU CHANGED IT FROM DEFAULT)
  25. The next three will be the location of your appdata folder. Change those three to match the location you set when you intalled the docker (ONLY IF YOU CHANGED IT FROM DEFAULT)
  26. Also make sure at the top the variable FIRSTINSTALL is set to "yes" and NAME is set to "Macinabox BigSur" (we can change this later to whatever we want in the XML)
  27. Save changes to the script
  28.  
  29. 4) RUN the helper script. Your VM should now show up in the VMS tab as "Macinabox BigSur"
  30.  
  31. 5) From here on out... only edit xml by hand... it broke my gpu passthru editing the form and then running the helper script each time. I'm sure it was something i messed up... but custom xml editing worked like a charm for me and eliminated all my problems! JUST DON'T MESS WITH IT IF YOU'VE BEEN HAVING PROBLEMS
  32.  
  33. 6) Click on the vm and select edit. Then change to XML view in the top right
  34.  
  35. XLM: Here are the step by step edits you'll want to do.
  36.  
  37. 1) change name to "BigSur" or whatever else you want.
  38. 2) change memory to whatever you want in both places (For 8GB "8388608")
  39. 3) change vcpu to number of cores if you want
  40. 4) change cputune to for what you set above
  41. If you aren't familiar with what numbers you need to put in the above, it's almost easier to create a dummy Linux vm and set the cores and memory there what you want... then tell it not to start after creation, create the vm, then go look at the XML and copy and paste the CPU core and memory info. Infact, that's a good trick to get ANY of the xml options that you may be unsure of... you never need to install the vm or run it but editing the template and then looking at the vm will help you see how it should be laid out.
  42.  
  43. For the Memory i picked and the CPU layout i did, it looks like this (adjust the cpuset numbers to match your core #s):
  44.  
  45. <memory unit='KiB'>8388608</memory>
  46. <currentMemory unit='KiB'>8388608</currentMemory>
  47. <memoryBacking>
  48. <nosharepages/>
  49. </memoryBacking>
  50. <vcpu placement='static'>4</vcpu>
  51. <cputune>
  52. <vcpupin vcpu='0' cpuset='5'/>
  53. <vcpupin vcpu='1' cpuset='13'/>
  54. <vcpupin vcpu='2' cpuset='7'/>
  55. <vcpupin vcpu='3' cpuset='15'/>
  56. </cputune>
  57.  
  58. 5) change os paths to match custom ovmf location you set in your docker template!!
  59.  
  60. <os>
  61. <type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
  62. <loader readonly='yes' type='pflash'>/mnt/disks/samsung_nvme/system/custom_ovmf/Macinabox_CODE-pure-efi.fd</loader>
  63. <nvram>/mnt/disks/samsung_nvme/system/custom_ovmf/Macinabox_VARS-pure-efi.fd</nvram>
  64. </os>
  65.  
  66. 6) Change CPU mode line to match any changes you made above. For instance, the above setup i gave it 4 threads, which would be 2 cores with 2 threads each:
  67.  
  68. <cpu mode='host-passthrough' check='none' migratable='on'>
  69. <topology sockets='1' dies='1' cores='2' threads='2'/>
  70. </cpu>
  71.  
  72. 7) Under Devices:
  73.  
  74. First two disks should like the the below (make sure you check the paths to match any locations you may have changed):
  75.  
  76. <disk type='file' device='disk'>
  77. <driver name='qemu' type='raw' cache='writeback'/>
  78. <source file='/mnt/user/isos/BigSur-opencore.img'/>
  79. <target dev='hdc' bus='sata'/>
  80. <boot order='1'/>
  81. <address type='drive' controller='0' bus='0' target='0' unit='2'/>
  82. </disk>
  83. <disk type='file' device='disk'>
  84. <driver name='qemu' type='raw' cache='writeback'/>
  85. <source file='/mnt/user/isos/BigSur-install.img'/>
  86. <target dev='hdd' bus='sata'/>
  87. <address type='drive' controller='0' bus='0' target='0' unit='3'/>
  88. </disk>
  89.  
  90. Third disk will be ONE of the two choices below:
  91. If using a vdisk:
  92.  
  93. <disk type='file' device='disk'>
  94. <driver name='qemu' type='raw' cache='writeback'/>
  95. <source file='/mnt/disks/samsung_nvme/vms/Macinabox BigSur/macos_disk.img'/>
  96. <target dev='hde' bus='sata'/>
  97. <address type='drive' controller='0' bus='0' target='0' unit='4'/>
  98. </disk>
  99.  
  100. If you want to install on a passed thru bare metal drive:
  101.  
  102. <disk type='block' device='disk'>
  103. <driver name='qemu' type='raw' cache='writeback'/>
  104. <source dev='/dev/disk/by-id/ata-CHANGE_THIS_TO_MATCH_YOUR_DRIVE_NAME'/>
  105. <target dev='hdc' bus='sata'/>
  106. <address type='drive' controller='0' bus='0' target='0' unit='4'/>
  107. </disk>
  108.  
  109. I didn't touch any more XLM until you get down to the graphics line for GPU passthru:
  110.  
  111. 8) Replace everything in the <graphics> and <video> brackets with the below code remembering to look out for a few things:
  112. 1) replace bus='0x0b' in the two places with whatever bus your video card is on (can be found in tools -> System Devices). In the below example my NVIDIA Corporation GK208B [GeForce GT 710] was located at 0b:00.0 and the associated audio controller was at 0b:00.1 So for me it was bus='0x0b' slot='0x00' function='0x0' for the video card and bus='0x0b' slot='0x00' function='0x1' for audio. Adjust yours to match.
  113.  
  114. 2) add the location of the vbios rom for your card (if needed)
  115.  
  116. 3) in the two address type lines, i choice bus='0x04' as it was the first one the xml hadn't used... should be the same for you with a fresh install but you may need to change that if your setup is wildly different.
  117.  
  118. <hostdev mode='subsystem' type='pci' managed='yes'>
  119. <driver name='vfio'/>
  120. <source>
  121. <address domain='0x0000' bus='0x0b' slot='0x00' function='0x0'/>
  122. </source>
  123. <rom file='/mnt/user/isos/vbios/gpu gt710.rom'/>
  124. <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0' multifunction='on'/>
  125. </hostdev>
  126. <hostdev mode='subsystem' type='pci' managed='yes'>
  127. <driver name='vfio'/>
  128. <source>
  129. <address domain='0x0000' bus='0x0b' slot='0x00' function='0x1'/>
  130. </source>
  131. <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x1'/>
  132. </hostdev>
  133.  
  134. 9) I also added passthru for a mouse and keyboard but then later changed it to an entire USB card so i could dedicate multiple usb ports to this vm. The code for a USB card passthru is below with the following notes:
  135.  
  136. 1) my usb card was at 07:00.0 (Tools -> System Devices) so my line below is <address domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
  137.  
  138. 2) and i assigned it to bus 0x06 as i used 0x05 for something else (bluetooth passthru... a story for another day)
  139.  
  140.  
  141. <hostdev mode='subsystem' type='pci' managed='yes'>
  142. <driver name='vfio'/>
  143. <source>
  144. <address domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
  145. </source>
  146. <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
  147. </hostdev>
  148.  
  149. 3) If passing thru the individual mouse and keyboard, use the the dummy vm trick to check the boxes and then copy and paste the XML code making sure that the two busses in the address type line are not used elsewhere.
  150.  
  151. 10) Save XML and RUN VM!
  152.  
  153. 11) You should now see your monitor pop to life with 4 options (macOS Base System, UEFI Shell, Shutdown, ResetNVRAM). If so, congratulations, 90% of your heartache is behind you and GPU passthru is working. If not... then you either do not have a compatible GPU or unraid grabbed your video card on startup and is holding it hostage. Try installing another video card and or telling your bios to NOT use the video card as the primary... for me this was in the bios settings as telling it which PCI slot was to be used by unraid. You can also switch unraid to boot in legacy mode if in UEFI or the other way around... (see note at top).
  154.  
  155. 12) INSTALL BigSur
  156.  
  157. 1) Select macOS Base System. MacOS recovery will start.
  158. 2) Select Disk Utility
  159. 3) Select the Top QEMU Harddisk Media (should match the size you made in the docker or the size of the baremetal drive if doing passthru)
  160. 4) Select Erase
  161. 5) Give it a Name
  162. 6) Select Erase / Select Done
  163. 7) Quit Disk Utility
  164. 8) Select Reinstall macOS Big Sur
  165. 9) Select Continue / Continue / Agree / Agree
  166. 10) Select the disk you named in step 5.
  167. 11) Select Continue
  168.  
  169. * MacOS will now install and restart a number of times (4 for me). Keep selecting the default disk each time (macOS installer, macOS installer, and then the name of the disk you created twice)
  170.  
  171. 12) setup BigSur (don't sign in with apple id... we will fix this later)
  172.  
  173. 13) Install and setup OpenCore Configurator (the version you install will complain about you using an old version of boot loader... we will fix this later)
  174.  
  175. 1) Download OpenCore Configurator
  176. 2) Drag the OpenCore Configurator to the applications folder.
  177. 3) Open OpenCore Configurator
  178. a) you will get a message saying it can't be opened... click OK
  179. b) go to system preferences -> Security & Privacy -> click the Open Anyway button and select Open
  180. 4) Go to Tools -> Mount EFI
  181. 5) in the bottom half under EFI Partitions, select the top drive (EFI o) and click Mount Partition, put in password, then click open partition
  182. 6) A folder should open. Drag those two things (EFI and NvVARS) to the desktop)
  183. 7) Unmount that partition.
  184. 8) Mount your harddrive (should be the one below the EFI o drive that has the name you gave it in the brackets) and open that partition
  185. 9) Copy two files on your desktop into the window that pops up.
  186. 10) Delete files from desktop
  187.  
  188. 14) UPDATE bootloader: when you open opencore in the future, it will tell you the version of the files you just copied over (that came with the macinabox install process) are old (0.6.4 vs the new 0.7.0).
  189.  
  190. 1) Download new package (0.7.0 at time of this guide) at https://github.com/acidanthera/OpenCorePkg/releases/
  191. 2) unzip and open new opencore files
  192. 3) copy individial files into the folders, don't replace whole folders:
  193. a) copy X64/EFI/BOOT/BOOTx64.efi into EFI/BOOT folder on your mounted drive (replacing old one)
  194. b) copy X64/EFI/OC/Opencore.efi into EFI/OC folder on your mounted drive (replacing old one)
  195. c) copy X64/EFI/OC/Drivers/*.* into EFI/OC/Drivers folder on your mounted drive (replacing old ones)
  196. d) copy X64/EFI/OC/Tools/*.* into EFI/OC/Tools folder on your mounted drive (replacing old ones)
  197. 4) we'll have more steps to finish the update later
  198.  
  199. 15) While here, lets make smbios
  200. 1) Still in your mounted drive, open EFI/OC/Config.plist
  201. 2) Go to Platform info and next to the "check coverage" button, use the selection list to pick what you want your Mac to "be"
  202. 3) I picked Mac Pro Late 2013 for what it's worth... not sure how much that would affect the rest of this install.
  203. 4) Click the check coverage button to make sure that the serial number it generated for you is not on file... that way Apple services will work since you didn't randomly get an existing Mac Owners number.
  204. 5) Save and close open core window
  205.  
  206. 16) SHUT DOWN THE VM.
  207.  
  208. 17) Back on Unraid, edit the VM XML
  209. 1) change the source file= line on the first disk to be what your actual vm disk is and then erase the other two disks... leaving you with this if using a vdisk:
  210.  
  211. <disk type='file' device='disk'>
  212. <driver name='qemu' type='raw' cache='writeback'/>
  213. <source file='/mnt/disks/samsung_nvme/vms/Macinabox BigSur/macos_disk.img'/>
  214. <target dev='hdc' bus='sata'/>
  215. <boot order='1'/>
  216. <address type='drive' controller='0' bus='0' target='0' unit='2'/>
  217. </disk>
  218.  
  219. or this if using a passthru bare metal drive (note the change in the disk type as well):
  220.  
  221. <disk type='block' device='disk'>
  222. <driver name='qemu' type='raw' cache='writeback'/>
  223. <source dev='/dev/disk/by-id/ata-NAME_OF_YOUR_DRIVE_SEE_ABOVE'/>
  224. <target dev='hdc' bus='sata'/>
  225. <boot order='1'/>
  226. <address type='drive' controller='0' bus='0' target='0' unit='2'/>
  227. </disk>
  228.  
  229. 2) Go down to the network section that starts with "interface type='bridge' and change the model type to e1000-82545em
  230. 3) Save changes and start up VM
  231. 4) Note the different look of the bootmenu... select your disk to start up (we will set up auto start to this disk later)
  232.  
  233. 18) FINISH UPDATING bootloader
  234. 1) open OpenCore Configurator (notice it will tell you you have an old version of the bootloader)
  235. 2) mount EFI (Tools -> Mount EFI -> click mount partition next to your drive in bottom section)
  236. 3) open terminal and run: nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version
  237. 4) it should show old version (064)
  238. 5) run: sudo nvram -d 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version
  239. 6) now when you run: nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version it should give an error.
  240. 7) Shutdown VM
  241. 8) Start Up VM
  242. 9) at the boot menu, select reset NVRAM. Machine will restart. This time select your drive.
  243. 10) nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:opencore-version should now show updated version and you'll no longer get error when opening OpenCore Configurator
  244.  
  245.  
  246. 19) Make it so it auto boots to that partition and bypasses that screeen
  247. 1) Open OpenCore Confugrator
  248. 2) mount EFI (Tools -> Mount EFI -> click mount partition next to your drive in bottom section)
  249. 3) open EFI/OC/config.plist
  250. 4) go to misc and uncheck show picker
  251. 5) Save and close OpenCore Configurator
  252.  
  253. 20) now to fix apple login
  254. 1) Download hackintool.
  255. 2) open it (using same steps as you first used to open OpenCore Configurator) and go to System -> Peripherals
  256. 3) Network interfaces should have a en0 but the built in is unchecked
  257. 4) open opencore -> mount EFI -> open config.plist
  258. 5) go to DeviceProperties and select ethernet controller from list of PCI Devices at bottom (if it's not listed already)
  259. 6) click the + on the far bottom right of the right box to add a property to the ethernet controller.
  260. 7) For "key" use: built-in
  261. 8) For "type" use: Data
  262. 9) For "value" use: 01
  263. 10) save and reboot
  264. 11) log in to apple services!
  265. 12) The hackintool technically isn't needed but it provides an easy graphical way to see if that "built-in" check box is checked.
  266.  
  267. 21) cleanup... if you installed on to bare metal, you can go erase the vdisk that was auto created when you first started this process. BUT ONLY DO THIS IF YOU ARE USING passthru harddrive... otherwise you will delete all the hard work you just did.
Add Comment
Please, Sign In to add comment