How to Run SpinRite in VirtualBox

How to Run SpinRite in VirtualBox

SpinRite is a popular hard drive maintenance and data recovery software from Gibson Research Corporation, and costs $90 to own. While I haven’t extensively used the software, it has helped me recover data from hard drives when I thought the data was lost. It is a small application, and you also don’t need a powerful PC to use the application.

The once aspect of SpinRite that makes it different from other drive maintenance and data recovery tools is that you are required to boot up your computer using SpinRite to launch the application. SpinRite loads a copy of FreeDOS, detects the disks on your system and then allows you to perform specific scans of the disks.

Of course, if you need to scan a hard drive, you will usually need to connect it to either the IDE your SATA interface within your computer, which requires you to open up computer, and then connect the hard drive to the correct interface so the FreeDOS operating system can find your hard drive. In order for you to connect the drive to the USB port of you computer requires you to load the USB drivers within FreeDOS in order for the hard drive to be detected.

The alternative is to use a virtual system created by software such as VirtualBox to automatically setup and use a hard drive that is connected to a USB port. While the scanning may not be quite a fast, it is much easier to simply connect a hard drive to a USB port and then have SpinRite scan the hard drive in a virtual system.

I outline the steps that you need to follow to run SpinRite in VirtualBox.

SpinRite Running in VirtualBox

Setup the Virtual Drive

In order to scan a hard drive with SpinRite from within a virtual system in VirtualBox, you will first need to create a virtual hard drive. This virtual hard drive will essentially be the hard drive you want to scan. You will not be booting the virtual system from this drive, as this will be handled by SpinRite.

The steps below outline how to create a virtual hard drive.


I am using Windows 7, so the steps below describe what I do on Windows 7. For other versions of Windows, you may need to adjust the steps a bit to get it to work, but the steps should be very similar.

Create the SpinRite ISO

We will need to create the SpinRite ISO file that will be loaded by the virtual machine. This is easily done from within SpinRite:

  1. Run SpinRite and then click the “Create ISO or IMG File” button.
  2. SpinRite

  3. Click the “Save a Boot Image File” button and select the location where you want to save the ISO file.
  4. SpinRite - Save a Boot Image File

  5. Once the image file is created, you will be shown a confirmation message. Click the “Close” button to close the windows.
  6. Click the “Exit” button to close SpinRite.

Get the Hard Disk Number

Before we create the virtual machine, you will need to get the hard disk number for the hard disk you will scan with SpinRite. Use the following steps to get the hard disk number:

  1. Connect the hard disk to your computer, which is called the host machine.
  2. Once the hard drive is connected, you will need to find the disk number. This is easily done with the following steps:
    1. Bring up the Windows Start menu, and enter “Computer Management” in the search box.
    2. From the list of search results, right-click “Computer Management” and then select “Run as administrator” from the menu. Enter the administrator password, if required.
    3. From “Computer Management”, expand the “Storage” item on the left, and then select the “Disk Management” option.
    4. in the middle part of the window you will see a list of drives that are connect to your computer. In the bottom half you will see the disk numbers for you hard drives. In my case, as shown in the image below, I will be scanning “Disk 1” (drive E). You will need to find the disk number for your drive in the same fashion.
    5. Disk Management

Create the Virtual Machine

  1. Once you have the disk number, open the Start menu and enter “cmd” in the search box. Right-click “cmd.exe” from the search results and select “Run as administrator”, and enter the administrator password, if required.
  2. Navigate to the folder where VirtualBox is installed. For me, I would enter the following:
  3. cd C:\Program Files\Oracle\VirtualBox\
  4. Now you will need to create a raw disk of the hard drive you want to scan that will be used with virtual box. The command you need to run is as follows:
    vboxManage internalcommands createrawvmdk -filename "[raw disk filename path]" -rawdisk "\\.\PhysicalDrive[disk number]"

    For example, I will use the following:

    vboxManage internalcommands createrawvmdk -filename "C:\Users\Public\Documents\VirtualBox\Raw Disk Images\laptopdisk.vmdk" -rawdisk "\\.\PhysicalDrive1"
  5. Once you have created a raw disk, you will now need to start VirtualBox by right-clicking on the VirtualBox shortcut and select the “Run as administrator” option.
  6. After VirtualBox is loaded, click “New” in the toolbar.
  7. VirtualBox - New Virtual Machine

  8. In the “Create New Virtual Machine” dialog, click the “Next” button.
  9. In the “VM Name and OS Type” dialog enter the following:
    • Name: Enter a name for your virtual machine.
    • Operating System: Other
    • Version: DOS

    Click “Next” to continue.

  10. VirtualBox - VM Name and OS Type

  11. For memory, you can accept the default or increase it if you wish. For me, I haven’t had any issues with using 32-128 MB of memory. Click “Next” to continue.
  12. VirtualBox - Memory

  13. In the “Virtual Hard Disk” dialog, uncheck “Start-up Disk” because you will be boot the virtual machine using SpinRite. Click “Next” to continue.
  14. VirtualBox - Virtual Hard Disk

  15. If you get a warning message about not attaching a hard disk to the virtual machine, just click the “Continue” button.
  16. You will now be shown a “Summary” window. Click the “Create” button to create the virtual machine.
  17. Once the VirtualBox window is back, click the “Settings” option from the toolbar.
  18. VirtualBox - Settings Option

  19. From the options on the left, click “Storage” and then the “add new attachment” icon.
  20. VirtualBox - Storage Settings

  21. Click the “Add Hard Disk” option.
  22. VirtualBox - Add Hard Disk

  23. Click the “Choose existing disk” button.
  24. VirtualBox - Choose Existing Disk

  25. Select the raw disk in step 3 above and click the “Open” button. The raw disk you created should now appear in the list of storage devices.
  26. Now we will add the SpinRite ISO as a CD-ROM. Click the “add attachment” icon, again.
  27. Click the “Add CD/DVD Device”option.
  28. In the next question dialog, click the “Choose disk” button.
  29. VirtualBox - Choose Existing CD-ROM

  30. Navigate to the SpinRite.iso you create in the first section, select the file and click the “Open” button.
  31. Once the hard drisk and the ISO (CD-ROM) storage devices have been added, they should now appear in the “Storage Tree” list.
  32. VirtualBox - After Adding Storage Devices

  33. Click the “OK” button to close the “Settings” window.
  34. Click the “Start: button from the toolbar to start your virtual machine.
  35. SpinRite should load automatically within your virtual machine. If it doesn’t select “Devices->CD/DVD Devices->(The IDE controller of your CD/DVD you added)->SpinRite.iso” to load SpinRite.
  36. You can now run SpinRite to scan your hard disk.

SpinRite Critical Error Solution

When I tried to run SpinRite to scan my hard drive within a virtual machine, I ran into an issue. SpinRite produced the following error:

Vritual Box - SpinRite Critical Error

The problem appears because Windows appears to have “locked” the hard disk in some manner which prevents the virtual machine from gaining exclusive access to the hard disk. This problem is solved by using the following steps:

  1. Close all applications that are accessing the hard disk.
  2. Once you have the disk number, open the Start menu and enter “cmd” in the search box. Right-click “cmd.exe” from the search results and select “Run as administrator”, and enter the administrator password, if required.
  3. At the command prompt, run the following command:
  4. The “DISKPART” tool will load, and show “DISKPART>” as the prompt.
  5. Using the same disk number as above, enter the following:
    select disk [hard disk number]

    For example, in my case the hard disk was “disk 1”, so I would use the following command:

    select disk 1

    A message should be displayed that your disk has been selected. The following commands will now only act on that disk.

  6. Enter the following command to take the disk offline:
    offline disk

    A confirmation message should be displayed.

  7. Next we will clear the read-only attribute using the following command:
    attributes disk clear readonly

    A confirmation message should be displayed.

  8. Type the following to exit the DiskPart utility:

Once you have completed running the above command, you should now be able to scan the hard disk with SpinRite from within a virtual machine within VirtualBox.

37 Responses to “How to Run SpinRite in VirtualBox”

  1. John says:

    Thanks! I had spent the better part of a day wrestling with VirtualBox and had learned that setting up SpinRite to run in VirtualBox on a USB drive is well beyond my capability. Your post is clear; it worked; it even dealt with the SpinRite error message.

    The USB approach is slow but it works(!). Now here’s hoping Steve finishes 6.1 soon.

  2. Bill says:

    Ok I need some help. It looks like virtual box has maybe updated since this was written. I’m at step 15, and instead of that window i get a more traditional file selection window in which it seems I’m to click add, and navigate to the .vdmk file and use that. Well, when I attempt to do so I’m greeted with “failed to open the disk image file C:\users\blah blah\file.vmdk”
    expand details and “could not find the file for the medium ‘file location’ (VERR_FILE_NOT_FOUND) but I can find it, it’s right where I told it that it was, I’m looking at it right now. I know I’m somehow messing up, but for now I’m still blaming the computer lol, what am I doing wrong?

  3. Michael Lowden says:

    VirtualBox 6.0.2 & Windows 10 — update (fixed for me)
    1. follow the above (run everything as Admin) except I did “Unkown OS” instead of “DOS”
    2. when adding the VMDK you have to mount it under IDE (next to the CD-ROM)
    3. ensure you “OFFLINE” the drive with DiskPart (without this, SpinRite will only scan the header in a matter of 1 second and finish happily)
    4. in boot-order, uncheck Floppy, and put CD above HardDisk
    5. wait, wait, wait

    • Bill says:

      When I try to add the vdmk I am greeted with this lovely message. Any advice? Tried to offline with diskpart first, nope!

      Failed to open the disk image file C:\Users\xxx\VirtualBox VMs\Spinrite\seagate.vmdk.
      Could not find file for the medium ‘C:\Users\xxx\VirtualBox VMs\Spinrite\seagate.vmdk’ (VERR_FILE_NOT_FOUND).
      Result Code: VBOX_E_FILE_ERROR (0x80BB0004)
      Component: MediumWrap
      Interface: IMedium {ad47ad09-787b-44ab-b343-a082a3f2dfb1}
      Callee: IVirtualBox {d0a0163f-e254-4e5b-a1f2-011cf991c38d}
      Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

  4. Matt says:

    I just wanted to add a note of thanks for the instructions, and also to make aware of an issue that I encountered: when I set up the VM it automatically connected the USB to ATA/ATAPI bridge to the VM; as a result when SpinRite booted up it was unable to see the external drive. After removing this connection in the VM settings it seems to work fine (note this was after repeating the instructions repeatedly unable to see what I’d done wrong or any other obvious reason why it wasn’t working!).
    Also I have to open VirtualBox with admin privileges otherwise it has an issue connecting to the raw disk vmdk.

  5. mike says:

    I have successfully created virtual box & can load spinrite but not able to get the drive recognized. Every time I type or copy the commands I get this error:
    C:\Program Files\Oracle\VirtualBox>vboxManage internalcommands createrawvmdk -fi
    lename “C:\Users\Public\Documents\VirtualBox\Raw Disk Images\laptopdisk.vmdk” -r
    awdisk “\\.\PhysicalDrive2”
    VBoxManage.exe: error: VMDK: could not create new file ‘C:\Users\Public\Document
    s\VirtualBox\Raw Disk Images\laptopdisk.vmdk’
    VBoxManage.exe: error: Error code VERR_PATH_NOT_FOUND at F:\tinderbox\win-5.1\sr
    c\VBox\Storage\VMDK.cpp(3404) in function int __cdecl vmdkCreateRawImage(struct
    VMDKIMAGE *,struct VBOXHDDRAW *const ,unsigned __int64)
    VBoxManage.exe: error: Cannot create the raw disk VMDK: VERR_PATH_NOT_FOUND
    VBoxManage.exe: error: The raw disk vmdk file was not created
    The drive I want to scan is my SD Card slot. I need to run spinrite. I know I can use it the conventional way but am really intrigued the the idea of have it run while using my windows laptop for other things. Not sure where to go or what else to try. Any help is appreciated. Funny thing is I can see the drive letter E in the storage section, Its listed as floppy device 1: Host Drive ‘E:’ this is listed as drive 2 in computer managment.

    • mike says:

      Looks like i finally got it….sort of. it only scans a portion of the sd card the other portion says there’s some sort of issue. i used the diskpart command but that doesn’t help.
      I tried inserting another sd card but the info now doesn’t match. it recognizes the card as 32 gig but it has info still there from the original 1 gig card.

    • jay says:

      Did you create the folders he has? I just used “C:\Users\Public\laptopdisk.vmdk for the file path. The error is saying that it does not see the path.

      • Bill says:

        I type the commands in cmd with the file path copied directly from my file browser, though I’m unsure about “laptopdisk.vmdk,” I’m assuming this is supposed to create that file. I’m using seagate.vmdk instead in cmd but that file doesn’t already exist, should it? How does one create it if not “through this?” I’m like ten minutes away from just googling “free data recovery tool” and scrapping this entire thing, people say it’s the best well it’s not if it won’t DO it lmao. Every time I try the command with the copied file path minus the .vmdk it tells me “cannot open raw disk ‘\\.\ PhysicalDrive1’: VERR_ACCESS_DENIED and the “raw disk file was not created.”

  6. vic says:

    I found this really helpful, thank you so much, may Eru Eluvatar bless you.

    BTW I could not analyze my hard disk using Spinrite (can for benchmarking only though) until i converted the hard disk from GPT disk to MBR Disk.

    Thanks again

    • Paul Salmon says:

      Hi vic,

      I don’t think SpinRite works with GPT which is why you needed to change to MBR. I think Steve Gibson will be making SpinRite compatible with GPT in the next release, though.

  7. Robert Faulkner says:

    I am trying t o modify your great instructions to suit my needs, here is my modification

    vboxManage internalcommands createrawvmdk -filename “vboxManage internalcommands createrawvmdk -filename “e:\vms\Raw Disk Images\laptopdisk.vmdk” -rawdisk “\\.\PhysicalDrive1″

    I am getting an invalid parameter ‘Disk”, can you t ell me where my mistake is, thanks in advance

    • Paul Salmon says:

      Can you try running the following command:

      vboxManage internalcommands createrawvmdk -filename "e:\vms\Raw Disk Images\laptopdisk.vmdk" -rawdisk "\\.\PhysicalDrive1"

      The command you entered in your comment has too many vboxManage commands. You have two and there should be only one.

  8. David says:

    Thank for the very clear instructions. I needed to run Spinrite on a laptop hard drive but the only newer computer with sata connections I have access to isn’t mine and I did not want to tie it up for hours. So I logged into another user account with fast user switching, followed your instructions and let Spinrite run for 28 hours. The computer is always on so I just switched back to the regular user account so they could use it normally.

    The only part of the process that is kind of a mystery to me is using the raw disk to access the hdd hooked up externally via usb. At first I thought Spinrite would be working on a copy of the hdd, but that didn’t make sense. I guess the raw disk is a pointer to the physical disk.

    Thanks again!

  9. Leonard B. says:


    You are the ultimate lifesaver. I spent days and dozens of hours trying to use DOS with USB drivers to load SpinRite through a USB thumbdrive (doesn’t work…) I found this method and within ten minutes had SpinRite running. You should have Steve Gibson link this in his SpinRite FAQ. It would have saved me dozens of hours.

    Win7 64bit Home
    SpinRite V6.0
    VirtualBox V4.3.16 r95972
    2TB WD HDD via USB 3.0

    • Paul Salmon says:

      Hi Leonard,

      I had the same issue with getting USB and DOS to place nicely. I decided to switch to a virtual machine rather than connecting the drive internally in my computer. I believe it is slower through a virtual machine, but I’d rather have slower than not being able to scan at all.

  10. Guillermo says:

    I have never run a Virtual Machine, so I don’t know much about this, but Steve says that it is supposed to work and I guess that all of you have tested that too.
    Do you understand any of the error codes? Do you have a suggestion for me to get it running?

    I created a Virtual Machine with the name “Spin”
    After doing what is instructed here, I get the following error window with the only option “Abort”
    VirtualBox – Error In supR3HardenedWinReSpawn
    Error relaunching VirtualBox process: 5
    Command line ‘81954AF5-4D2F-31EB-A142-
    B7AF187A1C41-suplib-2ndchild –comment Spin–
    startvm aca769c9-2bbd-4c96-b707-885f45945b0a –no-
    startvm-errormsgbox’ (rc=-104)

    And After that window I get another one that reads
    VirtualBox – Error ?

    Failed to open a session for the virtual machine Spin.

    The virtual machine ‘Spin’ has terminated unexpectedly during startup with exit code 1.

    Result Code: E_FAIL (0x80004005)
    Component: Machine
    Interface: IMachine {480cf695-2d8d-4256-9c7c-cce4184fa048}

    • Paul Salmon says:


      This seems to be a well-known issue with the latest version of VirtualBox. You can read about the issue on these threads:

      It seems the issue is related to security software and changes to Windows. People have reported being able to run their Virtual machines by uninstalling the current version and installing the previous version – 4.3.12.

      • Guillermo says:

        Thank you for the prompt response, SpinRite is working right now thanks to your reply.

        • Scott says:

          Can I ask, what sort of speeds your getting with spinrite in virtual box ? I’m running via USB 3 but the speed on a 1 TB drive was estimated at over 100 hours, on the USB two system, over a 1000. What speeds and size drives are you running ? I was specifically trying to run this so I avoided the divide by zero issue I was getting when running large drive tests on a system.

          • Paul Salmon says:

            I find that SpinRite doesn’t work as fast in a virtual machine, and also SpinRite doesn’t take full advantage of newer technologies, which Steve Gibson is updating for the next release of SpinRite. By using a virtual machine, however, I can still use my computer while SpinRite works in the background, so there is a trade-off.

        • Paul Salmon says:

          No problem, I’m glad I could help.

      • Chris says:

        For some reason I get the same critical error on 4.3.12, and the VM won’t boot if the disk is offline even though it isn’t the startup disk.

        Flagging the disk as online makes it boot, but I get that spinrite error.

        I can’t help but think windows is doing something on the disk in the background preventing the VM from having exclusive access, despite my best efforts.

        • Chris says:

          OK… I am incredibly forgetful and silly. I have another external drive I used to use for VMs, and my default folder for new VM configs was on that external drive letter, which the drive I want to test used… so the VM itself was running off of the drive I was attempting to test.

          Now that I’ve moved the VM to another drive, I can easily offline the disk as described in the article and it works GREAT! Thanks so much for this, now that I’m a laptop user this will be my go-to method of using SpinRite.

  11. Scott says:

    Great guide, thank you, I finally have it running. I downloaded the latest virtualbox, and a few of the steps seem to have change, but I got through it, I’m using a USB3 hub connected to a laptop on a USB 2 interface, it seems incredibly slow though,
    Just checked for this 1.5 TB drive I have 1167 hours to go ! yikes. I have to get this faster. Win 8.1 modern laptop, CPU is only at 60 % 4 GB ram, , Off to bed and lets see where this goes in the morning.

  12. Jonathan Harker says:

    Excellent post! I managed to scan a usb connected external drive with no problems. Many thanks!

  13. Jim D. says:

    Following your procedure got spinrite running in virtualbox. However, I cannot get the prep work (creating the .vdmk file) done. Error I am seeing is VERR_FILE_NOT_FOUND. Plowing through the VB documentation, but not seeing the light, yet.

  14. Dave B says:


    I tried something similar, after trialing Spinrite in a VBox VM* as described, where it worked well enough. I then after shutting down the VM, connected another similar drive to test.

    (* running VBox on Windows 7 home premium 32 bit.)

    However, when the VM was started, Spinrite reported the “hard drive” as an empty volume and refused to do anything with it.

    As it is not too involved (can’t help thinking a batch file could be used for some of it) I scrubbed the VM, and rebuilt from scratch. But this time, when doing the command line stuff to release the attached (via generic USBATA device) drive from Windows, with the diskpart command “offline disk”. The drive itself parked and powered down!

    When the VM was started, and Spinrite woke up, it could see no drives at all.

    Now, I’ve not had the time to fiddle to explore this in detail, so anything could have happened. The first drive I tried (with known “hard” errors, that were found just fine) I guess does not support being told to power down by a command sent via it’s interface, or whatever Diskpart sends.

    Still, it’s a nice “how to” in any case, and I still learn’t something. Thanks.



    • Paul Salmon says:

      Those are interesting results, for sure. I know hard drives can be finicky at times, but it appears how they are connected to a VM can also be finicky. There must be something connecting the drive to the virtual disk in the VM software.

  15. Mark Hions says:

    Paul, there’s a small glitch in Step 3 of “Create the Virtual Machine”.

    Trying only to avoid typing, I copied your sample code into the cmd window and changed the parameters. However, I kept getting errors because your double quotes are actually inverted commas, or smart quotes. Once I changed what looked like double quotes into actual double quotes, everything was fine.


    • Paul Salmon says:

      Thanks, Mark. I always try to avoid the smart quotes where I can, but this time they were displayed as such in the browser – the post had normal quotes. I have corrected the issue, so hopefully no one else runs into the issue.

  16. Michael says:

    Question about the Raw Disk

    When I create the Drive2,vmdk file to link it to Hard Drive #2, will it always be linked to the hard drive that’s in position #2, or is it linked to that specific hard drive, currently located in position #2.

    I’m asking cause I’m planning on moving my hard drives around. So I’m going to remove the current drive #2, and insert a new one. Windows will identify the new hard drive and it will now be in position #2. So will the Drive2.vmdk file still work? I plan on scanning the drive, then removing it and installing another one. So will the Drive2.vmdk file still work for all subsequent drives in position #2,or would I have to repeat that step for each hard drive that I add, even though they’re in the same position?

    Thank you

    • Paul Salmon says:

      That is a good question, and one I haven’t tested. You can always connect the drive and see if SpinRite displays the stats for the newly connected drive. If it doesn’t then you should be golden.

      • Dave B says:


        I posted a comment by hitting reply to your reply to Michael’s question.

        The comment threading seems broken, as that comment/reply is shown at the top of the list, not under yours that I was replying to.

        Dave B.

    • Micheal,

      The way I do it to prevent any problems is create a batch file with all I need and when I’m finished. I have another patch file to clear up the directory. This is the best way to prevent from using another drive letter that is no longer being used!

      Echo OFF
      cd C:\Program Files\Oracle\VirtualBox\
      EcHO Who Did this? Not Me
      vboxManage internalcommands createrawvmdk -filename "[Directory]%1" -rawdisk "\\.\PhysicalDrive%2
      ECHO BACK to the old Directory!
      cd [Directory]
      ECHO Don't Forget to RUN VB_VMDiskDel to remove the file when your Done with the VIRTUAL Machine!
      Echo ON

      Just remember to make a directory that you want these files to go in and put this batch file there along with the VB_VMDISKDel.BAT in there also!


      Echo off
      Echo Time to Clean up these Files!
      del *.VDI
      Del *.OVA
      Del *.VHD
      Del *.OFD
      Del *.VMDK
      Echo ALL Cleaned up. If you used another extensions besides the common Virtual Box extensions then you will have to Manually delete those!
      Echo on

      These both are in my in a folder on my hard drive and you will just need to create a folder for these two batch files and place them there. Editing where the directory is and your will be all set!


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.