Connect Android Phone via ESXi USB Passthrough

Finn Richter

July 8, 2025

Connect Android Phone via ESXi USB Passthrough
Connect Android Phone via ESXi USB Passthrough

Introduction to USB Passthrough in ESXi

What is USB Passthrough?

USB Passthrough is a VMware ESXi feature that lets you forward physical USB devices from your host machine directly into a virtual machine (VM). This means your VM will recognize and interact with USB gadgets—just like a regular desktop would.

Why Would You Want to Connect an Android Device to ESXi?

Think about this: You’re running a test lab in a virtualized environment, and you want to test mobile apps, debug via ADB, or even transfer files directly. Instead of copying things over the network, wouldn’t it be way easier to just plug the phone into your ESXi server and access it inside the VM?

Use Cases: Debugging, Testing, and File Transfer

  • Running automated tests on physical Android hardware.
  • Debugging mobile apps with Android Studio via USB.
  • Transferring photos, backups, or data using MTP/PTP.
  • Using the phone as a USB tethered network device.

Pre-Requisites Before You Begin

Hardware Compatibility

Not all servers support USB passthrough out of the box. You’ll need:

  • A server or PC with VT-d (Intel) or AMD-Vi (AMD).
  • A physical USB controller (preferably dedicated).

ESXi Version Requirements

Make sure you’re using VMware ESXi 6.7 or higher—older versions may have inconsistent USB support. ESXi 7.x and 8.x have significantly improved USB compatibility.

Android Phone Configuration

Before connecting:

  • Enable Developer Options on your Android.
  • Turn on USB Debugging.
  • Select appropriate USB mode (e.g., File Transfer or Charging Only).

Preparing Your ESXi Host for USB Passthrough

Enable Passthrough in BIOS

Step one, enter your BIOS/UEFI and enable:

  • Intel VT-d (or AMD IOMMU)
  • Any virtualization extensions related to PCIe or USB devices

Accessing the ESXi Web Interface

  1. Open your browser and connect to the ESXi IP address.
  2. Login with your root credentials.
  3. Navigate to Host > Manage > Hardware > PCI Devices.

Navigating to the Host Hardware Tab

You’ll find all PCI devices listed here. Look for your USB controller.

Enabling USB Controller Passthrough

  • Click Toggle Passthrough on the USB controller.
  • Reboot the ESXi host once you enable it.

Note: Don’t passthrough individual USB ports—it’s unreliable. Always passthrough the entire controller.

Assigning the USB Controller to a Virtual Machine

Why Use the Entire USB Controller Instead of Individual Ports

VMware is picky—sometimes individual USB devices don’t show up. Passing through the whole controller ensures everything connected to it becomes available to the VM.

Adding the Controller to the VM Configuration

  1. Power off the VM.
  2. Edit settings > Add New Device > PCI Device.
  3. Select the USB controller.
  4. Save and power on the VM.

Boom—you’re halfway done.

Connecting the Android Device

Plugging in Your Android Phone

Now connect your phone to the physical USB port connected to the passed-through controller. If all’s good, the VM should ping you with a device connection prompt.

Detecting the Phone in Guest OS (Windows/Linux VM)

  • Windows: Check Device Manager > Portable Devices
  • Linux: Use lsusb or adb devices

Android Debug Bridge (ADB) Confirmation

Run:

bashCopyEditadb devices

You should see your phone listed. If not, make sure drivers (Windows) or android-tools (Linux) are installed.

File Transfer Mode (MTP/PTP)

On your Android, change the connection mode from charging to:

  • File Transfer (MTP) – For copying files.
  • Photo Transfer (PTP) – For media access.

Common Errors and Troubleshooting

Device Not Detected in Guest OS

Try:

  • Reconnecting the device.
  • Restarting the guest VM.
  • Reinstalling drivers.

Greyed-Out USB Devices

This means you didn’t enable passthrough correctly. Recheck the BIOS and ensure the USB controller was marked for passthrough in ESXi.

Permissions and Guest Additions Issues

For Linux guests, ensure your user is in the correct groups:

bashCopyEditsudo usermod -aG plugdev $USER

Advanced Tips for Power Users

Using ADB over USB in ESXi VMs

Great for Android Studio, CI/CD pipelines, or bug hunting. It’s fast and stable—just make sure your USB controller doesn’t conflict with your mouse/keyboard devices.

Automating Device Reconnection with Scripts

If your VM reboots or sleeps, the Android connection may drop. Use UDEV rules (Linux) or PowerShell (Windows) to automatically reset ADB.

Using Multiple Android Devices in One VM

Yes, you can—but each must be on a separate USB controller. Or get a multi-controller PCIe USB card.

Security Considerations

Data Access Risks

Giving your VM access to a phone means it can read and write data. Ensure sensitive data is encrypted, and access is restricted to trusted users.

Isolation Strategies in VM

Use snapshots, limited user permissions, and firewall rules to sandbox your testing VM.

Alternative Methods Without USB Passthrough

ADB Over Network

Connect via IP:

bashCopyEditadb tcpip 5555
adb connect 192.168.1.50

No need for physical USB at all.

File Transfer via Cloud or FTP

For large backups or multi-device transfers, use:

  • Google Drive
  • Resilio Sync
  • FTP servers on Android (e.g., Solid Explorer FTP)

Conclusion

Connecting an Android phone to a virtual machine using ESXi USB passthrough is a game-changer for developers, testers, and power users. While it takes a bit of setup—toggling BIOS options, configuring PCI devices, and assigning them to VMs—the payoff is smooth debugging and seamless data access inside your virtual environment. If you encounter issues like the enable file encryption error in Android while accessing storage through passthrough, it’s often related to permission settings or security policies in the VM. Just follow the steps, keep your tools up-to-date, and enjoy a fully integrated Android + ESXi experience.

FAQs

1. Can I connect any Android phone via USB to an ESXi VM?

Yes, but make sure it’s in developer mode with USB debugging turned on.

2. Does USB passthrough work with macOS or Linux guests?

Absolutely! Just ensure your guest OS supports USB and has the necessary tools like ADB installed.

3. Why is my phone not showing up inside the virtual machine?

Likely causes: wrong USB mode, driver issues, or passthrough misconfiguration.

4. Can I connect multiple phones at the same time?

Yes, but you’ll need multiple USB controllers passed to the VM—or use ADB over network.

5. Is there a performance drop when using USB passthrough?

Not really. USB passthrough is near-native in terms of speed and responsiveness.

Leave a Comment