While Bluetooth keyboards are very common and often have a button to switch between multiple devices, I came across two major limitations. First, I sometimes need to access the BIOS/UEFI, which is not possible with a Bluetooth keyboard. Second, I use a single keyboard across three computers, one of which is dual-boot. Because the dual-boot machine acts as two separate devices, I have run out of available slots on my keyboard, which can only switch between three devices.
Problem 1: Using Bluetooth keyboard with a multi-boot PC
Problem 2: Accessing BIOS/UEFI with a Bluetooth keyboard
Problem 1: Bluetooth support is initialized by the OS, not by the firmware (BIOS/UEFI) or bootloader. Each OS maintains its own Bluetooth stack.
Problem 2: Bluetooth pairing is tied to the OS, not the hardware (PC). BIOS/UEFI lacks Bluetooth drivers.
Both Problems could be addressed by running Bluetooth-to-USB HID Bridge for Raspberry Pi (B2U) on one of the supported Raspberry Pi boards: Zero W, Zero 2 W, 4B, or 5.
Here is how to set it up on the Raspberry Pi Zero 2 W:
- Flash "Raspberry Pi OS (64-bit)" to a microSD card using Raspberry Pi Imager.
- Insert microSD card to the Raspberry Pi Zero 2 W (Pi).
- Plug a USB keyboard and mouse into the Pi's micro USB port labeled "USB" using a USB OTG adapter and/or hub if needed.
- Connect a display to the Pi via mini HDMI cable.
- Connect the power supply to the Pi's micro USB port labeled "PWR_IN".
- Configure the Pi and connect to your Wi-Fi.
- Configure remote access via
xrdpusing Terminal:sudo apt update sudo apt upgrade sudo apt install xrdp sudo adduser xrdp ssl-cert
- Disable auto-login: Control Center → System → Uncheck "Auto-login as current user".
- Check hostname (
hostname) or IP address (hostname -I) of the PI (note both outputs for later). - Reboot the Pi with
sudo rebootor via the GUI. - Unplug the USB keyboard and mouse and disconnect the display (now that remote access is configured).
- Access the Pi via Remote Desktop Connection (Windows RDP client). Use noted hostname or IP address as "Computer".
Optional
Disable "Authentication is required to refresh the system repositories" pop-up window asking for your credentials after logging in.- Open the Terminal within the RDP session and create a rules file:
sudo nano /etc/polkit-1/rules.d/46-allow-update-repo.rules
- Paste the following configuration:
/* Allow system refresh without authentication xRDP Session */ polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.packagekit.system-sources-refresh" && subject.isInGroup("sudo")) { return polkit.Result.YES; } });
- Save and close (
Ctrl+O,Enter,Ctrl+X) - Restart Polkit:
sudo systemctl restart polkit
- Open the Terminal within the RDP session and create a rules file:
- Login to the Pi.
- Pair the Bluetooth keyboard via
bluetoothctlor simply the GUI Bluetooth manager.If Bluetooth does not work
- Either try to restart it:
sudo systemctl restart bluetooth && sudo systemctl enable bluetooth
- Or try to unblock it:
sudo rfkill unblock bluetooth
Reference: https://forums.raspberrypi.com/viewtopic.php?t=332688
- Either try to restart it:
- Install the Bluetooth-to-USB bridge:
sudo apt update && sudo apt install -y git sudo git clone https://github.com/quaxalber/bluetooth_2_usb.git /opt/bluetooth_2_usb sudo /opt/bluetooth_2_usb/scripts/install.sh - Reboot the Pi with
sudo rebootor via the GUI. - Run the smoketest:
sudo /opt/bluetooth_2_usb/scripts/smoketest.sh
- If the test passes, power off the Pi and disconnect the power supply. If it fails, check logs (
/var/log/bluetooth_2_usb.log) or re-pair the keyboard. - Connect the Pi to your PC via USB data cable (not power-only) plugged into the Pi’s "USB" port (not "PWR_IN"). The Pi should now act as a USB HID device, forwarding Bluetooth keyboard input to the PC.