Mount Bootable USB using Powershell on Hyper-V Host

hyper-vusb-bootvirtual-machines

Unfortunately the Hyper-V manager on my local machines returns "RPC not available" so I can't see/control my VMs. But thankfully I can RDP into the Host machine!

I need – please – to understand the Powershell command-line commands to do the following:

Mount a USB stick and make it the bootable drive for a VM
I think part of the command is Set-VMDvdDrive -Path … but (a) how do I define which bootable iso (there are several) on the stick should be the active one (b) how can I force the VM to boot up from the USB (I need to recover a partition from an Acronis Back-Up) and (c) how do I then un-mount the USB stick for use with another VM? Thanks Jean

Best Answer

You can try this article to probably fix the RPC service - https://community.spiceworks.com/topic/2007303-hyper-v-manager-rpc-server-unavailable-rdp-cannot-verify-the-identity

First of all, you need to add the DVD drive to the VM. In case if DVD drive already exists by using Set-VMDvdDrive he can specify needed ISO. For example - Set-VMDvdDrive -VMName Test -Path E:\Acronis.iso

Regarding the bootable iso definition, you always need to specify specific ISO prior to specifying just a folder. About forcing the VM to boot up from the USB You can make by using the ling below https://www.techrepublic.com/blog/data-center/how-to-configure-hyper-v-vm-boot-order/

Un-mount the USB stick for use with another VM can be made by using Remove-VMDvdDrive cmdlet. To find the controller number, he can use Get-VMDvdDrive https://docs.microsoft.com/en-us/powershell/module/hyper-v/remove-vmdvddrive?view=win10-ps