Raspberry Pi OS adds easier USB gadget mode support

Raspberry Pi OS Trixie now supports USB gadget mode out of the box, allowing users to connect to their Raspberry Pi boards over IP through USB without the need for a router.

My first experience with USB gadget functionality was when I reviewed the Beaglebone Green Wireless SBC in 2016, but for some reason, official support for the Raspberry Pi ecosystem took a lot longer, and it was only officially implemented in Raspberry Pi OS Trixie images dated 20.10.2025 and later through the rpi-usb-gadget package.

Raspberry Pi OS USB gadget mode

It’s been possible to use the USB gadget mode on Raspberry Pi OS for a while, but it was rather convoluted with outdated scripts, manual configuration steps, and platform-specific instructions. The new rpi-usb-gadget package streamlines the process and makes things much easier:

  • The Raspberry Pi SBC will present itself as a USB Ethernet device when connected to a PC
  • Users can SSH directly using the hostname set in Raspberry Pi Imager without having to configure Wi-Fi or Ethernet
  • If your PC has an active internet connection and Internet Connection Sharing (ICS) is enabled, the Raspberry Pi will automatically receive internet access through the USB cable
  • A lightweight background service runs automatically switch between standalone mode and ICS-backed networking

So it’s like USB tethering on your phone, but for a Raspberry Pi. It works on Windows, macOS, and Linux.

How well it works depends on your specific Raspberry Pi SBC model, since it must be connected to a USB port that supports OTG (device mode).

Raspberry Pi modelUSB port to use
Raspberry Pi Zero, Zero W, Zero 2 WThe micro USB port closest to HDMI — not ‘PWR IN’
Raspberry Pi 4, 5, 500, 500+The USB-C port directly on the board
Compute Module 5The USB-C port on the Raspberry Pi CM5 IO Board
Compute Module 4Requires additional manual setup and is not auto-configured

Once gadget mode is enabled, the OTG port will no longer work as a regular USB port and will only function as a USB Ethernet port with power input. In other words, that means keyboards, storage devices, or other peripherals won’t be recognized.

Raspberry Pi Imager USB Gadget ModeUSB gadget mode can be enabled directly from the Raspberry Pi Imager 2.x  when you flash the image to a microSD card. On an existing Trixie installation, run the following commands:


The implementation is open-source, and you’ll find the code on GitHub.

Internet Connection Sharing Windows 11
Internet Connection Sharing (ICS) on Windows 11

Via Raspberry Pi website

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress. We also use affiliate links in articles to earn commissions if you make a purchase after clicking on those links.

Radxa Orion O6 Armv9 mini-ITX motherboard

One Reply to “Raspberry Pi OS adds easier USB gadget mode support”

Leave a Reply

Your email address will not be published. Required fields are marked *

Boardcon MINI1126B-P AI vision system-on-module wit Rockchip RV1126B-P SoC
Boardcon MINI1126B-P AI vision system-on-module wit Rockchip RV1126B-P SoC