While performing some experiments in my home lab, I needed to access a USB storage key directly on my ESXi host (not pass-through to VMs) and found it required a small trick after some tinkering. I thought I share the process in case this comes in handy for others.

Disclaimer: This is mainly for educational and testing purposes as this is not officially supported by VMware. Please use at your own risk.

Before I begin, you should know that only USB storage devices formatted with FAT16 can be accessed in the ESXi shell and is applicable to both ESXi 4.1 and 5.0.

Step 1 - Login to ESXi Shell via SSH and disable the USB Arbitrator service (this is automatically enabled by default to allow pass-through of USB devices to your VMs) using the following command: /etc/init.d/usbarbitrator stop

Step 2 - Plug-in your USB device to your ESXi host and you can verify by using the two ESXCLI commands: verifying the storage device using the command: esxcli storage core device list | grep -i usb or viewing the mounted filesystems using the command: esxcli storage filesystem list

Step 3 - Lastly, after you verify the USB device can be seen by the ESXi host, you can of course browse and access your USB device by looking under /vmfs/volumes/

Te re-enable pass-through of USB devices to your VMs, you just need to start the usbarbitrator service.

13 thoughts on “How to Access USB Storage in ESXi Shell

  1. Excellent tip. The problem is that the usbarbitrator takes over the USB bus since the vmkernel needs it to provide pass-through services. So, when that is running the ESX OS can’t get access to the devices connected on the USB bus.

  2. Just out of curiosity, can you format the USB storage as a VMFS volume and then run VMs off of the USB storage? This might solve a problem with my home lab.

  3. Service stopped good, but all steps afterwards did not help me get my 2TB disk back on VM. Actually, all USB devices are gone now.
    Also after restart (and rescan in vSpere) /etc/init.d/usbarbitrator.

    No other thing then to reboot ESXi completely, pitty.

    DG.

  4. @theconqueror, yes its possible, I have just done it. The only problem is that the usbarbitrator service needs to be off all the time (well thats my quick fix so far at least, otherwise ESXi will hang during boot) but I am searching for a way to get around that, something like excluding the datastore USB drive from the usbarbitrator but I havent found it yet.

  5. Hi Guys,

    Suppose I have to mount an ISO file in my VM(I want to boot my VM from that on next reboot), how can I do that? If anyone can share the commands that would be nice.
    --
    Thanks,
    Renjith

  6. Hi all,

    How format this USB key as VMFS datastore? I changed partion ID to FB - VMFS but unable to format it using vmkfstools

  7. Hello, could you please tell me how to use the HDD once the OS is able to watch it? see the output commands below. thanks in advance

    /vmfs/volumes # esxcli corestorage device list |grep -i usb
    Display Name: Local USB Direct-Access (mpx.vmhba36:C0:T0:L0)
    /vmfs/volumes # ls -l /dev/disks/
    -rw------- 1 root root 250059350016 Oct 7 19:52 mpx.vmhba36:C0:T0:L0
    -rw------- 1 root root 250059317760 Oct 7 19:52 mpx.vmhba36:C0:T0:L0:3
    -rw------- 1 root root 146163105792 Oct 7 19:52 naa.60019b90d320a90017c8a92f840165d2
    -rw------- 1 root root 939524096 Oct 7 19:52 naa.60019b90d320a90017c8a92f840165d2:1
    -rw------- 1 root root 4293918720 Oct 7 19:52 naa.60019b90d320a90017c8a92f840165d2:2
    -rw------- 1 root root 140925468672 Oct 7 19:52 naa.60019b90d320a90017c8a92f840165d2:3
    -rw------- 1 root root 4177920 Oct 7 19:52 naa.60019b90d320a90017c8a92f840165d2:4
    -rw------- 1 root root 262127616 Oct 7 19:52 naa.60019b90d320a90017c8a92f840165d2:5
    -rw------- 1 root root 262127616 Oct 7 19:52 naa.60019b90d320a90017c8a92f840165d2:6
    -rw------- 1 root root 115326976 Oct 7 19:52 naa.60019b90d320a90017c8a92f840165d2:7
    -rw------- 1 root root 299876352 Oct 7 19:52 naa.60019b90d320a90017c8a92f840165d2:8
    lrwxrwxrwx 1 root root 20 Oct 7 19:52 vml.0000000000766d68626133363a303a30 -> mpx.vmhba36:C0:T0:L0
    lrwxrwxrwx 1 root root 22 Oct 7 19:52 vml.0000000000766d68626133363a303a30:3 -> mpx.vmhba36:C0:T0:L0:3
    lrwxrwxrwx 1 root root 36 Oct 7 19:52 vml.020000000060019b90d320a90017c8a92f840165d2504552432035 -> naa.60019b90d320a90017c8a92f840165d2
    lrwxrwxrwx 1 root root 38 Oct 7 19:52 vml.020000000060019b90d320a90017c8a92f840165d2504552432035:1 -> naa.60019b90d320a90017c8a92f840165d2:1
    lrwxrwxrwx 1 root root 38 Oct 7 19:52 vml.020000000060019b90d320a90017c8a92f840165d2504552432035:2 -> naa.60019b90d320a90017c8a92f840165d2:2
    lrwxrwxrwx 1 root root 38 Oct 7 19:52 vml.020000000060019b90d320a90017c8a92f840165d2504552432035:3 -> naa.60019b90d320a90017c8a92f840165d2:3
    lrwxrwxrwx 1 root root 38 Oct 7 19:52 vml.020000000060019b90d320a90017c8a92f840165d2504552432035:4 -> naa.60019b90d320a90017c8a92f840165d2:4
    lrwxrwxrwx 1 root root 38 Oct 7 19:52 vml.020000000060019b90d320a90017c8a92f840165d2504552432035:5 -> naa.60019b90d320a90017c8a92f840165d2:5
    lrwxrwxrwx 1 root root 38 Oct 7 19:52 vml.020000000060019b90d320a90017c8a92f840165d2504552432035:6 -> naa.60019b90d320a90017c8a92f840165d2:6
    lrwxrwxrwx 1 root root 38 Oct 7 19:52 vml.020000000060019b90d320a90017c8a92f840165d2504552432035:7 -> naa.60019b90d320a90017c8a92f840165d2:7
    lrwxrwxrwx 1 root root 38 Oct 7 19:52 vml.020000000060019b90d320a90017c8a92f840165d2504552432035:8 -> naa.60019b90d320a90017c8a92f840165d2:8

  8. in 5.1 the USB device never seems to appear in volumes.

    it lists it in esxcli storage core device list | grep -i usb
    but in esxcli storage filesystem list nothing appears

  9. Same problem here, the device is listed with “lsusb” and “esxcli storage core device list | grep -i usb”.

    But it won´t automount. (8GB USB key formated with FAT32)

    Yes, usbarbitrator is off.

    What filesystem is needed? Dident have the time to test NTFS.. Need to be able to save files bigger than 2GB.

  10. I just thought that I would mention to all the people that are having issues with their drives not showing in volumes and to the guy with the 2tb drive..

    When the poster mentioned that only fat16 drives worked with this, that was an important part. Almost every drive made today will be either FAT32 or NTFS. Actually, as many kudos as I will give for inginuity, it is much less useful than one would have hoped simply due to how old a format fat16 and because of the massive limitations set for this. (Simply put, it would be nearly impossible to transfer off a virtual machine using this method without using something like tar/dd.)

Thanks for the comment!