Hyper-V on Windows 10 Pro: My Missing Manual


Here is a list of accelerators and mini how-to related to Hyper-V in Windows 10 Pro[1] which is different from the Hyper-V on Windows Server[2]. It will be maintained and updated regularly.

Accelerators

System

Release Mouse[3] [Ctrl] + [Alt] + [←]
Full Screen Mode [Ctrl] + [Alt] + [Break]

Mini How-To

How to Share Files Between Guest and Host?

When Hyper-V is enabled, both the host and guest run on top of the Hyper-V virtualization layer. Only the host OS has direct access to all the hardware. I need to release the hardware in the host or it won’t be available in the guest.

Unfortunately, I try to follow the steps[4] but there is no “Offline” options on USB flash drive which has been identified as “Removable” instead of “Basic” in “Disk Management” in the host. A USB flash drive doesn’t work as a shared media because offline is not supported on removable drives.

There is a video[5] using USB drive on Hyper-V on Windows. But there are no “Local Resources” options as displayed at 1:37, the Windows 10 Pro’s build-in “Hyper-V Manager” doesn’t have this feature.

Finally, I created a virtual hard disk and mount it as a hard drive in the virtual machine in the “Settings” dialog in “Hyper-V Manager”.

To create and use a virtual hard disk:

  1. Launch “Computer Management” and switch to “Disk Management”.
  2. On the right “Actions” panel, use “Disk Management” → “More Actions” → “Create VHD”.
  3. Create a virtual hard disk in the “Create and Attach Virtual Hard Disk” dialog.
  4. It’s mounted as a new hard disk in “Disk Management” automatically.
  5. Click on the disk and select “Initial Disk” to create a partition.
  6. Click on the partition and select “New Simple Volume…” to assign its drive letter, file system, and volume name.
  7. Once finished, it would be opened by “File Explorer” automatically. Use it as a normal disk.

When I make it offline in the host, I may start the VM and see it in the guest. It won’t be visible by the host while being mounted in the guest. I have to shut down the guest to mount in the host. It could be accessed exclusively.

To use a virtual hard disk in the guest:

  1. Make sure the virtual hard disk has been detached in “Disk Management”. It cannot be used by any process or the guest will fail to launch.
  2. Open the “Settings…” dialog for the guest.
  3. “IDE Controller 0” → Add a new “Hard Drive” → assign the virtual hard disk → “OK” or “Apply” to confirm.
  4. If I use “Add hardware” → “SCSI Controller” → “Hard Drive” → assign the virtual hard disk → “OK” or “Apply” to confirm, the new disk won’t be visible in the guest. Also, the “Shared Drive” is not supported by the local storage in Windows 10 Pro: “The storage where the virtual hard disk is located does not support virtual hard disk sharing.”

Why there are so many virtual hard disk files with similar names?

Every time I create a checkpoint, it generates a new snapshot file with the extension “.avhdx” (my virtual hard disk has the extension “.vhdx”.) and the virtual machine setting will point to this new file automatically.

But the “Disk Management” on the host may only access the virtual hard disk, it cannot handle the snapshot. What I have done after the checkpoint in the guest won’t be accessed in the host.

Follow the steps[6] to merge the original virtual hard disk and its snapshots. I may access the latest version of the virtual hard disk in the host now. But the guest lost these snapshots of this virtual hard disk, they have been merged together.

Remember to update the “Virtual hard disk” in the vm setting or it will fail to launch.

Reference

  1. Microsoft: Virtualization / Hyper-V on Windows 10 / Introduction to Hyper-V on Windows 10
  2. Microsoft: Hyper-V on Windows Server
  3. serverfault: How to Release Mouse Capture in Windows 2008 Server Hyper-V Virtual Machine?
  4. StorageCraft: How To: Access a USB Hard Drive from a Hyper-V Virtual Machine
  5. YouTube: AssistanZ: Mount USB Drive into a VM in Hyper-V
  6. UseIT | Roman Levchenko: How to manually merge snapshots in Hyper-V

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.