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

3

1

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?

Jeroen Wiert Pluimers

Posted 2011-11-03T09:29:03.157

Reputation: 2 373

Stumbled on this with similar scenario. I have Windows 10 in a VM, trying to upgrade the OS. I have 10GB available on C and 20 available on a virtual D. But the upgrade aborts saying I don't have enough disk. The estimate says 6GB but MS docs say 20. So I'm thinking of creating a virtual USB from actual host hard drive space, adding this as temporary space to allow W10 to upgrade, then removing the virtul stick when it' done. So far I haven't found how to do this. – TonyG – 2018-03-18T22:09:36.797

With a real stick there seems to be other workarounds than Plop: http://reboot.pro/8581/

– Jeroen Wiert Pluimers – 2011-11-08T17:06:54.457

Answers

3

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.

William Hilsum

Posted 2011-11-03T09:29:03.157

Reputation: 111 572

Right now, it takes about 7 hours to copy all the files to the USB drive (even if it is a really fast one: Windows 7 PRE environments tend to have many small files which take a long time). That's why I want to emulate it :) – Jeroen Wiert Pluimers – 2011-11-04T10:51:17.733

Sorry, I don't think I honestly understand the situation... I deploy Windows from USB drives all the time. If your USB drive is that slow, you may want to consider getting a newer one - I only have a budget/entry level one, but, it takes about 5-10 minutes to copy a Windows DVD to it, and only about 20-30 minutes to actually install Windows from it :/ – William Hilsum – 2011-11-04T10:54:02.067

The current Windows 7 PRE image is about 10 gigabyte; even on a fast 16 Gb A-DATA USB 3 stick it takes many hours to make the copy. There's thousands of files to be copied and that makes it slow. – Jeroen Wiert Pluimers – 2011-11-04T11:14:09.740

@JeroenPluimers - Are you actually installing Windows on to the USB stick? Not just the installer then? ... Sorry, I still don't fully understand what you are trying to do! If you want to install from a USB stick (and I thought you were attempting to copy a dvd to a USB stick), the majority of files are compressed in a WIM file - there are a total of 751 files, and it is about 3.2GBs – William Hilsum – 2011-11-04T11:15:27.033

apart from the base install, there is about 20k files totaling to about 10 GB of additional data that can optionally be installed. That is a seriously large copy action. – Jeroen Wiert Pluimers – 2011-11-04T21:23:24.563

@JeroenPluimers - it still sounds a little on the slow side, but fair enough... I think I understand a bit better what you are trying to achieve. However, another option could be to load Windows PE on the machine where it is installed and use ImageX to take a copy to a single file, then just copy that... Restoring from ImageX is easy as well, and, should be much quicker. – William Hilsum – 2011-11-04T22:02:01.083

Thanks for the tip. I'm actually only the user of the install files; so I'll tell the development team about ImageX: it sounds like a promising direction to go. Thanks again! – Jeroen Wiert Pluimers – 2011-11-04T22:17:22.577

1

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.

iX3

Posted 2011-11-03T09:29:03.157

Reputation: 153

I should also mention that this did create some minor headaches because the Windows 10 installer did not setup the new virtual disk with the boot configuration but rather just added an entry for the new installation to the installer image. So when I removed that loopback drive it failed to boot. I fixed this by reconnecting it, booting to recovery/command line, temporarily moving the boot directory on the install image, rebuilding the BCD following http://pcsupport.about.com/od/fixtheproblem/ht/rebuild-bcd-store-windows.htm, moving the boot folder to the main fs, then restoring the old one.

– iX3 – 2015-10-22T17:12:17.563