How to Redirect USB Modem to a VMware ESXi Virtual Machine

by tribgarry in Circuits > USB

1285 Views, 2 Favorites, 0 Comments

How to Redirect USB Modem to a VMware ESXi Virtual Machine

image8.png

Hi everyone! Today I’ll tell you how to redirect a USB modem to a VMware ESXi virtual machine. In the same way, you can redirect a memory stick and some other USB devices. This long-established VMware function has its advantages and drawbacks, so we'll go over everything. In our organization, we’ve been testing said function for our servers’ monitoring and availability notification system so the designated employees can receive Zabbix notifications on an operational basis. Then again, I bet you’ll be able to adapt this function to your own needs.

What is USB redirection to VMware used for?

In most cases, people redirect USB devices to a particular virtual machine for the services that need a hardware key or a modem for correct operation (e.g. notification services). This mode is called Host-Connected USB Passthrough. Next, I’ll provide you with a list of requirements that must be met for this function to work properly. USB redirection rules:

  • The first rule sounds very logical: one USB device can be added to one virtual machine. Said machine can have up to 20 USB devices, that’s enough and to spare.
  • Virtual Hardware should be 8 or higher There must be a USB controller on a host.
  • The ESXi host’s USB arbitrator can operate up to 15 controllers
  • Take note that whenever you perform a migration procedure (vMotion) on your VM, USB won’t migrate with it
  • Prior to adding a USB device, you’ll have to add a USB controller to your VM’s devices
  • Before you can disconnect a USB device from your VM, first you’ll need to disconnect the USB controller redirected to the Virtual Machine
  • You’ll have to disconnect USB devices from the VM before using memory or CPU hot add. An increase in resources will cut them off anyways and that may result in data loss.
  • You can’t start a VM from a redirected USB device

Here is a VMware’s list of the officially supported devices. It’s not exhaustive, so if your device isn’t there, it can still work just fine. Give it a try anyway.

Figure 1

image9.png

How to Redirect a USB Flash Drive and ZTE MF863 Modem

image1.png

Go to the virtual machine’s properties (don’t turn the VM off) and click “Add”

image11.png

First thing you need to add is USB Controller

image5.png

Choose “EHCI+UHCI”

image6.png

Click “Finish” to complete the first step.

image10.png

Now let’s try to add a USB memory stick and a ZTE MF863 modem. Click “Add” again.

image2.png

Choose the USB Device to add a USB device to VMware ESXi, and click “Next”.

image4.png

The hypervisor will automatically detect your device. In my example, the first device in the list is Zalman external box ZM-VE400.

image12.png

Look through summary statistics and click “Finish”.

image13.png

As you can see, ZM-VE400 was successfully added.

image8.png

Now, let’s do the same thing for ZTE MF 863. Note: I had to activate no CD-ROM mode for ZTE MF863 to be detected.

image3.png

That’s all! MF863 has been added as well.

You can use VMware ESXi 5.5 command prompt to review the device list. Here is a command for VMware SSH:

esxcli storage core device list | grep -i usb

From the log output, you can see that my modem was in a dual-mode and thus can’t be recognized as a USB device:

Is USB: false

Is Boot USB Device: false Is

USB: false

Is Boot USB Device: false

Is USB: false

Is Boot USB Device: false

Display Name: Local USB CD-ROM (mpx.vmhba34:C0:T0:L0)

Model: USB SCSI CD-ROM

Is USB: true

Is Boot USB Device: false

Display Name: Local USB Direct-Access (mpx.vmhba34:C0:T0:L1)

Is USB: true

Is Boot USB Device: false

How to reset your ZTE MF from a CD-ROM mode to a modem mode

Here is a list of commands you’ll need to enter for your ZTE MF to be recognized as a modem.

Note: Before you start, make sure you have Serial Port Terminal software installed.

  1. Connect to your modem using Serial Port Terminal (see Windows Device Manager for port number and speed).
  2. Enter command ATE1 to enable input text display (skip this step if you don’t need that)
  3. Type AT+ZCDRUN=8 and press ENTER to unmount the CD-ROM
  4. At this point, your terminal responds with something like this: Close autorun state result(0:FAIL 1:SUCCESS):1 OK
  5. Disconnect the modem from your PC and then plug it back in.

To enable standard mode, enter the command AT+ZCDRUN=9.

There is also a modem-only mode (you won’t be able to use a USB memory stick). Enter AT+ZCDRUN=E to enable and AT+ZCDRUN=F to disable this mode.

It is best to upgrade your firmware to the latest version. That worked like a charm for my ZTE MF863.

And here is another command showing more detailed information on the USB devices attached to ESXi

lsusb -v

This command’s output will look like this:

image7.png

And there you go, easy as pie.