Dual Boot Batocera
Dual Boot Batocera
It is recommended to boot Batocera off of a USB drive and to use your BIOS boot selection menu to
switch between Batocera and other operating systems that may already be on other drives. You can
still use drives with other operating systems on them to host your userdata such as ROMs, BIOS files,
saves, etc. However, some people prefer to have Batocera directly installed on the main hard drive
alongside another pre-existing OS.
Ordinarily, Batocera utilizes Syslinux to boot, which is configured to only boot Batocera. Thus, for
most dual boot setups we will be utilizing GRUB to show a boot selection menu after BIOS has loaded
instead.
In case you install Batocera on your hard-drive, you may want to rename the BATOCERA
partition to something unique like BATOPC. If you do, edit the grub.cfg file below to
have label=BATOPC instead of label=BATOCERA. This allows you to still boot using
Batocera installed on a USB without worry that the hard-drive will always take priority
due to sharing the same label.
You will likely have to wipe your hard drive's contents to do this, so no data can be carried over from
a pre-existing Windows installation. To dual boot Windows and Batocera on the same drive:
1. Partition your intended drive to begin with a large physical NTFS partition for Windows. It is
recommended to use a GPT partition table. The rest of the free space will be used for Batocera.
2. Install Windows via your preferred method. It will re-partition the existing NTFS partition into
smaller logical partitions, but should retain its total size.
3. In the empty space, add a new physical FAT32 partition around 8GB in size (can be larger if you
want, but not smaller) labelled “BATOCERA”. This will be used for Batocera's boot files.
4. Immediately after the BATOCERA partition, create another partition to fill up the rest of the
drive. This will be used as the “internal” userdata. Check out which filesystem to use. If you'd
like to allow Windows to access the userdata partition, it is recommended to use exFAT or NTFS.
BTRFS can also work, but requires kernel drivers for Windows to be installed to allow access to
it.
5. Rename the folders in Windows' EFI partition from EFI/Boot to EFI/Boot_backup
6. Download this ZIP file and extract it.
7. Copy the contents of EFI_WINDOWS to Windows' EFI partition. The BOOT folder should be in the
same spot as the old Boot folder was.
8. Boot into Batocera from a USB drive, run blkid /dev/sda# (where sda# is the Windows EFI
partition) and note down the ID of the partition.
grub.cfg
set default=0
set timeout=5
menuentry "batocera.linux" {
search --set=root --label BATOCERA
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0
vt.global_cursor_default=0
initrd /boot/initrd.gz
}
Here are some examples on how to dual boot Batocera with popular Linux distributions like Ubuntu or
Linux Mint.
Ubuntu Linux
Install Ubuntu
Follow your favorite method for the initial Ubuntu install, leaving extra unpartitioned space for
Batocera and its userdata.
Batocera partitions
1. While booted into Ubuntu, create /etc/grub.d/50_batocera with the following content:
50_batocera
#!/bin/bash
You will now be presented with the GRUB menu upon booting, allowing you to select either Batocera
or Ubuntu to boot into.
Older versions of Ubuntu may need grub-customizer to do the above. More info on
this earlier version of the page.
For other distributions like Linux Mint 19.03, you can use the following method. It also works for MX
Linux, all mentions of Linux Mint also refer to MX Linux in this section.
Follow your favorite method for the initial Mint install, leaving extra unpartitioned space for Batocera
and its userdata.
Batocera partitions
15_batocera
#! /bin/sh
if test -n "${BATOCERA_UUID}"
then
echo "Image batocera found on ${BATOCERA_UUID}" >&2
cat <<EOF
menuentry "batocera.linux" {
insmod fat
search --no-floppy --fs-uuid --set=root ${BATOCERA_UUID}
linux /boot/linux label=BATOCERA console=tty3 quiet loglevel=0
vt.global_cursor_default=0
initrd /boot/initrd.gz
}
EOF
fi
The file can also be automatically downloaded with the following command:
[...]
Image batocera found on 3377-44C4
[...]
3. Reboot
You will now be presented with the GRUB menu upon booting, allowing you to select either Batocera
or Linux Mint to boot into.
Ventoy
https://www.ventoy.net/en/index.html
Technically, this isn't really dual-booting, but booting a static image already loaded onto your drive's
filesystem as its own mounted filesystem. It can ease the process of updating the image, however this
is probably unnecessary as Batocera itself has its own updating tool. Nonetheless it could be useful
for machines that otherwise don't have an internet connection and have to rely on another one to
update or machines that absolutely refuse to boot via conventional manners.
By default, Batocera's userdata partition is only 512MB before expanding, obviously not large enough
to do anything. Ventoy's boot process prevents Batocera from seeing the drive as having any
available free space, so auto-expansion on the first boot never occurs. This can be solved by either
only mounting Batocera's boot partition (thus making the next immediate partition the userdata
partition, whatever that may be) or by running the following (replace # with the number of GB you
want in total, including the boot partition):
gparted /dev/loop *
From:
https://wiki.batocera.org/ - Batocera.linux - Wiki
Permanent link:
https://wiki.batocera.org/dual_boot_ubuntu_batocera.linux?rev=1655020121