VMware ESXi – Adding a USB device to a Guest Virtual Machine

KB ID 0000778 

Problem

About a week ago a client asked me how to do this, and I was surprised I’d not got it covered on the site. I have already covered how to do this with VMware Workstation, but never got round to doing the same for ESX.

There are a myriad of reasons why you may need to do this, either to connect a UPS, a printer, thumb drive, or a software dongle etc. But the process is identical.

Solution

1. USB pass through support was brought in with ESX 4.1, so make sure your Host machine is 4.1 or newer.

2. Also the “Hardware Version” of the virtual machine itself must be (at least) version 7.

3. Your first task is to add a “USB Controller” the the VM. (You will need to power the VM down before you can do this). Edit Settings > Hardware Tab > Add.

4. Select USB Controller from the list > Next > Next > Finish.

5. OK.

6. Start up the VM.

7. Once you have a USB controller, you can present the USB devices that are connected to the Host ESX server.

8. Add Hardware.

9. You will now see “USB device” as an option > Next.

10. Now you can see the USB devices that are connected to the Host (In this case an HP UPS) > Select your device > Next > Finish > OK.

Note: The option “Support vMotion while device is connected” option will do exactly as is suggests, if the VM is vMotioned to another Host, the USB device will remain connected to this VM. (That is very cool if you think about what it has to do to make that happen).

11. The first time you boot into the operating system, (In this case Server 2008 R2) it will detect the hardware, here I’m opening Device Manager.

12. And you can see the USB controller, it will need a reboot before it starts them with the correct drivers.

13. Post reboot, the USB controller and devices will load, and be connected successfully.

Note: After this you can simply add and remove USB devices, without the need for any downtime.

14. Now in Device Manager everything looks a lot healthier.

 

Related Articles, References, Credits, or External Links

NA

Ubuntu – Managing Cisco Devices via Serial / Rollover Cable

KB ID 0000400 

Problem

A while back I ran though “Managing Cisco ASA devices via the ASDM with Ubuntu“, I prefer to work at command line, with a new firewall my only choice is via the console port, In a windows environment I can fire up Hyperterminal and I’m away. With Linux there a couple of things to do first.

Solution

Step 1 (Get the Serial / RS232 / COM Port working)

As pictured above, this is being done on my Acer Netbook so I don’t have a serial port. I need to use a USB to Serial converter, If your machine has a serial port then simply skip this section.

1. Plug in your serial converter and wait a few seconds, open a terminal window (Applications > Accessories > Terminal) and issue the following command,

[box]dmesg[/box]

2. Amazingly it looks like been installed with the correct driver, without any effort by me at all! Lets make sure, unplug the USB to serial converter then issue the following command,

[box]lusb[/box]

Then plug the device back in and run the same command, notice the serial port has popped onto the list.

Note: If you not as lucky as me follow the excellent advice here to install the drivers you need.

Step 2 Install and Configure Minicom

1. Open a terminal window and issue the following command,

[box]sudo apt-get install minicom[/box]

Tap in your password, then enter “Y” for yes when prompted.

4. We need to know the connection name for the USB to Serial converter, issue the following command (See mines called ttyUSB0).

[box]dmesg | grep tty[/box]

5. Now lets fire up Minicom with the following command,

[box]sudo minicom[/box]

Tap in your password again, then as requested press CTRL+A, then Z.

6. To configure the serial settings press O (that’s O for Oscar not zero).

7. Select “Serial Port Setup”.

8. Press A to set the device.

9. As we discovered (above) ours is called ttyUSB0, so change the device to /dev/ttyUSB0.

10. Press C to change the connection speed to 9600 baud, Press Q (to set 8 bits, no stop bit, and 1 parity bit. On mine this was set by default), press {enter} to exit.

11. Press F to turn off hardware flow control (Some posts will say leave it on, I generally turn if off and I’ve never seen anything break!). Press G to disable software flow control (if enabled).

12. Then Select “Save setup as..”, and give is a sensible name. (If you went back too far simply press O again to get back here).

13. Now the settings are saved you can launch them at anytime with,

[box]sudo minicom {filename}[/box]

Note: Sometimes your serial drive gets locked up but a reboot will solve the problem.

14. Here’s me connected to an ancient old catalyst switch.

15. And the baby PIX on my test network.

Note: If your keystrokes are not getting sent: From the main menu (CTRL+A then Z) Press E to turn on local echo.

 

Related Articles, References, Credits, or External Links

NA