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.5k stars 1.12k forks source link

Is it possible to continue automatic setup after suspending to change CPUID settings? #498

Closed jmynes closed 3 years ago

jmynes commented 3 years ago

Here was my process:

  1. Initiate the script without any arguments, from CygWin
  2. VM hangs
  3. Shutdown VM once it hangs
  4. Run these in cygwin: VBoxManage modifyvm macOS --cpu-profile host VBoxManage modifyvm macOS --cpuidremoveall VBoxManage modifyvm macOS --cpu-profile "Intel Core i7-6700K"
  5. Start the VM again, continue through setup by hand

Is there a way to avoid having to do 3 and 4 manually, either by setting flags in the initial script run. or by telling the script at step 5 to start with a certain flag? I checked through the documentation and tried starting it from various stages, but couldn't seem to get it to take over the rest of setup (Language, etc)

I end up here, after selecting a language: image

jmynes commented 3 years ago

It appears after shutting down the VM, the two flags I was looking for were these, in order: ./macos-guest-virtualbox.sh populate_macos_target_disk ./macos-guest-virtualbox.sh prompt_delete_temporary_files

jmynes commented 3 years ago

Just another quick update:

I was running things out of order when I was experimenting to get this working, and thumbing through old issues. I finally found and_all_subsequent_stages which I somehow missed in the documentation the first few times, which I think a few other issue authors might have also been looking for.

Anyway, I accidentally hammered a few files after I got it working again on AMD, and wasn't able to get it working a second time until just now. I think during my first run of experiments, I was trying to inject things while it was building (in order to replicate the behavior of and_all_subsequent_stages, and not have to run every stage manually)

Because my jank version of doing it way was unreliable, I ended up just pasting these 3 commands:

VBoxManage modifyvm macOS --cpu-profile host
VBoxManage modifyvm macOS --cpuidremoveall
VBoxManage modifyvm macOS --cpu-profile "Intel Core i7-6700K"

In between these two sections:

echo -e "\nStarting virtual machine \"${vm_name}\".
This should take a couple of minutes. If booting fails, exit the script by
pressing CTRL-C then see the documentation for information about applying
different CPU profiles in the section ${highlight_color}CPU profiles and CPUID settings${default_color}."
( VBoxManage startvm "${vm_name}" >/dev/null 2>&1 )
echo -e "\nUntil the script completes, please do not manually interact with\nthe virtual machine."

There's probably a better way to handle it, and this obv isn't a fix that'll work for users who don't need to change the CPU profile, but maybe someone else will come across this issue and find it helpful. I'll probably need it again later myself.