How To: Run SpinRite on a UEFI-only machine (Part 3A of 5 - Linux as base OS)

  • 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
102
29
NOTE: These steps will create a portable Linux environment on a USB flash drive that can be moved from machine to machine as needed.

As noted in Part 1 of this series, one can create a VirtualBox environment suitable for SpinRite within a Linux OS environment. That Linux boot drive must be setup in a particular way. This article will outline how to setup that drive, and how to run VirtualBox and then SpinRite from that drive.

This article is split into 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
    1. Part 3A - Setting up the Linux drive, Installing VirtualBox (this article)
    2. Part 3B - Creating a SpinRite Virtual Machine, Mapping the Host drives to the SR Virtual Machine, Steps to take when moving your Linux drive to a new Target Machine
  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

On your Prep PC (which is running Windows 10 or 11):​

NOTE: Instructions have been updated (as of May 9 2024) for Kubuntu 24.04.1 LTS instead of 22.04.4
  1. Download and install (or use Portable) version of Rufus; MUST USE AT LEAST VERSION 4.5:
    1. https://rufus.ie/en/
  2. Download the Kubuntu flavour of Ubuntu Linux. Get the LTS version 24.04.1 or higher
    1. https://kubuntu.org/getkubuntu/
    2. Get ISO or use the Torrent file to get the ISO
    3. NOTE: versions earlier than 24.04.1 may give an SBAT error if Secure Boot is enabled
  3. Insert your USB drive
  4. Use Rufus with the following options:
    1. Main screen
      1. If your drive is NOT a flash drive, but is an External USB SSD drive, click on "List USB Hard Drives"
      2. Select your USB drive and the Kubuntu ISO
      3. Partition Scheme: GPT
      4. Set Persistent Partition Size to at least 12 GB
        1. The drive will be split between the Persistent Partition and the Partition for the ISO, which needs be at least 10 GB
      5. All other options default, press Start
    2. Rufus will now make your flash drive
  5. Now, go to GRC.com and download your personal copy of SpinRite
  6. Run the SpinRite executable
  7. Use the option to create an IMG file.
  8. By default it's called SpinRite.img, change the name to SPINRITE-FD.img
  9. Copy that file to your 2nd flash drive and put it aside, you'll use it later

On your Target PC (on which you will eventually run SpinRite against its drives)​

A. Getting the OS up to date​

  1. Boot into your firmware settings:
    1. Ensure Virtualization is turned on, if there is a firmware setting for it (might be called VT-X or AMD-V)
    2. Your Secure Boot settings do not have to change, just make a note of whether Secure Boot is On or Off
  2. Boot your PC from the USB using your particular PC's boot option key
  3. You should see at least one entry for the USB
  4. You will boot to the main Kubuntu boot menu; select the first entry from the Kubuntu boot menu, Try or Install Kubuntu
  5. The next screen is a graphical menu to allow WiFi network connection, and for you to decide to Try or Install Kubuntu.
    1. Connect to your WIFi network or select wired Ethernet, whatever is appropriate
    2. You obviously want to Try Kubuntu, not install it!
  6. Once you get to the desktop, ensure you are connected to your WiFi network (or ensure you have Ethernet plugged in and working)
  7. Go to System Settings | Regional Settings and set:
    • Date and Time, set your Time Zone
    • Region and Language, set your Language to American English and hit Apply
  8. Change Power settings so that the system NEVER suspends, goes to sleep or turns itself off
    1. Go to System Settings | Power Management
    2. Energy Saving section
      1. Turn OFF "Screen Energy Saving"
      2. Turn OFF "Suspend session"
      3. Click the "Apply" button
    3. Activity Power Settings section
      1. Define a special behavior
        1. Turn ON "Never turn off the screen"
        2. Turn ON "Never shut down the computer or let it go to sleep"
        3. Click the "Apply" button
  9. Reboot. If the system remembered your settings (WiFi network, etc.), then persistence is working, which is required to proceed
  10. Open the Discover app and click on the bottom left of the menu where it says “Fetching updates”
  11. You should see a list of Updates to apply. Click on Update All in the top right of the window
  12. After all updates are installed, Reboot the system
  13. After reboot, open a Terminal window (called Konsole in Kubuntu)
  14. Enter the following:
    1. sudo snap refresh
  15. Your system is now up to date
  16. Open Firefox and ensure it’s working

B. I have a Mac, is there anything else I need to do?​

My limited testing is that Macs can work from the base Linux drivers; there are no Linux drivers from Apple, but feel free to read up on running Linux on your particular Mac (or any PC!!) to ensure that you have the drivers you need

C. Installing VirtualBox​

Unlike installing on Windows or MacOS, installing VirtualBox on Linux is not straightforward, and varies among the different distributions, mainly due to differing prerequisites (which are not well documented). These instructions are specifically for this Kubuntu release. Virtualbox installation for Kubuntu 24.04 is MUCH easier than it was for version 22.04.
  1. Reference:
    1. https://www.virtualbox.org/wiki/Linux_Downloads
  2. Open a Terminal window (called Konsole in Kubuntu)
  3. You should be in the home directory for the kubuntu user; enter the command:
    1. pwd
  4. Should show:
    1. /home/kubuntu
  5. Make the Virtual Machine directory:
    1. mkdir 'VirtualBox VMs'
  6. From the terminal command line:
    1. sudo systemctl daemon-reload
    2. sudo apt update
    3. sudo apt upgrade
      1. There will probably be no upgrades to apply but it's fine either way
    4. sudo apt install virtualbox
    5. Enter Y when prompted to proceed
  7. If you have Secure Boot On:
    1. The system will throw up a text dialog box telling you that you need a password (at least 8 characters) to generate a signing key. That password must be entered on special screens on the next reboot in order to have VirtualBox work with SecureBoot On.
    2. I used something simple like “spinrite”; whatever you choose, remember it!!
  8. After the install finished, exit the terminal
  9. If you have Secure Boot On, you must now Reboot:
    1. You’ll see the following prompts:
      1. A “Perform MOK management” screen
        1. You may have to press Enter to proceed into MOK Management
        2. Select “Enroll MOK”
      2. At the “Enroll MOK” screen
        1. Select “Continue”
      3. At the “Enroll the key(s)?” screen
        1. Select “Yes”
      4. You’ll be prompted for the password from before; enter it
      5. At the final screen
        1. Select “Reboot”
  10. Now we need to edit the VirtualBox entry on the Application Menu
    1. Find the “VirtualBox” entry in the Application list menu
    2. Right click on it, select “Edit Application”
    3. Select the Application tab
    4. Click on the Advanced User button
    5. In the User section, click the box that says "Run as a different user":
      1. Username: root
    6. Click OK
    7. Click OK
    8. Start VirtualBox by selecting it off the Application Menu
  11. Go to the File | Preferences menu
  12. Change Default Machine Folder to:
    1. /home/kubuntu/VirtualBox VMs
  13. Exit VirtualBox
And now VirtualBox is installed. On to Part 3B, setting up the Virtual Machine and installing SpinRite
 
Last edited:
Thank you so much, Scott, for these incredible instructions! I just successfully ran SpinRite 6.1 on my UEFI-only laptop following your guide :D

Two small corrections:

7.1. There should be two dashes in front of dearmor, otherwise gpg complains "can't open '-dearmor'". Unfortunately, the error message ends with the word "(success)". I suggest people double check if the keyring file is actually created using the following command:
Code:
ls -l /usr/share/keyrings/oracle-virtualbox-2016.gpg

17.5.1. There should be a U after %, otherwise KDE complains "invalid syntax".

Cheers~
 
Last edited:
Thank you so much, Scott, for these incredible instructions! I just successfully ran SpinRite 6.1 on my UEFI-only laptop following your guide :D

Two small corrections:

7.1. There should be two dashes in front of dearmor, otherwise gpg complains "can't open '-dearmor'". Unfortunately, the error message ends with the word "(success)". I suggest people double check if the keyring file is actually created using the following command:
Code:
ls -l /usr/share/keyrings/oracle-virtualbox-2016.gpg

17.5.1. There should be a U after %, otherwise KDE complains "invalid syntax".

Cheers~
Hi @leonfeng, if those two items were my only mistakes, I’m happy! I’ve fixed them both, and thanks for finding them.

Did you create your own Virtual Machine or download my pre-built one? And did your laptop have Secure Boot on?
 
Hi @leonfeng, if those two items were my only mistakes, I’m happy! I’ve fixed them both, and thanks for finding them.

Did you create your own Virtual Machine or download my pre-built one? And did your laptop have Secure Boot on?
I downloaded your pre-built VM because I'm lazy. And I turned off Secure Boot beforehand to keep things a little simpler.