|
| 1 | +--- |
| 2 | +title: |
| 3 | +description: |
| 4 | +author: RoseHJM |
| 5 | +ms.author: rosemalcolm |
| 6 | +ms.service: dev-box |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 12/05/2024 |
| 9 | + |
| 10 | +#customer intent: As a developer, I want to set up dev box with physical Android devices so that I can efficiently develop Android applications. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +# Connect physical devices to a dev box |
| 15 | + |
| 16 | +This article provides a step-by-step guide on how to set up and use dev box with physical devices. By following these instructions, you can ensure a smooth connection and configuration for your development environment. |
| 17 | + |
| 18 | +## Use dev box with physical Android devices to develop Android applications |
| 19 | + |
| 20 | +**Prepare the machine you connect from:** |
| 21 | + 1. Open Device Manager, in the run window, run *devmgmt.msc*. |
| 22 | + 2. Check that your device shows like one of the following options: |
| 23 | + a. Device name: Universal Serial Bus / Pixel 6 |
| 24 | + b. Android Device / Android Composite ADB Interface |
| 25 | + 3. Uninstall non-standard devices and drivers and restart. |
| 26 | + 4. Samsung devices will not connect if the ADB interface device exists on the machine you connect from. Uninstall the device. |
| 27 | + |
| 28 | +**After your Andriod device and driver are verified:** |
| 29 | + 1. Open Local Group Policy Editor, run *gpedit.msc*. |
| 30 | + 2. Navigate to **Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Connection Client\RemoteFX USB Redirection**. |
| 31 | + 3. Enable **RDP redirection of other supported RemoteFX USB devices from this computer** for **Administrators and Users**. |
| 32 | + 4. Apply the policy changes. From a cmd window `gpupdate /force`. |
| 33 | + 5. Restart your computer. |
| 34 | + |
| 35 | +**From your dev box** |
| 36 | + 1. Open Local Group Policy Editor, run *gpedit.msc*. |
| 37 | + 2. Open **Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Device and Resource Redirection**. |
| 38 | + 3. Set **Do not allow supported Plug and Play device redirection**"** to **Disabled**. |
| 39 | + 4. Navigate to **Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Connection Client\RemoteFX USB Device Direction**. |
| 40 | + 5. Enable "Allow RDP redirection of other supported RemoteFX USB devices from this computer", set to "Administrators and Users" |
| 41 | + 6. From a cmd window gpupdate /force |
| 42 | + 7. Restart your computer. |
| 43 | + |
| 44 | +If the Android device is still not accessible to adb: |
| 45 | + 1. Open Device Manager, run *devmgmt.msc*. |
| 46 | + 2. Ensure the Google USB driver is installed and the device appears as "Android Device \ Android Composite ADB Interface" (https://developer.android.com/studio/run/win-usb). If your device is from another manufacture, check [this link](https://developer.android.com/studio/run/oem-usb#InstallingDriver) for manufacture specific drivers. The goal is to make the ADB interface device show up in Device Manager. Please note the device name can vary slightly from manufacture to manufacture, such as "Samsung Android Phone \ Samsung Android ADB Interface" or "Android Device \ Android Composite ADB Interface". |
| 47 | + 3. Restart your computer. |
| 48 | + (consider make the above change in your DevBox image) |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +## Set up virtual switches for nested VMs |
| 53 | + |
| 54 | +Dev box supports nested virtualization. You can create VMs inside a dev box and connect them to the default virtual switch "Default Switch". If for whatever reason you want to create another virtual switch with internet access, please follow these steps to set up a NAT network with an internal virtual switch. |
| 55 | + |
| 56 | +> [!CAUTION] |
| 57 | +> Incorrect configuration of virtual switch will cause you to lose the connection to Dev Box immediately and this is NOT reversable. Please setup with extreme care. |
| 58 | +
|
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +## Stop automatic local drive redirection |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +## Connect USB devices to dev box |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +## Related content |
0 commit comments