[HowTo] Install OSX 10.13 in a VM

Discussions about using Mac OS X guests (on Apple hardware) in VirtualBox.

[HowTo] Install OSX 10.13 in a VM

Postby socratis » 25. Nov 2017, 19:38

NOTE: The instructions to create an ISO from any OSX Install application are covered in another article, but I'll include the 10.13 specific instruction over here as well, just to save you some time.


Create an ISO from the "Install macOS High Sierra.app"
  • Download "Install macOS High Sierra.app" from Apple. By default it will be placed in the "/Applications" folder. If the upgrade starts, cancel out.
  • Run the script below as an Administrator, courtesy of https://tylermade.net/2017/10/05/how-to ... installer/
    hdiutil create -o /tmp/10.13.x.cdr -size 5530m -layout SPUD -fs HFS+J
    hdiutil attach /tmp/10.13.x.cdr.dmg -noverify -mountpoint /Volumes/1013_install
    sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/1013_install
    mv /tmp/10.13.x.cdr.dmg /Users/Shared/10.13.x.dmg
    hdiutil detach /Volumes/Install\ macOS\ High\ Sierra
    hdiutil convert /Users/Shared/10.13.x.dmg -format UDTO -o /Users/Shared/10.13.x
    rm /Users/Shared/10.13.x.dmg
    mv /Users/Shared/10.13.x.cdr /Users/Shared/10.13.x.iso
NOTE: The script will not work if you are a Standard user. You have to be an Administrator in order for the "sudo" to work, since Standard users cannot sudo. If you are a Standard user, first do a "su Administrator" before running the script.


Install OSX 10.13
  • Create a new VM with the 10.13 template. Accept the defaults, with the exception of RAM, number of vCPUs and amount of HD. Choose the newly created ISO as your boot medium.

  • Start the VM. It may seem that the installation stalls but don't shut the VM, be patient. Specifically, right before you switch to the graphics with the Apple logo and the progress bar, you'll get stuck at the point where the OSX ≥ 10.12.4 gets stuck:
      IOConsoleUsers: gIOScreenLockState 3, hs 0, bs 0, now 0, sm 0x0
  • After selecting the language, open "Disk Utility". For reasons that only Apple engineers understand, you will *not* see your hard drive! Instead you'll see a bunch of partitions that are of no interest to you whatsoever (see NOTE below). On the top-left side, click on the "View" drop-down and select "Show All Devices". Now you'll see your "VBOX HARDDISK Medium". Select it and choose "Erase" from the toolbar. Leave the defaults (HFS+J/GUID), except maybe the name, choose anything you like. Quit "Disk Utility" once done.

    NOTE: This "glitch" has been fixed with 10.13.2. Now the hard disk shows properly when Disk Utility is opened.

  • Select "Install macOS". Continue and agree to the license. This will start a phase where the actual installer is copied to the Recovery Partition of the hard disk that you selected. That part is rather quick, lasting less than a minutes on an SSD drive. After that your VM reboots. But, you won't re-boot into the OSX installation phase, you'll restart the whole installation again from scratch! Houston, we have a problem!!! If you're observant, you'll notice a quick message coming up, right before the VM boots again from the ISO to restart the whole installation process:
      Boot Failed. Mac OS X
  • Apple (another wise move) has modified the way that it reads/treats the different partitions in the EFI, something that currently VirtualBox cannot handle (as of 5.2.2). But, there is a solution. Once you find yourself up and running, right after the language selection step, shut down the VM and eject the 10.13 ISO that you booted from. Then boot the VM again. You get dropped in the EFI Shell.

  • You need to keep resetting the VM (HostKey+R) and smash the F12 key until you get into the EFI menu screen. If you don't succeed, keep repeating the process until you get to the EFI menu, shown below:
    EFImenu.png
    EFImenu.png (32.71 KiB) Viewed 762 times

  • Select the "Boot Maintenance Manager" option, then "Boot from File". Now, you should have two options. The first one is your normal Boot partition, but this is not yet working, because you haven't yet installed 10.13. This is where the VM should be booting up from normally, and this is why it fails to boot. The second partition however is your Recovery partition. This is the one you should boot from to do the installation. This could be also used to do a re-installation of 10.13, just like on a real system, should the need arise.
    BootFromFile.png
    BootFromFile.png (48.02 KiB) Viewed 762 times

  • Choose the second option, then "<macOS Install Data>", then "Locked Files", then "Boot Files", and finally "boot.efi" and let the games begin!
    boot.efi.png
    boot.efi.png (23.36 KiB) Viewed 762 times

  • That second part of the installation is where 10.13 actually gets installed. This is going to take substantially more time, about 20-30 min with the VM consuming every available CPU cycle. The VM will reboot a couple of times but you should be all set.
PS: There is also another guide, which I discovered after I wrote this guide, that contains some pretty pics in case you get confused by the text-only instructions: http://tobiwashere.de/2017/10/virtualbo ... st-system/
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 12693
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: [HowTo] Install OSX 10.13 in a VM

Postby dbourne » 25. Nov 2017, 22:29

Thank you the information but I'm not getting very far...

I'm logged into the computer as a normal user. In terminal I logged in as the admin. I copied your script and created the .iso file. I copied it to the /Shared folder and from there copied it onto the Desktop of the normal user.

I created a new VM with RAM 8192, HD 50 and CPUs 2. (Also display 128). I attached the .iso file to the first SATA CD and deleted the floppy option in the System:Motherboard pane. This should cause the ISO to be the boot medium?

Blank black screen. 1:06

I'm not seeing
IOConsoleUsers: gIOScreenLockState 3, hs 0, bs 0, now 0, sm 0x0
or VBOX HARDDISK Medium in Disk Utilities
dbourne
 
Posts: 8
Joined: 25. Nov 2017, 06:25
Location: Colorado
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: macOS High Sierra

Re: [HowTo] Install OSX 10.13 in a VM

Postby ChipMcK » 25. Nov 2017, 23:49

VirtualBox_HighSierra-1_25_11_2017_16_38_59.png
Screen image
VirtualBox_HighSierra-1_25_11_2017_16_38_59.png (32.22 KiB) Viewed 746 times

Seems to have hung for me
Attachments
HighSierra-1.vbox.zip
recipe
(1.51 KiB) Downloaded 4 times
HighSierra-1-2017-11-25-16-42-22.log.zip
Log file
(25.95 KiB) Downloaded 2 times
ChipMcK
Volunteer
 
Posts: 962
Joined: 20. May 2009, 02:17
Location: U S of A
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX

Re: [HowTo] Install OSX 10.13 in a VM

Postby socratis » 26. Nov 2017, 01:37

ChipMcK, I imported your .vbox and changed only the VDI and the ISO (obviously). It booted just fine.
  • You have 1595 MB available, not a good sign if you want to dedicate 2048 MB.
  • You have 2 CPUs, both of them assigned to the VM. Which it needs it BTW.
  • I don't know what '/Volumes/Mac_Card-2' is, but if it's USB3, or not your local SSD you have to waaaaaaiiiiiiitttttt...
  • You got stuck during the USB initialization phase. Try to switch to xHCI, aka USB3, although I highly doubt that this is the reason. That was the last step, there is plenty of I/O after that which is what might slow you down.
  • Keep the ActivityMonitor open at the Disk I/O tab to monitor what's going on
Your MacBookAir is not that powerful to begin with. It will at the low end minimum side to run 10.13 standalone, imagine in a VM. Expect delays...
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 12693
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: [HowTo] Install OSX 10.13 in a VM

Postby socratis » 26. Nov 2017, 01:39

dbourne wrote:Blank black screen. 1:06

1:06??? That's it??? That's nothing. Nobody said anything about this thing being fast, on the contrary. Please do as ChipMcK did and attach a VBox.log and the .vbox file, ZIPPED BOTH OF THEM. You can find them by right-clicking in the VM, Show log (VBox.log), and by right-clicking, Show in Finder (.vbox file).
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 12693
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: [HowTo] Install OSX 10.13 in a VM

Postby ChipMcK » 26. Nov 2017, 01:55

what is with i/o errors for disk1s3?

The "createinstallmedia" is normally used to an USB image, not an ISO.
Would it be appropriate to attach an HD/vdi instead of CD?

this meant as a feasibility test
ChipMcK
Volunteer
 
Posts: 962
Joined: 20. May 2009, 02:17
Location: U S of A
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Windows, OSX

Re: [HowTo] Install OSX 10.13 in a VM

Postby dbourne » 26. Nov 2017, 03:26

Sorry about the 1:06. That was the time when I started the VM. I meant to delete that or at least give an idea of how long I let it run. Maybe an hour or more.

Here are the files from a new run of VM. Thanks for your help.
Attachments
Archive.zip
Vbox.log and High Sierra.vbox
(29.4 KiB) Downloaded 8 times
dbourne
 
Posts: 8
Joined: 25. Nov 2017, 06:25
Location: Colorado
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: macOS High Sierra

Re: [HowTo] Install OSX 10.13 in a VM

Postby socratis » 26. Nov 2017, 04:38

@ChipMcK
ChipMcK wrote:what is with i/o errors for disk1s3?
What errors? Where did you see that?

ChipMcK wrote:The "createinstallmedia" is normally used to an USB image, not an ISO.
This method/script overall creates an ISO. Take a look at the steps in the script, mainly the "hdiutil convert ...". That's what's converting your bootable "USB" into an ISO.

ChipMcK wrote:Would it be appropriate to attach an HD/vdi instead of CD?
Nope, because you have a valid ISO image. Plus you do boot up, don't you? That's not your problem, your problem is the performance. Patience my young padawan...;)


@dbourne
Your logs look perfectly normal, up to one point right after your EFI is loaded, at almost the 5" mark (mine was at 7"):
00:00:04.953960 IEM: rdmsr(0x35) -> #GP(0)
Now this doesn't look good. IEM is the "instruction interpreter" part of VirtualBox. There is a chance that with your processor (i7-7700K@4.20GHz) VirtualBox doesn't know how to handle that instruction (rdmsr) at that stage. I don't think there's a lot you can do at this point, except either file a bug report, or wait until Monday till the developers get in.

Except... one last thing to try. With the VM shutdown, open up Terminal and issue the command:
    VBoxManage modifyvm "High Sierra" --cpu-profile "Intel Core i7-6700K"
That will force VirtualBox to present a different, older CPU than the one you have. It's worth a shot, it might work. But don't hold your breath...
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 12693
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: [HowTo] Install OSX 10.13 in a VM

Postby dbourne » 26. Nov 2017, 08:11

@scocratis

I issued the command
VBoxManage modifyvm "High Sierra" --cpu-profile "Intel Core i7-6700K"
and made some progress. I got as far as installing High Sierra from what looked like the Restore disk. (Still nothing has shown up in Disk Utility). I'll attach some screen shots and logs.

Thanks for your help, db

PS, screen shots are too big. I'll try attaching to another message.
Attachments
Archive.zip
logs and High Sierra.vbox
(123.79 KiB) Downloaded 2 times
dbourne
 
Posts: 8
Joined: 25. Nov 2017, 06:25
Location: Colorado
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: macOS High Sierra

Re: [HowTo] Install OSX 10.13 in a VM

Postby dbourne » 26. Nov 2017, 08:14

Looks like they are still too big. I'll try uploading some tomorrow if needed.
dbourne
 
Posts: 8
Joined: 25. Nov 2017, 06:25
Location: Colorado
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: macOS High Sierra

Re: [HowTo] Install OSX 10.13 in a VM

Postby socratis » 26. Nov 2017, 08:29

General rule: resize/shrink them. Actually, if you're on a HiDPI, that's a must. So, shrink them down by at least 50% or 75% if not more.

Why do I need a picture? A picture of what? It seems that you made progress and installed it. Your HD doesn't show immediately, you have to take some steps. Did you read the instructions about the drop-down menu in DiskUtility? Please re-read the steps.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 12693
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: [HowTo] Install OSX 10.13 in a VM

Postby dbourne » 26. Nov 2017, 20:00

@socratis

It worked!!! After multiple tries with different results I didn't recognize a key instruction. Open Disk Utilities means open Disk Utilities in the Guest VM :-)

Thanks, db

===

I've adjusted your instructions slightly to highlight the bits I got lost on. Thanks for all your help. I'll include the adjusted text below. My changes/suggestions in [ ]
---
a) Download "Install macOS High Sierra.app" from Apple. By default it will be placed in the "/Applications" folder.

[when you cancel the install process the .app file won't be deleted]
...

NOTE: The script will not work if you are a Standard user. You have to be an Administrator in order for the "sudo" to work, since Standard users cannot sudo. If you are a Standard user, first do a "su Administrator" before running the script.

[If you login into the admin account the iso file will end on on the admin Desktop. You can move/copy this to the user account via the /Shared folder. Also note the size change in the first command]
...

a) Create a new VM with the 10.13 template. Accept the defaults, with the exception of RAM

[4096+], number of vCPUs

[2+], amount of HD

[40+], display memory

[128]. Choose the newly created ISO as your boot medium.

[Quit VirtualBox and issue the command (iMac 27" 2017)
VBoxManage modifyvm "High Sierra" --cpu-profile "Intel Core i7-6700K"
from the terminal]
...

b) Start the VM. It may seem that the installation stalls but don't shut the VM, be patient. Specifically, right before

[after] you switch to the graphics with the Apple logo and the progress bar, you'll get stuck at the point where the OSX ≥ 10.12.4 gets stuck:

IOConsoleUsers: gIOScreenLockState 3, hs 0, bs 0, now 0, sm 0x0 [I didn't notice this]
dbourne
 
Posts: 8
Joined: 25. Nov 2017, 06:25
Location: Colorado
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: macOS High Sierra

Re: [HowTo] Install OSX 10.13 in a VM

Postby socratis » 26. Nov 2017, 23:22

Glad you got it going! Of course the instructions talk about the VM, once the installation has started. ;)
  1. I added a "Cancel the 10.13 installation". Thanks for the tip, I thought that you didn't want to upgrade the host and you'd cancel out, that's why I didn't include it.
  2. You have a huge, fast system. Not everyone does. You can increase the minimum offered from the template at will. But let's keep the recipe as per the defaults.
  3. The --cpu-profile is a *very* specific instruction that applies *only* to your system. It's a workaround until VirtualBox fixes it. Otherwise it's going to end up like every other outdated blog out there that proposes blindly the --cpuid modification. Not what you want.
  4. You didn't "see" the message because you have a monster of a host and it flew over. The message *is* there, trust me ;)
For me the most important lesson from your setup was the --cpu-profile and the fact that it made it work. Again, glad you're up and running!
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 12693
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: [HowTo] Install OSX 10.13 in a VM

Postby dbourne » 27. Nov 2017, 05:21

@socratis

I had tried a few things with various results so when I started to see the Recovery Partition window in the VM with the choice of Installing the System I went down the rabbit hole.

b) I picked up some of the potential template increases from somewhere in my travels, maybe another thread on this forum even. One that seemed to be stressed was increasing the display memory to the max (128). I tried 4 CPUs but that stressed my machine a 'little' with the fans running hot so I've dropped back to 2 for now ;-)
c) Well done with the --cpu-profile that made it work. Thanks.
d) There is a lot of 'stuff' on the screen...I trust you.

My plan is to use the macOS guest to explore some debugging techniques (from a book - I'm just learning) which seems to require disabling System Integrity Protection. As suggested in the book I plan to do much of this in the VirtualBox guest VM.

Thanks again for you help. Your instructions worked as written (with the --cpu-profile addition for my machine).
dbourne
 
Posts: 8
Joined: 25. Nov 2017, 06:25
Location: Colorado
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: macOS High Sierra


Return to Mac OS X Guests

Who is online

Users browsing this forum: No registered users and 4 guests