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

How to continue the script after changing --cpu-profile on AMD Ryzen 7 machine #353

Closed Harry089 closed 3 years ago

Harry089 commented 3 years ago

Please see below output. Script tries to find GUI but since macOS is not booting it fails.

So to change cpu-profile, I have to close VirtualBox and run the command as instructed in the documentation. But it does not say what to do after that. After I change the cpu-profile OS is booting up as expected but I cannot find a way to continue the script.

In the VM, it asks to select language and then get "macOS Utilities" window. Not sure how to proceed after this.

image

stage: populate_bootable_installer_virtual_disk

Creating VirtualBox 6 virtual ISO containing macOS Terminal script
for partitioning and populating the bootable installer virtual disk.

Starting virtual machine "macOS".
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 CPU profiles and CPUID settings.

Until the script completes, please do not manually interact with
the virtual machine.

Attempting automated recognition of virtual machine graphical user interface.
Please waitVBoxManage.exe: error: Machine 'macOS' is not currently running
Please waitVBoxManage.exe: error: An unexpected process (PID=0x000003E8) has tried to lock the machine 'macOS', while only the process started by LaunchVMProcess (PID=0x00002A3C) is allowed
VBoxManage.exe: error: Details: code E_ACCESSDENIED (0x80070005), component MachineWrap, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Shared)" at line 388 of file VBoxManageControlVM.cpp
Please wait..
Please wait.

asus@LAPTOP-C7O5N6N2 ~
nstaller_virtual_disksus/Downloads/macos-guest-virtualbox.sh populate_bootable_in
Can't find VBoxManage in PATH variable,
checking C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
Found VBoxManage

Catalina selected to be downloaded and installed

stage: populate_bootable_installer_virtual_disk
Could not configure virtual machine storage controller. Exiting.

asus@LAPTOP-C7O5N6N2 ~
nstaller_virtual_disksus/Downloads/macos-guest-virtualbox.sh populate_bootable_in
Can't find VBoxManage in PATH variable,
checking C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
Found VBoxManage

Catalina selected to be downloaded and installed

stage: populate_bootable_installer_virtual_disk
Could not configure virtual machine storage controller. Exiting.
inevity commented 3 years ago

first bash macos-guest-virtualbox.sh then ctr+c scrpit and virtualbox, then set cpu_profile then bash macos-guest-virtualbox.sh populate_bootable_installer_virtual_disk bash macos-guest-virtualbox.sh create_target_virtual_disk bash macos-guest-virtualbox.sh populate_macos_target_disk

myspaghetti commented 3 years ago

More generally, the order of the stages is specified near the top of ./macos-guest-virtualbox documentation so you can see which stages to perform after you resume the interrupted stage.

The installation is divided into stages. Stage titles may be given as command-
line arguments for the script. When the script is executed with no command-line
arguments, each of the stages is performed in succession in the order listed:

    check_shell
    check_gnu_coreutils_prefix
    set_variables
    welcome
    check_dependencies
    prompt_delete_existing_vm
    create_vm
    check_default_virtual_machine
    prepare_macos_installation_files
    create_nvram_files
    create_macos_installation_files_viso
    configure_vm
    populate_basesystem_virtual_disk
    create_bootable_installer_virtual_disk
    populate_bootable_installer_virtual_disk
    create_target_virtual_disk
    populate_macos_target_disk
    prompt_delete_temporary_files

Since the script failed at populate_bootable_installer_virtual_disk, you should resume it with ./macos-guest-virtualbox.sh populate_bootable_installer_virtual_disk create_target_virtual_disk populate_macos_target_disk prompt_delete_temporary_files

Masamune3210 commented 3 years ago

You could also just change it by running the command to change the cpu profile from another terminal sometime between when the VM is created and when booting is attempted, but the better way is probably that instead of my way for most people

Yethal commented 3 years ago

When I ran into the same issue I added the cpu profile to the modifyvm command within configure_vm() function and ran the script from the beginning. It doesn't really take that long to run if you already have all the files downloaded

walttheboss commented 3 years ago

I did the same as @Yethal . An Example is below to help others. function configure_vm() { print_dimly "stage: configure_vm" if [[ -n "$( VBoxManage modifyvm "${vm_name}" --cpus "${cpu_count}" \ --memory "${memory_size}" --vram "${gpu_vram}" --pae on \ --boot1 none --boot2 none --boot3 none --boot4 none \ --firmware efi --rtcuseutc on --chipset ich9 ${extension_pack_usb3_support} \ --mouse usbtablet --keyboard usb --audiocontroller hda \ --audiocodec stac9221 --audio=none 2>&1 >/dev/null \ --cpu-profile "Intel Core i7-6700K" )" ]]; then echo -e "\nError: Could not configure virtual machine \"${vm_name}\"." echo -e "Please execute the stage ${low_contrast_color}configure_vm${default_color} again before resuming the script" echo -e "as described in the documentation.\n" echo "Exiting." exit fi

dkbutxlo commented 2 years ago

This has caused an error for me, i changed it like that:

--cpu-profile "Intel Core i7-6700K" --audiocodec stac9221 --audio=none 2>&1 >/dev/null )" ]]; then

now it works :) thanks