> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# USB Forwarding on WSL

> Attach a physical USB device from Windows into the WSL environment using usbipd.

## Overview

On Windows + WSL, USB devices are not automatically visible inside the Linux subsystem. The `usbipd-win` tool bridges this gap by forwarding USB buses from the Windows host into WSL over a loopback IP tunnel.

<Note>
  `usbipd-win` must already be installed. If not, run `winget install usbipd-win` in a Windows Administrator terminal.
</Note>

## Step-by-step

<Steps>
  <Step title="Kill any running ADB server on Windows">
    Open **PowerShell (Administrator Mode)** and run:

    ```batch theme={null}
    adb kill-server
    ```

    <Info>
      This command may report an error if ADB is not running — that is safe to ignore.
    </Info>
  </Step>

  <Step title="List available USB devices">
    ```batch theme={null}
    usbipd list
    ```

    Note the `BUSID` for your Qualcomm device.
  </Step>

  <Step title="Bind the device (persistent, one-time)">
    ```batch theme={null}
    usbipd bind --busid=<BUSID>
    ```

    <Note>
      Binding is **persistent across reboots**. If your device exposes multiple USB modes (e.g. ADB + EDL), bind each `BUSID` once.
    </Note>

    <Warning>
      On some corporate machines, `usbipd bind` or the subsequent attach step may fail due to firewall policies. If you see an explicit firewall error, follow the **Corporate firewall workaround** below.
    </Warning>
  </Step>

  <Step title="Attach the device to WSL with auto-reattach">
    ```batch theme={null}
    usbipd attach --wsl --busid=<BUSID> --auto-attach
    ```

    <Warning>
      * Keep this PowerShell window **open** — closing it stops the auto-attach loop.
      * You must re-run this command every time you restart WSL.
      * If you change the physical USB port, re-run all usbipd commands from the start.
    </Warning>

    The following shows the full bind and attach sequence:

    <img src="https://mintcdn.com/qualcomm-prod/ajmq44Q1W0vLtUT4/Tools/QVSCE/images/usbipd-commands-attach.gif?s=c0963be0dfabd76a514ce1e474cf8cf3" alt="usbipd — bind and attach commands" width="1112" height="618" data-path="Tools/QVSCE/images/usbipd-commands-attach.gif" />
  </Step>

  <Step title="Verify the device inside WSL">
    In your WSL terminal:

    ```bash theme={null}
    lsusb
    ```

    You should see your Qualcomm device listed.
  </Step>
</Steps>

## Corporate firewall workaround

<AccordionGroup>
  <Accordion title="WSL mirrored networking — resolve firewall issues">
    1. Close all open WSL terminals.

    2. In PowerShell, shut down WSL:

    ```batch theme={null}
    wsl --shutdown
    ```

    3. Edit `%UserProfile%\.wslconfig` and add:

    ```ini theme={null}
    [wsl2]
    networkingMode=mirrored
    ```

    4. Restart WSL:

    ```batch theme={null}
    wsl -d ubuntu-22.04
    ```

    5. Retry the `usbipd bind` and `usbipd attach` steps.
  </Accordion>
</AccordionGroup>

## Detach / unbind when done

<CodeGroup>
  ```batch Detach theme={null}
  usbipd detach --busid=<BUSID>
  ```

  ```batch Unbind theme={null}
  usbipd unbind --busid=<BUSID>
  ```
</CodeGroup>
