🎮 Batocera

🎮 Batocera#

Install Batocera in a VM#

To install the Batocera distribution in a virtual machine (VM), follow these steps based on the available guides:

  1. Download and Prepare the Image: Obtain the Batocera image file from the official website, typically in the .img.gz format Extract the compressed file using a command like gzip -dk batocera-x86_64-*.img.gz to get the raw .img file

  2. Resize the Image (Optional): If you need more storage space for games and BIOS files, expand the image size using truncate -s 16G batocera-x86_64-*.img (adjust the size as needed, e.g., 32G, 64G)

  3. Create the VM:

    • Use a virtualization platform such as Proxmox VE, VirtualBox, or QEMU.

    • When creating the VM, do not use a bootable ISO; instead, import the .img file directly as a disk

    • For Proxmox VE, use qm importdisk <vmid> batocera-x86_64-*.img <storage name> to import the image

    • Ensure the VM uses the q35 machine type (not i440fx), as it is required for PCIe passthrough and proper functionality

    • Set the OS type to Linux (64-bit) and disable secure boot

  4. Configure Hardware:

    • Remove any default disk or CD/DVD drive, as Batocera uses a raw disk image, not an ISO

    • Assign at least 2048 MB of RAM and 2–4 CPU cores depending on your system and emulator needs

    • Use the e1000 network adapter instead of virtio, as Batocera does not recognize virtio drivers

    • For storage, configure the imported image as a SATA or SCSI disk with SSD emulation and Discard enabled to improve performance and disk management

  5. Boot Configuration:

    • In the VM settings, ensure the boot order prioritizes the virtual disk (e.g., SATA or SCSI) over other devices

    • For Proxmox, add custom boot arguments to mount the image as a removable USB device for booting, using commands like -set drive.drive-scsi0.readonly=on, -drive, and -device usb-storage

  6. Optional: GPU Passthrough (Proxmox):

    • To enable full graphics performance, assign your physical GPU to the VM via PCI passthrough

    • This requires the VM to use q35 machine type and the GPU to be unbound from the host

  7. Start the VM:

    • Once configured, start the VM. Batocera will boot directly from the imported image

    • The default login credentials are root with password linux for SSH/SFTP access

  8. Add Games and BIOS:

    • Use the file manager or network sharing (e.g., SMB/NFS) to transfer ROMs and BIOS files to the appropriate folders within the VM

    • ROMs should be placed in the roms directory, organized by system

For detailed setup instructions, refer to the official Batocera wiki, which provides step-by-step guidance for running Batocera in a VM using QEMU