How to redirect USB modem to a VMware ESXi virtual machine

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:

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.

Пробрасываем USB модем в vmware esxi виртуальную машину-12

How to redirect a USB flash drive and ZTE MF863 modem

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

vmware esxi usb

First thing you need to add is USB Controller

esxi usb zte mf863

Choose  “EHCI+UHCI”

Пробрасываем USB модем в vmware esxi виртуальную машину-3

Click “Finish” to complete the first step.

Пробрасываем USB модем в vmware esxi виртуальную машину-4

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

Пробрасываем USB модем в vmware esxi виртуальную машину-5

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

Пробрасываем USB модем в vmware esxi виртуальную машину-6

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

vmware esxi usb

Look through summary statistics and click “Finish”.

esxi usb zte mf863

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

Пробрасываем USB модем в vmware esxi виртуальную машину-9

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.

zte mf863

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

Пробрасываем USB модем в vmware esxi виртуальную машину-11

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: 

vmware usb

And there you go, easy as pie.