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.

Unlimited data backup with BackBlaze

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.

Note

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:
    diskpart
  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:
    exit

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.

PG

About Paul Salmon

Paul Salmon is the founder of Technically Easy. He is a an experienced PC user, and enjoys solving computer-related problems that he encounters on a regular basis.

Facebook | Twitter | Google+

Opt In Image
Don't Lose Your Memories
Backup an unlimited number of photos and files with BackBlaze!

Unlimited storage.
No storage, file size or bandwidth limitations.

Restore from anywhere.
Just need an Internet connection - PC, Mac, iOS, and Android.

External hard drive support.
Backup files that are stored on an external hard drive.

Data is secure.
Files are encrypted locally and sent over a secure SSL connection.

Automatic and continuous backup.
Never worry about forgetting to backup a file - ever.

 

Data Recovery

22 Comments

  1. David
    Posted September 26, 2014 at 7:09 pm | Permalink

    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!

  2. Leonard B.
    Posted September 14, 2014 at 2:45 am | Permalink

    Paul,

    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

    • Posted September 15, 2014 at 8:18 am | Permalink

      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.

  3. Guillermo
    Posted August 11, 2014 at 12:56 am | Permalink

    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}

    • Posted August 11, 2014 at 9:48 am | Permalink

      Hi,

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

      https://forums.virtualbox.org/viewtopic.php?f=6&t=62615

      https://forums.virtualbox.org/viewtopic.php?f=25&t=62618

      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
        Posted August 13, 2014 at 1:58 am | Permalink

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

        • Scott
          Posted August 13, 2014 at 2:23 am | Permalink

          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.

          • Posted August 13, 2014 at 8:09 am | Permalink

            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.

        • Posted August 13, 2014 at 8:07 am | Permalink

          No problem, I’m glad I could help.

      • Chris
        Posted November 2, 2014 at 6:57 pm | Permalink

        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
          Posted November 2, 2014 at 8:30 pm | Permalink

          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.

  4. Posted June 18, 2014 at 6:36 am | Permalink

    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.

  5. Jonathan Harker
    Posted May 9, 2014 at 4:28 pm | Permalink

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

  6. Jim D.
    Posted March 9, 2014 at 8:39 pm | Permalink

    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.

  7. Dave B
    Posted February 17, 2014 at 6:38 am | Permalink

    Hi.

    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.

    Regards.

    DaveB.

    • Posted February 17, 2014 at 9:14 am | Permalink

      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.

  8. Mark Hions
    Posted February 4, 2014 at 9:15 am | Permalink

    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.

    Thanks

    • Posted February 4, 2014 at 9:30 am | Permalink

      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.

  9. Michael
    Posted February 1, 2014 at 1:35 pm | Permalink

    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

    • Posted February 3, 2014 at 11:12 am | Permalink

      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
        Posted February 17, 2014 at 6:41 am | Permalink

        Paul.

        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.

        • Posted February 17, 2014 at 9:10 am | Permalink

          Interesting. This comment appears correctly. I’ll have to keep an eye on the commenting system. Thanks.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting