New-VM creating:Failed to add ISO Disk Image located at remote cif share

Feb 11, 2011 at 3:22 PM

I aam using Hyper-V library to create a VM with iso located at remote cif share.
$New_VM_Name = "REMOTEVM105"
$New_VHD_Name = "c:\VHDs\$($New_VM_Name).VHD"
$Target_Host = "TESTHOST"
$myVM = (New-VM $New_VM_Name -Server $Target_Host)

Set-VMMemory $myVM 1054 MB

Set-VMCPUCount $myVM 2
Add-VMDrive $myVM 0 0
New-VHD $New_VHD_Name 20GB -wait -Server $Target_Host
Add-VMDisk $myVM 0 0 $New_VHD_Name
Add-VMDRIVE $myVM 1 0 -dvd
Add-VMDisk $myVM 1 0 "\\\share\test.iso" -dvd

Add-VMNIC $myVM -virtualSwitch "Local Area Connection2"

Start-VM $myVM

User account does not have permission required to open attachment '\\\share\test.iso'. Error: 'General access denied error' (0x80070005). (Virtual machine ID 726F0BE6-DC9A-4789-98

This is a CIF share with all permissions set to access remotedly .

Please note that if the iso is located on local host, it works like a champ.

I appreciate any ideas to resolve this.

Feb 14, 2011 at 5:58 PM

You need to set up constrained delegation to allow the hyperV service - not the user - to have access to the remote share.  This is the same whether use the GUI or the PowerShell library.


Feb 15, 2011 at 3:21 AM

Thanks Jason,

It works great only if have  -VHDPath \\<machine_B>\<share>\<path-to-ISO> -DVD   and does not work if we give  -VHDPath \\<ipaddress of Machine B>\<share>\<path-to-ISO> -DVD  .

Any ideas to resolve this?