1

So far I have attempted the answer/instruction to this question.

I also attempted to UEFI boot install windows 10 from start up manager by creating a ExFAT Flash Drive with the contents of a mounted windows 10 iso copied to them. Unfortunately only the MacOS and Recovery showed up in manager. This is the info I received from Terminal after inputing diskutil list

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Mac OS                  499.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

/dev/disk1 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *16.0 GB    disk1
   1:               Windows_NTFS WINSTALL                16.0 GB    disk1s1

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        *3.3 GB     disk2
   1:        Apple_partition_map                         32.3 KB    disk2s1
   2:                  Apple_HFS windows_7_ultimate      3.3 GB     disk2s2

Any and all help is greatly appreciated :D shout out to @David Anderson for all the help and support thus far.

2
  • I assumed your 2009 iMac has macOS High Sierra (Version 10.13.6) installed. Is this correct? Commented Apr 29 at 13:07
  • Yes that is correct.
    – Chap
    Commented Apr 29 at 14:22

1 Answer 1

1

My Test Environment

When viewing the images below, I thought it might be helpful to explain the environment from which they were taken. The steps you will take to install Windows 10 will differ from what is outlined in the next paragraph.

I do not have a 2009 iMac. Instead, I created macOS High Sierra (version 10.13.6) guest Fusion Player virtual machine on a 2013 iMac host. The host has 16 GB of memory, and the guest was given 4 GB of memory. Host has 4 processors, and the guest was given 2 processors. The 2013 iMac had Catalina 10.15.7 installed and the version of Fusion Player installed was 12.1.2. VirtualBox 6.1.50 was installed in this macOS High Sierra guest virtual machine. VirtualBox was used to install 64‑bit Windows 10. The virtual disk was then cloned, and the clone was used to create a 64‑bit Windows 10 guest Fusion Player virtual machine on the same 2013 iMac host. This nested use of virtual machines allowed the High Sierra machine to simultaneously be both a Fusion Player guest and VirtualBox host.

My Answer to Chap's Question

The full answer is given in the Part I and Part II sections shown below. Since 64‑bit Windows 10 is to be installed using Boot Camp Support Software 4.0.4033 for the Windows Support Software, the virtual machine did not require any addition software. This may not be true if using different a version of Windows (such as Windows 7, 8, 8.1 or 11) or different Windows Support Software. If additional software is needed, then the mywindows iso command can be used to create a support.iso file containing this software. This ISO file can then be exposed to the virtual machine as a virtual DVD in a virtual optical drive.

Part I: Steps Involving Use of a Virtual Machine

Note: A virtual machine only is used to help install Windows. Once Windows is installed, the virtual machine is not needed and can be removed.

What is needed (beyond the Mac with High Sierra installed):

  • 64‑bit Windows 10 ISO file. I used the 2023 Update Version 22H2 of Windows 10. The file name is Win10_22H2_English_x64v1.iso.
  • 8 GB or larger flash drive.
  • VirtualBox 6.1.50, which is the last release compatible High Sierra. Older versions of VirtualBox probably will work as well, if compatible with High Sierra hosts and 64‑bit Windows 10 guests. VirtualBox is free software, where all current and previous releases are available for download.
  • All other files needed are free and can be downloaded from the internet. This answer requires no third party tools other than VirtualBox.
  • While you do not need a product key to install Windows 10, you may need a product key at some point after the software is installed in order to activate Windows 10.

What is not required:

  • DVDs
  • Optical drives

Below are the steps to follow.

  1. Make a partition for Windows 10.

    Use the Disk Utility application or diskutil command to create a partition at the end of the drive where Windows will be installed. Format the partition as ExFAT with the BOOTCAMP volume name. Later, the format will be changed to NTFS.

    The table below shows partitions that should appear in the output from the diskutil list command for disk0. If you have a different partition arrangement from what is shown, then you will have to make the appropriate adjustments to this answer.

    Table: Expected disk0 Partitions

    # Type Format Identifier Description
    1 EFI MS-DOS (FAT32) disk0s1 Hidden EFI
    2 Apple_HFS Mac OS Extended (Journeled) disk0s2 Contains macOS High Sierra
    3 Apple_Boot Mac OS Extended (Journeled) disk0s3 Contains macOS High Sierra Recovery
    4 Microsoft Basic Data ExFAT disk0s4 Will Contain Windows 10
  2. ExFAT format an 8 GB or larger flash drive.

    If the Disk Utility application is used to erase the flash drive, then refer to the table below.

    Table: Choices for Disk Utility Flash Drive Erase

    Label Choice
    Name WINSTALL
    Format ExFAT
    Scheme Master Boot Record
  3. Copy files to the flash drive.

    Here the assumption is made that a computer with a new enough operating system is being used to download the necessary files.

    Use the following sources.

    • Copy a 64‑bit Windows 10 ISO file to the root folder on the WINSTALL volume. This volume is on the flash drive. Here, I used the file named Win10_22H2_English_x64v1.iso, which is the 2023 Update Version 22H2 of the 64‑bit Windows 10 installer ISO file downloaded from Microsoft.
    • Create a folder named BootCamp on the root folder of the flash drive. Copy the Windows Support Software for 64‑bit Windows 7 to this BootCamp folder. According to the Apple website Install Windows 7 on your Mac using Boot Camp, the version of the Windows Support Software for installing 64‑bit Windows 7 on your Mac is Boot Camp Support Software 4.0.4033.
    • Download the Boot Camp Support Software 5.1.5722, then copy the file AppleSoftwareUpdate.msi in the BootCamp\Drivers\Apple folder of this download to the root folder on the WINSTALL volume.
    • Download VirtualBox 6.1.50 for macOS / Intel hosts file VirtualBox-6.1.50-161033-OSX.dmg from the Download VirtualBox (Old Builds): VirtualBox 6.1 website. Copy this file to the root folder on the WINSTALL volume. VirtualBox 6.1.50 is documented to be compatible with at least 32/64‑bit Windows Vista SP2 through 32/64‑bit Windows 10 guests.
    • Download the ZIP file containing the mywindows script from my GitHub Gist. From the download, extract a copy of the mywindows script to the root folder on the WINSTALL volume.

    When finished, the USB flash drive should appear as follows.

    files

  4. Install VirtualBox.

    If necessary, move the flash drive to the Mac where Windows is to be installed. Open a Terminal application window and enter the following command. This will remove any extended attributes on the flash drive that might interfere with the installation of Windows.

    Note: The outputs from the mywindows script are given in the appendix of this answer.

    /bin/bash /Volumes/WINSTALL/mywindows clean
    

    Using the file VirtualBox-6.1.50-161033-OSX.dmg in the root folder on the WINSTALL volume, install VirtualBox 6.1.50. This volume resides on the USB flash drive.

  5. Disable System Integrity Protection (SIP).

    Boot to MacOS Recovery and open a Terminal application window by selecting "Terminal" under "Utilites" in the menu bar. The command below will disable SIP.

    csrutil disable
    

    However, I chose to partially disable SIP, by entering the command below instead. If interested, this answer lists optional arguments for the csrutil command.

    csrutil enable --without fs
    

    When finished, boot back to macOS.

  6. Build a virtual machine.

    If necessary, open a Terminal application window. Execute the following commands to build the virtual machine named MyWindows. The command below changes the current directory to the root folder of the WINSTALL volume on the flash drive.

    cd /Volumes/WINSTALL
    

    The next command hybrid partitions internal drive where Windows is to be installed.

    ./mywindows hybrid
    

    The next command creates the virtual machine. The memory is set to 1024 MB and the number of processors is set to 1. The memory will be sufficient enough to run the Windows 10 installer. One virtual optical drive is added, which contains the virtual DVD created from the Win10_22H2_English_x64v1.iso file. The location where Windows will be installed is the disk0s4 partition on the physical internal drive.

    ./mywindows create -i Windows10_64 Win10_22H2_English_x64v1.iso
    
  7. Install Windows 10 in the BOOTCAMP volume.

    Enter the command below to start the virtual machine. If the message Press any key to boot from CD or DVD. appears, press the space bar.

    ./mywindows start
    

    Note: At this point, the Mac is running from the in‑memory PE, which was read from boot.wim file after booting from the CCCOMA_X64FRE_EN-US_DV9 volume on the virtual optical drive.

    When a display similar to the one shown below appears, make any necessary selections, then press the "Next" button.

    Initial display

    When a display similar to the one shown below appears, press the key combination shift+F10 to open a Command Prompt window.

    Second display

    Enter the following command to get the letter assigned to the BOOTCAMP volume. The letter should be C:. If not, then make the appropriate substitutions when entering commands.

    wmic logicaldisk get description,name,volumename
    

    Enter the following command to NTFS format drive C:.

    format c: /v:BOOTCAMP /q
    

    Enter the next command to start installing Windows 10.

    setup /noreboot
    

    Proceed with the installation of Windows to the BOOTCAMP volume, until a display similar to the one shown below appears. If you do not yet have a product key, then you can still proceed with the installation of Windows by selecting "I don't have a product key".

    Activate Windows

    When a display similar to the one shown below appears. Highlight the desired operating system, then select the "Next" button.

    Choose OS

    When a display similar to the one shown below appears. Select "Custom: Install Windows only (advanced)".

    Custom Install

    Proceed with the installation of Windows to the BOOTCAMP volume. When the Command Prompt window to reappears, enter the following command to close the window.

    exit
    

    Next, select "Repair your computer". When a display similar to the one shown below appears, select the "Turn off your PC".

    Turn off your PC

  8. Update the internal drive MBR.

    Enter the command below to copy the MBR used by the virtual machine to the internal drive MBR. This includes the bootstrap code, disk signature, partition table and boot signature.

    ./mywindows update
    

    At this point, you are done with the virtual machine. Enter the command below to fully enable SIP on the next boot to macOS.

    sudo csrutil clear
    

Part II: Steps After Finished with the Virtual Machine

  1. Finish Installing Windows 10.

    From the Startup Disk pane of the System Preferences application, select "BOOTCAMP Windows", as shown below.

    Startup Disk

    Next, restart the Mac. Proceed with the Windows installation until you reach the display where you are prompted for your region. For the 2023 Update Version 22H2 of Windows 10, a display similar to the one shown below should appear.

    Note: At this point, use of an external wired mouse and/or keyboard may be temporarily required. The on–screen keyboard can also be temporarily substituted for an actual keyboard. To access the on–screen keyboard, select the "Ease of access" button shown in the lower left of the window in the image below.

    Select region

    Note: At this point, prohibiting your Mac access to the internet is generally a good idea. For example, unplug any ethernet cables or disable Wi-Fi access that does not require encryption.

    Next, press the control+shift+F3 keys to restart Windows 10 in Audit mode.

    Note: An unusually long amount of time must pass before the desktop appears.

  2. Install Windows Support Software.

    Once the Mac has finished rebooting, execute the Boot Camp Installer Version 4.0 (Build 4033) in compatibility mode. First, find the setup application in the BootCamp folder on the WINSTALL volume. This volume resides on the USB flash drive. Next, right click on "setup" and select "Troubleshoot compatibility", as shown below.

    Troubleshoot compatibility

    Select "Troubleshoot program", as shown below.

    Troubleshoot program

    Select the "The program worked in earlier versions of Windows but won't install or run now" checkbox, then select the "Next" button, as shown below.

    The program worked...

    Highlight "Windows 7", then select the "Next" button, as shown below.

    Windows 7

    Select the "Test the program…" button, as shown below.

    Test the program…

    At this point, you should see Boot Camp installer, as shown below. Select the "Next" button.

    Boot Camp installer

    The Boot Camp Installer will install additional drivers for your Mac's hardware. If a display similar to the one shown below appears, uncheck "Apple Software Update for Windows", then select the "Install" button, as shown below.

    Apple Software Update for Windows

    After the Boot Camp Installer has completed and the Mac has restarted, install Apple Software Update by opening the AppleSoftwareUpdate Windows installer package in the root folder on the WINSTALL volume. This volume resides on the USB flash drive.

    Note: Your screen may also include a window titled "Boot Camp", which can be closed or otherwise ignored.

  3. Pair wireless keyboard.

    If you are using a wireless keyboard, check to see if the keyboard is paired with the Mac. If not, then add the wireless keyboard to the existing Bluetooth devices.

    Note: When pairing my Apple wireless keyboard, I needed to hold down the power button on the keyboard before trying to add the device. I released the button, when the keyboard was discovered by the Mac.

  4. Install Apple updates.

    Note: If you prohibited your Mac access to the internet in an earlier step, you will now want to allow access. In other words, plug in the ethernet cable or connect by Wi-Fi.

    Use the Apple Software Update application to get any new software available from Apple. Note the following:

    • You should install any updates to Apple Software Update first before installing other updates available from Apple. I my case, there were two updates of the "Apple Software Update" to download and install.
    • You may need to download only, then manually install downloads.
    • You may need to copy any downloads before Apple Software Update deletes the downloads.
  5. (Optional) Install Windows updates.

    Download and install Windows updates, including perhaps any optional updates. You may want to skip this step for now if you believe the updates will be large in number and/or size. However, skipping this step may result in some hardware drivers not being updated.

    Note: If the Restart now button appears while downloading and installing updates, then this button should not be selected until only downloaded updates with a status of "Pending restart" are shown.

all displayed updates have finished installing or reached a status of "Pending restart".

  1. Return to Out‑Of‑Box Experience (OOBE) mode.

    From the Windows Start menu, select to restart the Mac. You will return to the Administrator's desktop. If the "System Preparation Tool" window is not displayed, then open the sysprep executable application found within the C:\Windows\System32\Sysprep folder. In this window, select "Shutdown" under "Shutdown options", as shown below. The "System Cleanup Action" combo box and "Generalize" checkbox should also appear as shown below.

    Next, select "OK" to shutdown the Mac. At this point, you have completed the installation of Windows 10. Next time you turn on your Mac, Windows will start in the "Out of the Box Experience" mode. This is basically the way a newly purchased PC starts up, when Windows 10 is already installed.

    Note: When asked, be sure to select an Apple keyboard, if you are using one.

If asked, I can clarify any of the above steps.


Clean Up

  • How to Remove the Virtual Machine

    From macOS, enter the command given below in a Terminal application window.

    /Volumes/WINSTALL/mywindows remove
    
  • Uninstalling VirtualBox

    Since VirtualBox takes very little space, I would recommend not removing the application. However, if you wish to uninstall, then open the VirtualBox-6.1.50-161033-OSX.dmg file in the root folder on the WINSTALL volume. This volume resides on the USB flash drive. Next, open the VirtualBox_Uninstall.tool file and follow the instructions to uninstall VirtualBox.

Appendix

The output given is typical. Your output might vary. Version 2.1.5 of mywindows was used to create the output.

Output from the /bin/bash /Volumes/WINSTALL/mywindows clean command.

$ # Enter the commands below to remove ._* files after merging the ._* files
$ # with corresponding native files.
$ dot_clean -f /Volumes/WINSTALL
$ find /Volumes/WINSTALL -type d -mindepth 1 -maxdepth 1 \! -name .Spotlight-V100 \! -name .TemporaryItems \! -name .Trashes -exec dot_clean {} +

***************
*** SUCCESS ***
***************

Output from the ./mywindows hybrid command.

mywindows hybrid: Since this verb requires elevated privileges, sudo is being used to execute the command as root.
Password:
mywindows hybrid: Using implicit device: BOOTCAMP
$ # Enter the commands below to hybrid partition the physical drive.
$ unset Input
$ declare "Input="
$ Input+="edit 1;ee;n;1;409639;"
$ Input+="edit 2;af;n;409640;524083160;"
$ Input+="edit 3;ab;n;524492800;1269536;"
$ Input+="edit 4;07;n;525762560;522549248;"
$ Input+="flag 4;quit;y"
$ Input="${Input//;/$'\n'}"
$ sudo fdisk -ef /dev/zero /dev/disk0 <<<"$Input" >/dev/null
$ sudo fdisk /dev/disk0
Disk: /dev/disk0    geometry: 65270/255/63 [1048576000 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE    0   0   2 - 1023 254  63 [         1 -     409639] <Unknown ID>
 2: AF 1023 254  63 - 1023 254  63 [    409640 -  524083160] HFS+        
 3: AB 1023 254  63 - 1023 254  63 [ 524492800 -    1269536] Darwin Boot 
*4: 07 1023 254  63 - 1023 254  63 [ 525762560 -  522549248] HPFS/QNX/AUX

***************
*** SUCCESS ***
***************

Output from the ./mywindows create -i Windows10_64 Win10_22H2_English_x64v1.iso command.

mywindows create: Using implicit device: BOOTCAMP
$ # Enter the commands below to create the virtual machine.
$ echo "Making sure the BOOTCAMP device is unmounted."
Making sure the BOOTCAMP device is unmounted.
$ diskutil info "BOOTCAMP" | grep -Eq "^ *Mounted: *No$" || diskutil unmount "BOOTCAMP"
Volume BOOTCAMP on disk0s4 unmounted
$ vboxmanage createvm --name MyWindows --ostype "Windows10_64" --register
Virtual machine 'MyWindows' is created and registered.
UUID: 67195495-846a-4d37-acc4-f87b3ced94cf
Settings file: '/Users/dma/VirtualBox VMs/MyWindows/MyWindows.vbox'
$ echo "Configuring virtual machine hardware."
Configuring virtual machine hardware.
$ vboxmanage modifyvm MyWindows --memory "1024" --cpus "1" --vram "32" --mouse usbtablet --ioapic on --pae off
$ echo "Adding virtual DVDs to the virtual machine."
Adding virtual DVDs to the virtual machine.
$ VBoxManage storagectl MyWindows --name IDE --add ide --controller PIIX4       
$ # Primary Master
$ VBoxManage storageattach MyWindows --storagectl IDE --port 0 --device 0 --type dvddrive --medium "Win10_22H2_English_x64v1.iso"
$ echo "Added partition containing the BOOTCAMP device to the virtual machine."
Added partition containing the BOOTCAMP device to the virtual machine.
$ vboxmanage storagectl MyWindows --name SATA --add sata --controller IntelAhci --portcount 1 --hostiocache on
$ pushd "$HOME/VirtualBox VMs/MyWindows"
~/VirtualBox VMs/MyWindows /Volumes/WINSTALL
$ sudo vboxmanage internalcommands createrawvmdk -filename bootcamp.vmdk -rawdisk "/dev/disk0" -partitions "4"
Password:
RAW host disk access VMDK file bootcamp.vmdk created successfully.
$ sudo chown "$USER" bootcamp*.vmdk
$ [[ $(stat -f '%Lp' "/dev/disk0s4") == 666 ]] || sudo chmod 666 "/dev/disk0s4"
$ vboxmanage closemedium disk bootcamp.vmdk
$ vboxmanage storageattach MyWindows --storagectl SATA --port 0 --device 0 --type hdd --medium bootcamp.vmdk
$ VBoxManage setextradata global GUI/SuppressMessages remindAboutAutoCapture,remindAboutMouseIntegration
$ popd
/Volumes/WINSTALL

***************
*** SUCCESS ***
***************

Output from the ./mywindows start command.

mywindows start: Using implicit device: BOOTCAMP
$ # Enter the commands below to prepare the virtual machine for starting.
$ echo "Making sure the BOOTCAMP device is unmounted."
Making sure the BOOTCAMP device is unmounted.
$ diskutil info "BOOTCAMP" | grep -Eq "^ *Mounted: *No$" || diskutil unmount "BOOTCAMP"
$ [[ $(stat -f '%Lp' "/dev/disk0s4") == 666 ]] || sudo chmod 666 "/dev/disk0s4"
$ VBoxManage setextradata global GUI/SuppressMessages remindAboutAutoCapture,remindAboutMouseIntegration
$ # Enter the commands below to start the virtual machine.
$ echo "Starting virtual machine."
Starting virtual machine.
$ vboxmanage startvm MyWindows
Waiting for VM "MyWindows" to power on...
VM "MyWindows" has been successfully started.

***************
*** SUCCESS ***
***************

Output from the ./mywindows update command.

mywindows update: Using implicit device: BOOTCAMP
$ # Enter the command below to update the physical MBR boot code.
$ sudo fdisk -uyf ~/VirtualBox\ VMs/MyWindows/bootcamp-pt.vmdk /dev/disk0
Password:
$ # Enter the commands below to make sure the device is mounted.
$ echo "Making sure the BOOTCAMP device is mounted."
Making sure the BOOTCAMP device is mounted.
$ diskutil info "BOOTCAMP" | grep -Eq "^ *Mounted: *Yes$" || diskutil mount "BOOTCAMP"
Volume BOOTCAMP on BOOTCAMP mounted

***************
*** SUCCESS ***
***************

Output from the /Volumes/WINSTALL/mywindows remove command.

$ # Enter the command below to remove the "~/VirtualBox VMs/support.iso" file.
$ rm -f ~/VirtualBox\ VMs/support.iso
$ # Enter the commands below to remove the virtual machine.
$ ! VBoxManage list vms | grep '"MyWindows"' || VBoxManage unregistervm MyWindows
"MyWindows" {67195495-846a-4d37-acc4-f87b3ced94cf}
$ mkdir -p ~/VirtualBox\ VMs 
$ pushd ~/VirtualBox\ VMs
~/VirtualBox VMs ~
$ rm -rf MyWindows
$ popd
~
$ [[ $(stat -f '%Lp' "/dev/disk0s4") == 640 ]] || sudo chmod 640 "/dev/disk0s4"
$ echo "Making sure the BOOTCAMP device is mounted."
Making sure the BOOTCAMP device is mounted.
$ diskutil info "BOOTCAMP" | grep -Eq "^ *Mounted: *Yes$" || diskutil mount "BOOTCAMP"

***************
*** SUCCESS ***
***************

Other References

Note: Some of the references may not directly apply to this answer or the asked question.

2
  • David “Mac-god” Anderson you did it. Thank you so much! It took a bit of time but it completely worked. This was a lot of fun and I’m looking forward to using it this.
    – Chap
    Commented May 3 at 3:47
  • I am somewhat surprised an answer of this length did not require any major corrections. Commented May 3 at 12:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .