How To: Run SpinRite on a UEFI-only machine (Part 5B of 5 - Create your own Virtual Machine)

  • Be sure to checkout “Tips & Tricks”
    Dear Guest Visitor → Once you register and log-in please checkout the “Tips & Tricks” page for some very handy tips!

    /Steve.
  • BootAble – FreeDOS boot testing freeware

    To obtain direct, low-level access to a system's mass storage drives, SpinRite runs under a GRC-customized version of FreeDOS which has been modified to add compatibility with all file systems. In order to run SpinRite it must first be possible to boot FreeDOS.

    GRC's “BootAble” freeware allows anyone to easily create BIOS-bootable media in order to workout and confirm the details of getting a machine to boot FreeDOS through a BIOS. Once the means of doing that has been determined, the media created by SpinRite can be booted and run in the same way.

    The participants here, who have taken the time to share their knowledge and experience, their successes and some frustrations with booting their computers into FreeDOS, have created a valuable knowledgebase which will benefit everyone who follows.

    You may click on the image to the right to obtain your own copy of BootAble. Then use the knowledge and experience documented here to boot your computer(s) into FreeDOS. And please do not hesitate to ask questions – nowhere else can better answers be found.

    (You may permanently close this reminder with the 'X' in the upper right.)

Scott

Well-known member
Sep 18, 2020
201
49
This How To is in multiple parts:
  1. Introduction
  2. Using Windows to Go as the base OS for your bootable VirtualBox system
  3. Using Kubuntu Linux as the base OS for your bootable VirtualBox system
  4. Using MacOS as the base OS for your bootable VirtualBox system
  5. Downloading or Creating your VM and moving files in and out of the virtual drive
    1. Part 5A - Download a pre-built Virtual Machine instead of creating your own
    2. Part 5B - Creating your own Virtual Machine (this article)
    3. Part 5C - Copying files to and from the VM hard drive

Creating the base SpinRite Virtual Machine​

  1. Directions between Windows, Linux, and MacOS are fairly similar, so I'll combine them all into this one post
  2. If you will be proceeding to build your own Virtual Machine, you must create the SpinRite floppy Image, currently only possible via the SpinRite executable running on Windows. You may have done this already, if not:
    1. Go to GRC.com and download your personal copy of SpinRite
    2. Run the SpinRite executable in Windows
    3. Use the option to "Create ISO or IMG file"
    4. Click on "Save a Boot Image File"
    5. Dialog box comes up; change the Save as type entry to: IMG (for making boot diskette)
    6. By default it's called SpinRite.img, change the name to SPINRITE-FD.img and save it
    7. Close the status message then Exit SpinRite
    8. Copy that file to a USB flash drive and put it aside, you'll use it later
  3. On your Target Machine, boot from your HostOS flash drive containing VirtualBox
  4. Start VirtualBox as previously noted (graphically on Windows or Linux, via sudo virtualbox on MacOS)
  5. Create a new VirtualBox Machine
    1. Name: SRDOS (or whatever you want)
    2. Type: Other
    3. Version: DOS
    4. Base Memory: 128 MB
    5. Processors: 1
    6. Virtual Hard Disk Size: About 100 MB (this space is for logs, so whatever size you want)
      1. NOTE: The Virtual Hard Disk will be connected to a virtual IDE controller as Primary Device 0.
  6. Finish
  7. This will create the ‘VirtualBox VMs’ directory underneath your home directory, if it's not there already
  8. Insert that 2nd USB drive from the Windows PC noted above
    1. Open the USB drive from the desktop
    2. Copy theSPINRITE-FD.imgfile to the VirtualBox VMs directory
      1. On Windows, you'd use Explorer, on MacOS, you'd use finder, and on Linux you'd use the Dolphin File Manager
  9. We also need a FreeDOS 1.3 boot disk
    1. Using your browser, go to https://freedos.org/download/
    2. Download from the "Live CD", button, and unzip the downloaded file
    3. Take the FD13BOOT.IMG file and copy it to the "VirtualBox VMs" folder
  10. Open the Settings for your virtual machine
    1. Make sure the Floppy controller has two devices, device 0 and device 1 (you may have to add an empty device)
      1. In Device 0, attach the SpinRite disk, SPINRITE-FD.img
      2. In Device 1, attach the FreeDOS disk, FD13BOOT.img
  11. Click on Start. The Virtual Machine should boot up from the SpinRite disk, which is Drive A
  12. The system will automatically boot into SpinRite. As soon as you can, hit Escape to terminate SpinRite and get back to the A:\> prompt
  13. You should now be at the A:\>prompt
  14. Change to the B: drive
  15. From root directory:
  16. cd \freedos\bin
    1. Copy the following files to A:\
    2. fdisk.*
    3. sys.*
    4. format.*
    5. fdapm.*
  17. Now enter A:to go back to the A drive
  18. edit config.sys
    1. REM the INSTALL=DOWNSIZE.COM line
    2. REM the DEVICE=SRSPLASH.SYS line
  19. Exit and save
  20. edit autoexec.bat
    1. REM the SPINRITE line
  21. Exit and save
  22. You'll now create a one line shutdown.bat file
    1. edit shutdown.bat
      1. fdapm.com /poweroff
    2. Exit and save
  23. from the A:\> command prompt:
  24. fdisk
    1. Question on Large Disk support - answer Y
    2. Choose option 1. Create DOS Partition or Logical DOS Drive
    3. Choose option 1. Create Primary DOS Partition
    4. Use max size: Y
    5. Partition will be created
    6. Press ESC
    7. Press ESC
    8. Message regarding restart. Press ESC
  25. Back at the A:\>prompt
    1. shutdown
  26. From the Settings:
    1. Remove the FD13BOOT.img from the floppy controller
  27. Start the VM again
  28. From the A:\>prompt:
    1. format c: /s
    2. at prompt that all will be deleted, type YES
    3. Enter volume name as desired
  29. Back to the A:\> prompt.
  30. Copy all files from the A Drive to the C drive
    1. copy *.* c:\
  31. Copy hidden files mkeyb.exe and srsplash.sys also
  32. type shutdown to end the virtual machine session
  33. Go to Settings | Storage:
    1. Remove attachment for SPINRITE-FD.img on the floppy controller
    2. Remove attachment for the Optical Disk connected to the IDE controller
    3. Add an AHCI controller
  34. Start the Virtual Machine
  35. It should boot to the C drive
  36. You can start SpinRite, it should only see the boot drive but it should work!!
    1. C:\>spinrite
  37. Shutdown the virtual machine
    1. C:\>shutdown
  38. That's it!!
  39. Now return back to your instructions for your Host OS to learn how to map the drives on the host into VirtualBox:
    1. Part 2B - Windows to Go Host OS
    2. Part 3B - Kubuntu Linux as Host OS
    3. Part 4B - MacOS as Host OS
 
Last edited:
  • Like
Reactions: jbruceguitar
This How To is in multiple parts:
  1. Introduction
  2. Using Windows to Go as the base OS for your bootable VirtualBox system
  3. Using Kubuntu Linux as the base OS for your bootable VirtualBox system
  4. Using MacOS as the base OS for your bootable VirtualBox system
  5. Downloading or Creating your VM and moving files in and out of the virtual drive
    1. Part 5A - Download a pre-built Virtual Machine instead of creating your own
    2. Part 5B - Creating your own Virtual Machine (this article)
    3. Part 5C - Copying files to and from the VM hard drive

Creating the base SpinRite Virtual Machine​

  1. Directions between Windows, Linux, and MacOS are fairly similar, so I'll combine them all into this one post
  2. If you will be proceeding to build your own Virtual Machine, you must create the SpinRite floppy Image, currently only possible via the SpinRite executable running on Windows. You may have done this already, if not:
    1. Go to GRC.com and download your personal copy of SpinRite
    2. Run the SpinRite executable in Windows
    3. Use the option to "Create ISO or IMG file"
    4. Click on "Save a Boot Image File"
    5. Dialog box comes up; change the Save as type entry to: IMG (for making boot diskette)
    6. By default it's called SpinRite.img, change the name to SPINRITE-FD.img and save it
    7. Close the status message then Exit SpinRite
    8. Copy that file to a USB flash drive and put it aside, you'll use it later
  3. On your Target Machine, boot from your HostOS flash drive containing VirtualBox
  4. Start VirtualBox as previously noted (graphically on Windows or Linux, via sudo virtualbox on MacOS)
  5. Create a new VirtualBox Machine
    1. Name: SRDOS (or whatever you want)
    2. Type: Other
    3. Version: DOS
    4. Base Memory: 128 MB
    5. Processors: 1
    6. Virtual Hard Disk Size: About 100 MB (this space is for logs, so whatever size you want)
      1. NOTE: The Virtual Hard Disk will be connected to a virtual IDE controller as Primary Device 0.
  6. Finish
  7. This will create the ‘VirtualBox VMs’ directory underneath your home directory, if it's not there already
  8. Insert that 2nd USB drive from the Windows PC noted above
    1. Open the USB drive from the desktop
    2. Copy theSPINRITE-FD.imgfile to the VirtualBox VMs directory
      1. On Windows, you'd use Explorer, on MacOS, you'd use finder, and on Linux you'd use the Dolphin File Manager
  9. We also need a FreeDOS 1.3 boot disk
    1. Using your browser, go to https://freedos.org/download/
    2. Download from the "Live CD", button, and unzip the downloaded file
    3. Take the FD13BOOT.IMG file and copy it to the "VirtualBox VMs" folder
  10. Open the Settings for your virtual machine
    1. Make sure the Floppy controller has two devices, device 0 and device 1 (you may have to add an empty device)
      1. In Device 0, attach the SpinRite disk, SPINRITE-FD.img
      2. In Device 1, attach the FreeDOS disk, FD13BOOT.img
  11. Click on Start. The Virtual Machine should boot up from the SpinRite disk, which is Drive A
  12. The system will automatically boot into SpinRite. As soon as you can, hit Escape to terminate SpinRite and get back to the A:\> prompt
  13. You should now be at the A:\>prompt
  14. Change to the B: drive
  15. From root directory:
  16. cd \freedos\bin
    1. Copy the following files to A:\
    2. fdisk.*
    3. sys.*
    4. format.*
    5. fdapm.*
  17. Now enter A:to go back to the A drive
  18. edit config.sys
    1. REM the INSTALL=DOWNSIZE.COM line
    2. REM the DEVICE=SRSPLASH.SYS line
  19. Exit and save
  20. edit autoexec.bat
    1. REM the SPINRITE line
  21. Exit and save
  22. You'll now create a one line shutdown.bat file
    1. edit shutdown.bat
      1. fdapm.com /poweroff
    2. Exit and save
  23. from the A:\> command prompt:
  24. fdisk
    1. Question on Large Disk support - answer Y
    2. Choose option 1. Create DOS Partition or Logical DOS Drive
    3. Choose option 1. Create Primary DOS Partition
    4. Use max size: Y
    5. Partition will be created
    6. Press ESC
    7. Press ESC
    8. Message regarding restart. Press ESC
  25. Back at the A:\>prompt
    1. shutdown
  26. From the Settings:
    1. Remove the FD13BOOT.img from the floppy controller
  27. Start the VM again
  28. From the A:\>prompt:
    1. format c: /s
    2. at prompt that all will be deleted, type YES
    3. Enter volume name as desired
  29. Back to the A:\> prompt.
  30. Copy all files from the A Drive to the C drive
    1. copy *.* c:\
  31. Copy hidden files mkeyb.exe and srsplash.sys also
  32. type shutdown to end the virtual machine session
  33. Go to Settings | Storage:
    1. Remove attachment for SPINRITE-FD.img on the floppy controller
    2. Remove attachment for the Optical Disk connected to the IDE controller
    3. Add an AHCI controller
  34. Start the Virtual Machine
  35. It should boot to the C drive
  36. You can start SpinRite, it should only see the boot drive but it should work!!
    1. C:\>spinrite
  37. Shutdown the virtual machine
    1. C:\>shutdown
  38. That's it!!
  39. Now return back to your instructions for your Host OS to learn how to map the drives on the host into VirtualBox:
    1. Part 2B - Windows to Go Host OS
    2. Part 3B - Kubuntu Linux as Host OS
    3. Part 4B - MacOS as Host OS
Hi, really good guide, however I have struck a problem with 'In Device 0, attach the SpinRite disk, SPINRITE-FD.img'
I get the error 'Failed to open the disk image file /home/kubuntu/VirtualBox VMs/SPINRITE-FD.img.
the medium '/home/kubuntu/VirtualBox VMs/SPINRITE-FD.img' (VERR_NOT_SUPPORTED).
Result Code:
VBOX_E_IPRT_ERROR (0X80BB0005)
Component:
MediumWrap
Interface:
IMedium {ad47ad09-787b-44ab-b343-a082a3f2dfb1}
Callee:
IVirtualBox {7682d5eb-f00e-44f1-8ca2-99d08b1cd607}
Callee RC:
VBOX_E_OBJECT_NOT_FOUND (0X80BB0001)

No problems attaching the file FD14BOOT.img
Any ideas please ?
 
Hi, really good guide, however I have struck a problem with 'In Device 0, attach the SpinRite disk, SPINRITE-FD.img'
I get the error 'Failed to open the disk image file /home/kubuntu/VirtualBox VMs/SPINRITE-FD.img.
the medium '/home/kubuntu/VirtualBox VMs/SPINRITE-FD.img' (VERR_NOT_SUPPORTED).
I tried writing a script to attach the .img files
VBoxManage createvm --name SpinriteVM --ostype DOS --register # Create the VM
VBoxManage storagectl SpinriteVM --name 'Floppy Controller' --add floppy # Create a Floppy controller
VBoxManage storageattach SpinriteVM --storagectl 'Floppy Controller' --port 0 --device 0 --type fdd --medium SPINRITE-FD.img # Add .img file 1
VBoxManage storageattach SpinriteVM --storagectl 'Floppy Controller' --port 0 --device 1 --type fdd --medium FD14BOOT.img # Add .img file 2

Output was similar to the one in the GUI

VBoxManage: error: Could not get the storage format of the medium '/media/michael/sda9/VirtualMachines/SPINRITE-FD.img' (VERR_NOT_SUPPORTED)
VBoxManage: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 197 of file VBoxManageDisk.cpp
VBoxManage: error: Invalid UUID or filename "SPINRITE-FD.img"

VirtualBox seems to think there is something wrong with SPINRITE-FD.img
It attaches FD14BOOT.img with no problem.

I can't think of any other way to attack this except buying an m.2 nvme usb adaptor and taking the drive out of the computer and running spinrite on an older PC (I have run a sata ssd like this using a VM), but I would prefer to get this running, will be much better for the future.
 
Hi, really good guide, however I have struck a problem with 'In Device 0, attach the SpinRite disk, SPINRITE-FD.img'
I get the error 'Failed to open the disk image file /home/kubuntu/VirtualBox VMs/SPINRITE-FD.img.
the medium '/home/kubuntu/VirtualBox VMs/SPINRITE-FD.img' (VERR_NOT_SUPPORTED).
Result Code:
VBOX_E_IPRT_ERROR (0X80BB0005)
Component:
MediumWrap
Interface:
IMedium {ad47ad09-787b-44ab-b343-a082a3f2dfb1}
Callee:
IVirtualBox {7682d5eb-f00e-44f1-8ca2-99d08b1cd607}
Callee RC:
VBOX_E_OBJECT_NOT_FOUND (0X80BB0001)

No problems attaching the file FD14BOOT.img
Any ideas please ?
I just went through these instructions step by step and they worked for me. I'd say something went wrong when you created the SPINRITE-FD.img file. Perhaps you had the format set to ISO (which is for a CD image) instead of IMG?
 

Attachments

  • Screenshot 2025-08-13 154927.jpg
    Screenshot 2025-08-13 154927.jpg
    31.8 KB · Views: 71
The SpinRite 6.1 ISO is a diskette IMG wrapped in a CD package, and if written to a CD will only 'format' the first 1.44 KB.

That way, one IMG inside the SPINRITE.EXE can be used to build a diskette or a CD, that includes the SPINRITE.EXE program, a clone baby of itself that works under Windows to do the building of bootable drives - USB, diskette, or CD - and the same SPINRITE.EXE also works under DOS to do the SpinRite-ing - incredibly clever of @Steve Gibson all around.

1755126364738.png

2024-06-01 06:10 AM 19 AUTOEXEC.BAT
2024-06-01 06:10 AM 66,945 COMMAND.COM RHS
2024-06-01 06:10 AM 73 CONFIG.SYS
2024-06-01 06:10 AM 3,363 EDIT.COM
2024-06-01 06:10 AM 45,294 KERNEL.SYS RHS
2024-06-01 06:10 AM 8,001 MKEYB.EXE RHS
2024-06-01 06:10 AM 264,624 SPINRITE.EXE
2024-06-01 06:10 AM 12,215 SRSPLASH.SYS RHS
 
I just went through these instructions step by step and they worked for me. I'd say something went wrong when you created the SPINRITE-FD.img file. Perhaps you had the format set to ISO (which is for a CD image) instead of IMG?
Thanks Scott and Peter,
I run Linux normally, so I downloaded spinrite.img initially. I thought it may have been the problem, so I downloaded spinrite.exe and ran it under Wine to extract spinrite.img, still didn't work, so I downloaded spinrite.exe on the target machine, which only has Windows at the moment, and extracted it in there. Same result.
I compared one from spinrite.exe and one directly downloaded, and they were the same.
Code:
michael@Dell1ngswx1sda5debian12xfce:/media/michael/sda9/Isos/Spinrite6.1
$ sha256sum SPINRITE-FD.img spinrite.img
d70675a9b85a1845169c165a0161d28ee31a8c304142e46940b10cea9827485d  SPINRITE-FD.img
d70675a9b85a1845169c165a0161d28ee31a8c304142e46940b10cea9827485d  spinrite.img
I guess you won't be able to compare with your spinrite.img file because each one has the user id embedded in it.
The only other thing I thought of was maybe the version of VirtualBox, I used the latest Kubuntu and it did a lot of updates, so I presume it is fully current.
 
I downloaded spinrite.exe on the target machine, which only has Windows at the moment
SpinRrite.exe will run as an a Windows app and guide the user thru the process of creating bootable media, be it a USB thumb drive, a floppy disk, or a CD.

When I posted the above it had been sometime since I last ran SpinRite.exe as a Windows app. Upon reading subsequent posts, I realized my response was incomplete. Herewith, after revisiting SpinRite.exe as a Windows app, is the proper response:

SpinRite.exe will run as an a Windows app and guide the user thru the process of creating bootable media, be it a USB thumb drive, a floppy disk, an ISO file for burning a CD, or an IMG file for use with Linux, et al. In all cases SpinRite does the actual work of creating the result, per the users choice. There is NO extraction per se.
 
Last edited:
spinrite.exe will run as an a Windows app and guide the user thru the process of creating bootable media, be it a USB thumb drive, a floppy disk, or a CD.
Yes, I ran it and extracted the spinrite.img, and used Rufus to create the usb drive, like it says in "Part 3A of 5 - Linux as base OS" of these instructions.
 
Last edited:
I did that too, same result

I think the problem is you are maybe copying your downloaded spinrite to the USB and giving it the name of "spinrite-fd.img", then trying to mount that. I tried that and got the same error you did. That is not what you should be doing. In Section 3A of the instructions, it states:
  • Now, go to GRC.com and download your personal copy of SpinRite
  • Run the SpinRite executable
  • Use the option to create an IMG file.
  • By default it's called SpinRite.img, change the name to SPINRITE-FD.img
  • Copy that file to your 2nd flash drive and put it aside, you'll use it later


To be more specific:
1. On your Windows machine, download your copy of Spinrite. This will be an executable of about 256 KB.
2. Within Windows, run SpinRite
3. From the SpinRite main menu, click "Create ISO or IMG File"
4. Click "Save a Boot Image File"
5. Change "Save as Type" to "IMG (for making boot diskette)"
6. Change File name to SPINRITE-FD.img
7. Click Save

Now take that file (about 1.4 MB), put it on a USB and transfer it to your Linux machine
 
"... I ran it and extracted the spinrite.img,
and used Rufus to create the usb drive ..."​

And copied the SPINRITE.IMG file to the USB
drive so you could then copy the
SPINRITE.IMG file to the Virtual Machine.

Right?

You're not trying to boot or run the
SPINRITE.IMG in any way, right?

You're only delivering the SPINRITE.IMG file
to the Virtual Machine, right?
 
"... I ran it and extracted the spinrite.img,
and used Rufus to create the usb drive ..."​

And copied the SPINRITE.IMG file to the USB
drive so you could then copy the
SPINRITE.IMG file to the Virtual Machine.

Right?

You're not trying to boot or run the
SPINRITE.IMG in any way, right?

You're only delivering the SPINRITE.IMG file
to the Virtual Machine, right?

The comment that he “extracted” the SpinRite.img is concerning, as that’s not how one creates a floppy image, as you know Peter. I think Michael is not generating the floppy image correctly which is why I gave the detailed instructions
 
It's the "... extracted the spinrite.img, and used
Rufus to create the usb drive
..." and "... for
making boot diskette
..." that made me want
to reinforce what's going on, right?

The steps are clear, and the 'target' is to take
an IMG file from a source, and bring it over
to the virtual machine, intact as an IMG file.

- - - - -

Now, write unambiguously clear directions
for ... putting letterhead in a typewriter ... !
Writing well-audited, foolproof,
unambiguously-clear instructions is an
arduous challenge, isn't it?
 
Last edited:
I think I did it right, maybe I didn't, but I am going away for a few days now, and will fire up that computer and check when I get back
 
I think the problem is you are maybe copying your downloaded spinrite to the USB and giving it the name of "spinrite-fd.img", then trying to mount that. I tried that and got the same error you did.
I presume you mean that I wrote spinrite.exe to the USB, I didn't do that, I got the .img files both from a direct download and by running the .exe file.
However I downloaded the .img file again this week and the instructions worked perfectly, right through to running spinrite on the nvme drive. So somehow there was something wrong with the .img file I tried originally. Who knows why, but it is all good now.
These instructions are very good !
 
I had bought a USB to m.2 nvme adapter after having trouble with this approach, so I tried it too, with a VM on my desktop computer pointed at the USB enclosure, and it was much easier to set up, but was much much slower ! (I only had a long usb a to c cable so maybe that slowed it too)
 
Few things, is the cable USB 2.0 (The USB-A side only has 4 pins), or some sort of USB 3 (7 pins instead of 4).

In the case of USB 3.x, do you know the max speed of the port you plugged it in? 3.x ports would be one of 5, 10, or 20 Gbps. Assuming you have a 3.x cable, either the port or the adaptor might be limited to USB 2.0 anyway.