If you’re looking to set up a dual-boot system with Batocera Linux and Windows, you’ll need to use rEFInd, a versatile boot manager. Installing rEFInd on Batocera can be a bit more challenging compared to regular Linux distributions, mainly because Batocera is a read-only, appliance-style OS. However, with a few manual steps, you can get dual-booting with Windows and Batocera (or another Linux system) while enabling Secure Boot.
This guide will walk you through the installation process of rEFInd and how to set up your dual-boot system with Windows and Batocera Linux.
Prerequisites
Before you begin, make sure your system meets the following requirements:
- A system with multiple OS installed (whether on the same drive or separate drives).
- UEFI system (not legacy). You can verify your system’s boot mode by following this guide: How to Check if Windows is Using UEFI or Legacy.
- Secure Boot enabled in your BIOS/UEFI settings.
- Access to a PC with another Linux distro installed, such as Ubuntu or Debian.
- This is required if you are dual-booting Windows with Batocera.
- This is optional if you have a different Linux distribution installed, like Ubuntu.
Example Setup:
- Two drives: One with Windows 11 and the other with Batocera.
- Secure Boot enabled on both systems.
Step 1: Install rEFInd on Batocera
- Boot into your Linux distro and open the Terminal.
- Remount Batocera’s system directories with read-write (rw) permissions: Open a terminal and run the following commands:
mount -o remount,rw / mount -o remount,rw /boot - Identify and mount the EFI partition:
a. To identify your EFI partition, run:
Look for thelsblk -f/boot/efipartition. If it’s not mounted, create a mount point and mount it:
b. Replacemkdir /mnt/efi
mount /dev/sdX1 /mnt/efi/dev/sdX1with the actual partition name for your EFI partition. - Download rEFInd: Download the latest rEFInd package by running:
wget https://sourceforge.net/projects/refind/files/0.14.2/refind-bin-0.14.2.zip
unzip refind-bin-0.14.2.zip - Run the rEFInd install script: Execute the following command to install rEFInd:
./refind-install --shim /boot/EFI/batocera/shimx64.efi
Step 2: Sign the rEFInd and Batocera Kernel Files
Since Batocera doesn’t have the necessary signing tools, you’ll need to manually sign the rEFInd and Batocera kernel files using sbsign. You have two options for this:
Option 1: Sign Files on Another Linux System
- Copy
refind_x64.efifrom Batocera to a USB flash drive. - Boot into a different Linux system (e.g., Ubuntu or Debian).
- Sign the
refind_x64.efifile on this system using the following command:sbsign --key /path/to/refind_key.pem --cert /path/to/refind_cert.pem --output refind_x64.efi /path/to/refind_x64.efi
Option 2: Sign Using a Live Linux USB
- Boot into a live Linux USB (e.g., Ubuntu or Debian).
- Sign the
refind_x64.efifile using the samesbsigncommand as in Option 1.
Step 3: Copy Signed Files Back to Batocera
Once the rEFInd files are signed, you need to copy them back to your Batocera system:
- Copy the signed
refind_x64.efifile to /boot/EFI/refind on Batocera, replacing the existing unsigned file. - Copy the signing keys (
refind_cert.pemandrefind_key.pem) to the/boot/EFI/refind/keysdirectory.
Step 4: Enroll Secure Boot Keys
To enable Secure Boot, you must enroll the keys into your BIOS/UEFI settings.
- Reboot your system and enter the UEFI/BIOS settings.
- In the Secure Boot section, enroll the following files:
refind_x64.efishimx64.efimmx64.efi
Step 5: Reboot into rEFInd
- Save the changes in the BIOS/UEFI and restart your system.
- Upon reboot, your system should now boot into rEFInd, allowing you to select between Windows and Batocera (or your chosen Linux distro).
Troubleshooting Tips
- If rEFInd doesn’t show up after rebooting, ensure that the Secure Boot keys were properly enrolled in the BIOS/UEFI settings.
- If you run into issues signing the EFI files, double-check that sbsign is installed on the Linux system you’re using to sign the files.
Conclusion
By following these steps, you should now have a functional dual-boot system with Batocera Linux and Windows, using rEFInd as your boot manager. You’ve also enabled Secure Boot to ensure your system remains secure. Enjoy the flexibility of accessing multiple operating systems on a single machine!
