VMware Workstation 8: how to fake a bootable USB stick?

I want to experiment with various Windows builds.

Normally, I'd put those builds on a bootable USB stick, then either deploy them on a physical or VM machine using something like Plop bootmanager.

How can I fake such a bootable USB stick so all the files from that disk are in fact on a path on the host?


Solution 1:

Unfortunately, I am not aware of a way to fake a USB stick in any VMware product, but, this would be a brilliant feature.

Until then, one work around would be to create a SCSI virtual hard drive somewhere and mount this to your virtual machine.

VMware Workstation also has the ability to mount Virtual Hard disks to your host machine. If you uncheck the Read Only option, this should work well.

Obviously however, it will appear to the guest machine as a physical hard drive - for most operations, it will not make a difference, but, if you are trying to test booting, it may not be a reliable alternative as it will not match the real environment you are testing for.

The best thing you can probably do is to actually plug a USB stick in to your machine and connect it to the guest virtual machine. This should allow you to test the environment in the correct way as the USB stick will show as a USB stick to the virtual machine.

Solution 2:

I was able to install Windows 10 Pro in VMware Workstation 12.0 on a Debian Linux (stretch / testing) host by doing the following:

  1. Create an image of the USB stick using dd (or ddrescue or equivalent tool -- make sure to get the whole device not just the FAT partition)
  2. Use losetup to make that image appear as a raw device (i.e. /dev/loop0).
  3. Set permissions on that loopback device with chown so that the user running vmware can access it (so you don't have to run vmware as root)
  4. Add a virtual hard drive to the VM and choose the raw / physical device option.
  5. Boot to firmware and make sure that boot device has top priority.

I have not tried this but you might be able to simultaneously mount a filesystem present on that loopback device and make changes to it so you don't have recreate the image file. If not, it shouldn't take too much time to shutdown the VM, mount the loopback device locally & make changes or point it to a different device then boot up the VM again.