A laptop connects via SSH to a small single-board computer on a desk.
A Raspberry Pi Zero 2 W has trouble as a general-purpose computer. Plugged into a Windows PC as a USB gadget, it is a handy little network tool. XDA Developers' Abhishek Kumar Mishra describes giving his spare board a second life this way. He uses it for direct SSH access and lists other roles he could try, including a USB flash drive, a Wi-Fi dongle and a button-based input device. This piece covers what his setup involved, what Raspberry Pi's current documentation adds, and where the practical limits are.

A laptop connects via SSH to a small single-board computer on a desk. What USB gadget mode actually does​

Normally a Pi acts as a USB host, so it talks to keyboards and drives. In gadget (peripheral or OTG) mode it flips roles. It presents itself to the PC as a USB device, in this case a network adapter.

Mishra's write-up covers several roles for the Pi:

  • USB Ethernet: SSH into the board over the cable.
  • Mass storage: the board shows up like a flash drive.
  • HID: the board acts as a button or input device.
  • Serial: the board appears as a COM port.
  • Webcam or audio: other possible roles.

Only the Ethernet route is walked through step by step. He says the HID idea is his next project. It needs a breadboard, buttons and some circuit knowledge. Treat the other roles as ideas that each need their own configuration. The Ethernet setup does not switch them on automatically.

The author's USB Ethernet setup​

Mishra wiped an existing DietPi install and flashed Raspberry Pi OS Lite 64-bit. He used Raspberry Pi Imager to preconfigure SSH and a user. Then he edited two boot files over SSH:

  1. In config.txt, he added [all] followed by dtoverlay=dwc2,dr_mode=peripheral.
  2. In cmdline.txt, he added modules-load=dwc2,g_ether.

After a reboot, the Pi needed a manually assigned IP address. Windows did not see it until he installed an RNDIS driver. He then set the IPv4 details in Control Panel. After that, the board drew power from the PC and answered SSH on the address he chose.

His case for the effort is a direct link that does not depend on the router. He says it works when the router is down in a power outage. That claim needs a caveat. The PC and Pi still need power, and the link must already be configured.

What Raspberry Pi's current guidance adds​

Raspberry Pi's own documentation is more detailed than the XDA account. It also describes a simpler route than the manual file editing.

Use the right port. On the Zero, Zero W and Zero 2 W, the port to use is the micro USB port closest to HDMI, not "PWR IN". Use a data-capable cable. A power-only cable will not work.

The port is dedicated. Raspberry Pi warns that once gadget mode is on, the chosen port works only as USB networking plus power input. Keyboards and storage can't be attached to it. On a Zero with a single data port, that makes SSH over Wi-Fi a useful fallback while you set things up.

The Windows driver is a separate download. Windows has no generic driver for USB Ethernet gadget devices, so Raspberry Pi provides a dedicated installer, rpi-usb-gadget-driver-setup.exe, on the project's GitHub releases page. It is a one-time install per Windows machine. This matches Mishra's experience of needing a driver. Once the driver is in, the adapter should appear as "Raspberry Pi USB Remote NDIS Network Device".

Driver advice varies. Other guides found in search disagree. One third-party tutorial says Windows 10 and 11 already include an RNDIS class driver that you can pick manually in Device Manager. Older tutorials point to Acer or other community drivers. I could not verify those claims independently. The official installer is the documented route for the current rpi-usb-gadget setup.

The easier route on newer images​

Raspberry Pi describes a simpler method for newer images. Starting with Raspberry Pi OS Trixie images dated 20.10.2025 and later, a package called rpi-usb-gadget is included by default. Raspberry Pi says Imager 2.0 can switch it on from the "Interfaces & Features" tab.

Raspberry Pi's steps are:

  1. Create the image with USB Gadget Mode enabled, and set a hostname, user and SSH.
  2. Insert the card and connect the Pi to the PC through the correct data port.
  3. Let it boot. The first boot may take longer and may reboot once.
  4. Confirm a new Ethernet adapter appears on the PC.
  5. SSH using the hostname you set.

There are caveats. The GitHub README says Imager 2.0 was in beta and needed a custom repository to show the option. It recommended waiting for a stable release. Comments on Raspberry Pi's blog post also report that the option is missing from some Windows Imager builds without a manifest workaround. The README also describes a cloud-init option, which needs a fresh Trixie image that has the package preinstalled.

Config differences from the XDA procedure​

The XDA commands match older community guides. Peter Tanner's Pi Zero troubleshooting write-up, for example, uses the same dtoverlay=dwc2,dr_mode=peripheral line. It also adds modules-load=dwc2,g_ether after rootwait in cmdline.txt. Adafruit's classic guide uses plain dtoverlay=dwc2.

Keep cmdline.txt as a single line. Insert the parameter into the existing line rather than adding a new one.

The newer package works differently. It configures g_ether and uses NetworkManager profiles on the usb0 interface. Raspberry Pi's README says the package "ships USB Ethernet only". It does not enable a serial console, and Raspberry Pi's blog says Windows can't bind RNDIS and serial to one composite device with a single .inf file. So the new package covers networking, not the other roles Mishra mentions.

Addressing: manual, ICS or the Pi's own​

Mishra assigned addresses by hand. The package offers two automatic modes:

ModeWho hands out addressesTypical addresses
SharedThe Pi serves DHCP and NATThe Pi is 10.12.194.1
ClientWindows ICS acts as DHCPWindows takes 192.168.137.1, and the Pi gets 192.168.137.x

The README says a watcher service flips between the two based on whether an ICS gateway is reachable. If the Pi is in shared mode, you SSH to 10.12.194.1. In client mode, check the host adapter or try the hostname with .local. Raspberry Pi notes that mDNS names may not resolve on Windows without Bonjour support. In that case, use the IP address, which arp -a can show.

Giving the Pi internet through Windows​

This is optional. For local SSH you don't need it. If you want the Pi online through the PC, Raspberry Pi's steps are:

  1. Plug in the Pi and confirm the new Ethernet adapter appears.
  2. Open Network Connections, through Control Panel or by running ncpa.cpl.
  3. Open Properties on your internet-connected adapter, such as Wi-Fi.
  4. On the Sharing tab, allow other network users to connect, and choose the Raspberry Pi adapter.
  5. Wait about a minute for the Pi to get an address.

Troubleshooting checklist​

  • "Unidentified adapter" or no adapter: the RNDIS driver isn't installed. If Windows doesn't show the adapter in Device Manager or Control Panel, the Raspberry Pi RNDIS driver isn't installed.
  • Pi shows a 169.254.x.x address: Windows isn't serving DHCP. ICS isn't active on the gadget adapter.
  • Adapter shows "Shared" but no lease: if ICS was enabled while the Pi was unplugged, Windows may bind DHCP to another interface, such as a Hyper-V adapter. Disable ICS everywhere, plug in the Pi, then re-enable it.
  • Random reboots or dropped links: low power. Some laptop USB ports can't supply enough. Connect directly to the PC instead of a hub or dock.
  • Odd behavior with VPNs: the README advises disabling VPNs on the host, because they can interfere with the local link.
  • Multiple Pis at once: the default shared subnets overlap. Use host ICS or change each Pi's shared subnet.

Is it as brilliant as the headline claims?​

The XDA piece is one author's experience, and "useless as a computer" is his opinion. The Wi-Fi dongle, file-transfer device and four-button HID controller are ideas or plans, not demonstrated results. The Wi-Fi dongle idea also needs extra setup such as IP forwarding and NAT.

The core idea is well supported by Raspberry Pi's documentation. The Zero 2 W can present itself as a USB Ethernet device to a Windows PC. With the right driver, that gives you a headless, router-independent SSH link. It also helps on networks that block local discovery.

If you are weighing the old manual route against the new one:

  • For a fresh install on a new Trixie image, try the Imager or cloud-init route first.
  • For an existing Bookworm-era setup, the manual file edits still apply, but expect to deal with NetworkManager addressing.
  • Either way, keep another way in, such as Wi-Fi SSH, until the USB link is confirmed.

An old Zero 2 W costs little and can do plenty beyond running Vaultwarden on a shelf. The setup does take patience, and Mishra himself says not to expect it to work the first time.

 

References

  1. My Pi Zero 2 W is useless as a computer, but as a USB gadget for my PC, it's brilliant XDA 2026-11-05T12:00:24+00:00
  2. GitHub - raspberrypi/rpi-usb-gadget: Turn your Raspberry Pi into a USB Ethernet gadget (CDC-ECM/RNDIS) for headless networking, Internet sharing, and remote development over a single USB cable. · GitHub github.com
  3. USB gadget mode in Raspberry Pi OS: SSH over USB - Raspberry Pi raspberrypi.com