This How To article is in two parts:
- Part 1 - Introduction, creating external boot drive, installing QEMU and it's prerequisites (this article)
- Part 2 - Setting up your virtual boot drive, copying SpinRite to it, and running SpinRite via QEMU against your Mac drives
Part 1 of 2
Big Caveat!!!
I have barely tested this!! All seems to work but please, please, please backup your data, and potentially be ready to completely wipe the machine and reinstall MacOS from scratch. Also, huge, huge caveat:I have only run this on my Intel Mac. Silicon Macs should work identically (as QEMU will emulate instead of virtualize when run on ARM / Silicon Mac) but I haven't tested it!! The blog post noted below from Ryan Spletzer notes that he has run this on Apple Silicon.
Comments from users who have tested this would be welcome
Update: One user so far has reported success on an Apple Silicon Mac using these instructions
Introduction
As has been noted previously, the FreeDOS OS and SpinRite itself only run natively on PCs with Intel or AMD CPUs. Additionally, the firmware for those machines must be of the older BIOS type, or UEFI-based but able to go into Legacy (aka CSM) mode. Most PCs built since 2019, and Macs built since about 2015, can't go into Legacy mode, and are thus unable to run SpinRite natively.
Instructions have already been posted for:
- Running SpinRite natively on older Intel Macs, and
- Running SpinRite via Virtualization on newer, UEFI-only Intel or AMD PCs and newer UEFI Intel Macs
- Apple Silicon Macs
- ARM-based Windows PCs
I didn't come up with this approach, I just combined what I read from others with some of the instructions I already provided for virtualization. The first posting of someone doing this successfully that I saw was here: https://www.spletzer.com/2024/12/running-spinrite-on-apple-silicon/ . Kudos to Ryan Spletzer for documenting this!!
While you can use this approach for Intel-based Macs and Intel/AMD PCs, I'd stick with the VirtualBox virtualization solution as it's a bit simpler. But it is an option; when running on an Intel or AMD CPU, QEMU will default to virtualization rather than emulation.
The overall steps to make this work are:
- Create a bootable external USB drive running MacOS
- Boot the target Mac from that drive
- Within MacOS:
- Install the XCode Command Line Tools
- Install the Homebrew Package Manager
- Use Homebrew to install QEMU
- Create a FreeDOS Disk Image in which to run SpinRite, and install SpinRite to that Disk Image
- Ensure that the internal drives of the host machine are UNMOUNTED, so that the actual OS does not interfere with SpinRite operations
- Map the actual physical drives of the target Mac to virtual drives via the QEMU command line
- Run SpinRite, which should now see those drives as attached the Emulated PC created by QEMU
Caveats
My testing so far has only been able to emulate IDE controllers, not AHCI controllers, although QEMU supposedly supports them. This will probably limit the number of simultaneous drives one can connect to an emulation session to four total.What kind of drives can SpinRite in QEMU "see"?
The physical drives are virtualized and accessed through the QEMU emulated drive controllers and/or "BIOS"; any drive that the Host OS can see can be mapped in QEMU, and then addressed by SpinRite.- When drives are attached to the virtual IDE controller, SpinRite accesses them through its native IDE driver
USB drives must be physically attached (and the OS-specific unmount commands run) before running QEMU. There is no need for the USB mapping capability within QEMU.
Prerequisites
There are certain items you need in order to make this work:- One USB drive to run the "host OS" and VirtualBox. This could be a fast USB flash drive, but it's HIGHLY RECOMMENDED that you use an external USB SSD drive. Flash drives will quickly wear out and and slow down.
- Capacity - should be at least 64 GB
- And most importantly, these "items":
- A SAFETY FIRST ATTITUDE!!
- Before working on your target system, back it up!! Just like running SpinRite natively against a system, SpinRite on an emulated environment will rewrite data, so backup your data, just in case!
- If running against an encrypted drive (FileVault on MacOS), print out your recovery key and store it safely!!
- And if possible, temporarily turn off the encryption before running SpinRite against the drive
- KNOWLEDGE!! You must be comfortable with Administration commands in both the Host OS of choice, as well as DOS and the QEMU application. You should NOT blindly follow this guide; you need to understand what the commands are; there is an assumption that you know your way around a Mac and PC. YOU ARE DOING THIS AT YOUR OWN RISK, AS IT IS AN UNSUPPORTED METHOD TO RUN SPINRITE. WHILE THE INSTRUCTIONS SHOULD ENSURE THAT THE DRIVES ARE UNDER EXCLUSIVE SPINRITE CONTROL, TESTING HAS NOT BEEN EXTENSIVE. DATA LOSS IS A POSSIBILITY!
- A SAFETY FIRST ATTITUDE!!
Other notes:
- Booting from external drives seems to throw off the clock on many target systems. Before starting work, double check that the time zone and time are correct. When booting back to the native OS, do the same
On your Target Mac (on which you will eventually run SpinRite against its drives)
A. Creating an external MacOS Boot Drive
- Create an external, bootable MacOS drive
- There are plenty of websites explaining how to do this
- Here's a good example set of instructions:
- https://www.prosofteng.com/blog/how-to-create-a-bootable-external-hard-drive-on-mac
- As stated in the instructions, MAKE SURE YOU ARE INSTALLING TO YOUR EXTERNAL DRIVE!!
- The only special settings needed are to ensure your Mac NEVER turns off its display, sleeps / suspends, or turns off (those are all related to power savings)
- Instructions vary depending on whether you're on a desktop or laptop, and version of MacOS
- Click on this link for the instructions for your particular MacOS version:
- On MacOS Sonoma for my Mac laptop, I:
- Went to the Lock Screen settings and set:
- "Start Screen Saver when inactive" to "Never"
- "Turn display off on power adapter when inactive" to "Never"
- Went to the Battery settings and clicked the "Options" button
- "Prevent automatic sleeping on power adapter when the display is off" is turned "On"
- "Put hard disks to sleep when possible" set to "Never"
- Went to the Lock Screen settings and set:
- You could also try a 3rd party utility to manage this; such as the app Amphetamine
- Instructions vary depending on whether you're on a desktop or laptop, and version of MacOS
B. Installing XCode Command Line Tools
- First, check if the tools are already installed. If so, you can move on to installing Homebrew and then QEMU
- Follow the instructions here to see if the tools are installed: https://mac.install.guide/commandlinetools/2
- If not, then install the command line tools
- Follow the instructions here: https://mac.install.guide/commandlinetools/4
- Basically, it's just opening a terminal session and typing:
xcode-select --install
- Basically, it's just opening a terminal session and typing:
- Follow the instructions here: https://mac.install.guide/commandlinetools/4
C. Installing Homebrew
Unfortunately QEMU does not provide a Mac installer. It will have to be installed via a 3rd party Mac package manager, such as Nix or MacPorts or Homebrew. I chose to use Homebrew but if you're comfortable with one of the others than use that.I installed Homebrew by running the installer from the downloaded .pkg file, but you can run the command line noted on the Homebrew home page as well. After the installation, there is a message about adding homebrew to the Path to allow running from any directory.
D. Installing QEMU
Per the Homebrew instructions for QEMU, you can simply open a Terminal window and type:brew install qemu
Continue on to Part 2 to get a base C drive for QEMU, put your copy of SpinRite onto that drive, and map the Mac drives onto QEMU for use by SpinRite
Last edited: