How to upgrade Brainux to Debian 12:
How to Upgrade Brainux to Debian 12
1: Mount the microSD card in VirtualBox
First, make the host recognize the SD card as a block device and pass it to the virtual machine.
(For Linux or macOS hosts)
1. Insert the microSD card into the PC.
→ The host OS will recognize it as /dev/sdX or /dev/mmcblkX.
(On Windows hosts it will appear as \\.\PhysicalDriveX)
2. Check the device name using:
code:check_device
lsblk
3. Register the SD card as a “raw disk” in VirtualBox.
Example (Linux host):
code:linux
VBoxManage internalcommands createrawvmdk -filename ~/sdcard.vmdk -rawdisk /dev/sdX
Example (Windows host):
code:powershell
VBoxManage internalcommands createrawvmdk -filename "C:\Users\YourName\sdcard.vmdk" -rawdisk \\.\PhysicalDriveX
4. Add the created VMDK file to the VM’s storage:
Open VirtualBox Manager
Go to VM Settings → Storage → Add Existing Disk
Select sdcard.vmdk
5. Now the guest OS will detect the microSD as a regular disk (e.g. /dev/sdb).
⚠️ Note:
Requires administrator/root privileges.
Be very careful: misconfiguration can destroy the SD card contents on the host.
Method 2: Use a USB card reader (safer & recommended)
1. Insert the microSD into a USB card reader.
2. In VirtualBox Manager → VM Settings → USB, add a USB device filter for the card reader.
3. Start the VM.
→ The guest OS will directly recognize the microSD as a USB device.
This avoids raw-disk access and is safer.
2: Mount the rootfs and chroot into it
1. Create a mount folder:
code:create mount folder
sudo mkdir /mnt/rootfs
2. Find the rootfs partition on the microSD:
code:check sdcard
lsblk
(e.g. in my case, it was /dev/sdb2)
3. Mount it:
code:mount rootfs
sudo mount /dev/sdb2 /mnt/rootfs
4. Enter the chroot:
code:enter_chroot
sudo chroot /mnt/rootfs /bin/bash
3: Update sources.list
Edit the sources list:
code:edit_sources
sudo nano /etc/apt/sources.list
Replace with the following repositories:
code:sources.list
# --- Debian 12 (Bookworm) Official Repositories ---
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
# --- Debian 12 Bookworm backports ---
deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware
# --- Archive (for older packages) ---
deb http://archive.debian.org/debian bookworm main contrib non-free non-free-firmware
deb-src http://archive.debian.org/debian bookworm main contrib non-free non-free-firmware
⚠️ For archive.debian.org, repository signatures are often expired.
You need to disable validity checks:
code:disable_check
echo 'Acquire::Check-Valid-Until "false";' | sudo tee /etc/apt/apt.conf.d/99ignore-valid-until
4: Perform the Upgrade
code:upgrade
sudo apt update
sudo apt upgrade
sudo apt full-upgrade
Exit the chroot once. Then re-enter and confirm the upgrade with:
code:check_version
lsb_release -a
If it shows bookworm, the upgrade was successful.
5: Clean up old packages
Finally, remove unnecessary packages:
code:remove
sudo apt --purge autoremove
✅ Done — your Brainux system should now be upgraded to Debian 12 (Bookworm).