How To: Run SpinRite on a UEFI-only machine (Part 5A of 5 - Using Pre-Built VM)

  • SpinRite v6.1 Release #3
    Guest:
    The 3rd release of SpinRite v6.1 is published and may be obtained by all SpinRite v6.0 owners at the SpinRite v6.1 Pre-Release page. (SpinRite will shortly be officially updated to v6.1 so this page will be renamed.) The primary new feature, and the reason for this release, was the discovery of memory problems in some systems that were affecting SpinRite's operation. So SpinRite now incorporates a built-in test of the system's memory. For the full story, please see this page in the "Pre-Release Announcements & Feedback" forum.
    /Steve.
  • 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
63
22

Using a Prebuilt Virtual Machine and C Drive DOS disk​


Building the C drive within Virtual Box is a bit of a pain due to needing to have both the FreeDOS and SpinRite floppy images to create your C drive. I've built the Virtual Machine and Virtual disk file so you don't have to, and exported it as an appliance, which is a single OVA file.

How to use this:​

  1. Download the SRDOS.OVA file to your boot drive from this link
    1. This is coming from my OneDrive account, and it's all of about 1 MB!!
  2. From within VirtualBox, go to File | Import Appliance
  3. Point to the SRDOS.OVA and Import
  4. The Virtual Machine and it's associated Virtual Hard Drive will be imported into your 'VirtualBox VMs' folder and ready to go, BUT see below to potentially convert the hard drive image (in .VMDK or .VDI form) into a more useful form (.VHD or .IMG)

What's in the "Appliance":​

  • A .VBOX file with a basic PC configuration:
    • IDE drive with "boot C drive" attached
    • Floppy controller with no images attached
    • AHCI controller with no images attached
      • You'll attach your VMDK files to this controller for access
  • The imported C drive file:
    • I created a .VHD format drive and put that into the "appliance"
      • 100 MB dynamically sized drive (so actually only takes up about 2 MB)
      • MBR drive with one partition, formatted as FAT16
      • GRC-modified FreeDOS installed
      • The various disk prep utilities I noted in the detailed directions
      • ReadSpeed (it's the rs.exe file)
        • You can use this to see if you've mapped your physical drives correctly
      • Not SpinRite!! SpinRite is obviously a paid, licensed program and you need to get your own copy
      • There is a spinrite.exe on the C drive but it's an old pre-release version that simply puts up a banner to buy your own copy

Converting the virtual C drive to a format that's readable by the Host OS​

  • The import process may change the format of the C drive to a .VMDK or .VDI. That will work fine, BUT to use method 2, below, to get the actual spinrite executable onto the virtual hard drive, you must convert the drive to the .VHD or .IMG formats. Once that's done you can mount the drive in the host OS and add, modify, or delete files
    • Reference: https://docs.oracle.com/en/virtualization/virtualbox/7.0/user/vboxmanage.html#vboxmanage-clonemedium
    • With VirtualBox NOT running:
      • On the Windows base OS, you'd want to convert the file to a .VHD file:
        • Open your terminal, and change directory to the VirtualBox VMs\SRDOSdirectory
          • cd "C:\Users\Admin\VirtualBox VMs\SRDOS"
        • do a dir and look at the files. If you see a .VDI, .VMDK, instead of a .VHD, you can convert it
          • "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonemedium disk SRDOS-disk001.vmdk SRDOS.vhd --format VHD
        • Note: .VDI, .VMDK and .VHD formats are all compressed, so they will only be between 1 and 3 MB for the 100 MB hard drive
      • On the MacOS or Linux base OS, you'd want to convert the file a .IMG file. Instructions for both MacOS and Linux are identical
        • Open the console or terminal, and change to the VirtualBox VMsdirectory (not the SRDOS directory just yet)
          • cd ~/'VirtualBox VMs'
        • Change the permissions on the SRDOS directory
          • sudo chmod 777 SRDOS
        • Change into the SRDOS directory
          • cd SRDOS
        • do a lsand look at the files. If you see a .VDI, .VHD or .VMDK instead of a .IMG, you can convert it
          • sudo VBoxManage clonemedium disk SRDOS-disk001.vmdk SRDOS.img --format RAW
        • When that's done, you'll change the permissions so that you can mount the .IMG file from the standard users
          • sudo chmod 666 SRDOS.img
        • Note: the --format RAW switch makes an UNCOMPRESSED disk image file, which will be about 100 MB
    • Now start VirtualBox the normal way for your platform (graphically for Windows and Linux, sudo virtualboxfor MacOS
      • In the Settings for the SRDOS Virtual Machine, detach the original disk and attach the new .VHD or .IMG file to the IDE controller
      • Once you know it works, go into the Media Manager and delete the original hard drive file (.VDI or .VMDK)

I bought my own copy of SpinRite, how do I get it on the C Drive?​

Two ways:
  1. Method One - create a floppy image and mount it - REQUIRES WINDOWS PREP PC
    1. On your Prep machine:
      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. Exit SpinRite
      8. Copy that file to a USB flash drive
    2. On your Target machine:
      1. Start your Win to Go, MacOS, or Linux boot drive on your target machine
      2. Insert the USB drive from the Prep PC
      3. Copy the SPINRITE-FD.img to your VirtualBox VMs folder
      4. In the Settings for your Virtual Machine, attach that floppy image to the floppy controller
      5. In the Settings, check the boot order, ensure that the Hard Drive has higher priority than the floppy controller
      6. Start your Virtual Machine
      7. You should boot to the C drive
      8. Delete dummy spinrite.exe from C drive
      9. Copy spinrite.exe from A drive to C drive
      10. shutdown
      11. In Settings, detach the floppy image
  2. Method Two - Mount the hard drive file in your host system and copy the spinrite executable to the drive
    1. Go to GRC.com and download your SpinRite executable from either the new purchase page or upgrade page
      1. Will be SR61.EXE
    2. If the hard drive file is NOT in the VHD or .IMG format, you must convert it as noted above
    3. With VirtualBox NOT running:
      1. For Windows, use the Computer Management app (must open as Administrator)
        1. Open Disk Management
        2. On the Actions Tab, Attach VHD
        3. Select the file and choose Okay
        4. You may then see the Disk mounted but Offline
        5. Right click on the Drive descriptor in the drive pane, and move the Drive Online; it may ask you what Drive Letter you'd like to assign
        6. And that's it, you should be able to copy files to and from the drive
        7. When you're done, Detach the VHD file in the Disk Management app
        8. If you Attach that VHD file again, it will normally be online and get the same drive letter as last time
      2. For MacOS:
        1. In the Finder top menu, select Go | Go to Folder; type a ~/ and navigate to the VirtualBox VMs folder; click and then select SRDOS folder
        2. Right click (Ctrl-click) on the SRDOS.img file. Go to Open With, and select DiskImageMounter
        3. The Image file will now show up on the desktop looking like a Drive icon, possibly named NO NAME
        4. Open up the "drive" and drag the SR61.EXE file into it
        5. Close the finder window, and drag the drive icon to the trash to "Eject" it just like a USB drive
      3. For Linux:
        1. Open the Discover application store app and install the Gnome Disks app
          1. Search for disks
          2. Find the Disks app, the "Disk management utility for Gnome"
          3. Click on it, and in the upper right of the Discover app, click Install
        2. Once it's installed, open it (just called Disks) from the Application Menu
          1. From the top "hamburger" menu (the 3 horizontal lines), select "Attach Disk Image"
          2. Work your way through the folder hierarchy from Home until you get into the VirtualBox VMs/SRDOS folder
          3. Click on the SRDOS.img file
          4. UNCHECK the box in the lower left that says "Set up read-only loop device"
          5. Click on Attach.
        3. Now open the Dolphin File Manager
          1. Now within the Dolphin File Manager, you'll see the device in the Devices section (on mine it says 99.9 MiB Internal Drive).
          2. Click on the drive to see the disk contents. You can copy in the SR61.exe file you downloaded earlier
          3. Close the Dolphin File Manager
        4. Now back to the Disks application
          1. You'll see the drive listed on the left; on mine it showed up as "105 MB Loop Device"
          2. Click on the drive
          3. On the top of the app, toward the right side, is the icon typically used for Eject. Click on it.
          4. The .IMG file is now unmounted, and when you start VirtualBox you should see the results of your changes on the C drive

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:
Hi Scott - I saw your simple step and went for it, unfortunately after VBox and putting your machine into the folder, I received this error (maybe I missed a step):

VM Name: SRDOS

Not in a hypervisor partition (HVP=0) (VERR_NEM_NOT_AVAILABLE).

VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED).

Result Code:E_FAIL (0X80004005)
Component:ConsoleWrap
Interface:IConsole {6ac83d89-6ee7-4e33-8ae6-b257b2e81be8}
 
VT-x is disabled in the BIOS
This message is all you need to know. The virtualization feature needs hardware support, and that support is not available in every CPU, and can be disabled on those that do offer it in case it was to cause problems (remembering that it was new at one time.) You'll have to look into your BIOS settings, frequently around the "advanced CPU settings" or similar to make sure you enable the feature in order for VirtualBox to be able to run on your PC.
 
Last edited:
Well, I made the change and all booted up ok. I've been cramped for time, so didn't get to all of this right away, I apologize for disappearing. Regardless, I'll bring this back for more SR testing later, still cramped for time.
 
Thanks Scott. I'm running Virtual Box 6.1 on Win10 and ran into a issue when trying to import the image, but I found a solution and I'll share it below for anyone else running 6.1. The error is that the audio driver value "WAS" is unrecognized, and I believe this is due to the image being made in Virtual Box 7. To fix it:

  1. The OVA file you downloaded is a tar file so first extract the contents to disk.
  2. Open the .ovf file in a text editor. Find the tag for AudioAdapter and change the driver value to "DirectSound".
  3. Open the .mf file in a text editor and change the ovf's SHA1 hash to 0ea7c4f2789e1373e3824e5288b548c0dcd50658
  4. In Virtual Box, if you have the appliance import dialog open then close it and retry importing the ovf file.
 
Thanks very much for providing the already-setup .ova environment and drive image!

Another way of getting Spinrite onto C: which seems like it worked well for me just now, a variation on Method One (creating a floppy image) which didn't need a PC. This requies Spinrite 6.1's .img file downloaded from GRC, and the abilty to mounted in your host OS and get at spinrite.exe.

- Mounted spinrite.img in my host OS (mac), saw spinrite.exe there.
- Created a blank virtual floppy disk in VirtualBox, also mounted it in my host OS.
- Copied spinrite.exe from the first virtual image to the virtual floppy image.
- Unmounted virtual floppy image in my OS
- Selected that floppy image in my running SRDOS VM in VirtualBox
- Copied the exe to C: in DOS (`copy A:SPINRITE.EXE C:`)

[note, edited this post for clarity from what was quoted in the reply below]
 
Last edited:
Thanks very much for providing the already-setup .ova environment and drive image!

Another way of getting Spinrite onto C: which seems like it worked well for me just now:

I created a virtual floppy disk in VirtualBox, mounted it in my host OS (mac) and copied spinrite.exe into it (from Spinrite 6.1's .img file downloaded from GRC, which I also mounted in my host OS). After ejecting from my OS, I then selected that floppy image in my running SRDOS VM in VirtualBox and copied the exe to C: in DOS (`copy A:SPINRITE.EXE C:`)
I like that, I’ll add it to the instructions tomorrow