31 October 2012

How to add a file share ISO to a Hyper-V VM

When one start using more than one Hyper-V server you start running into things that may not have been an issue before.  One of these things is being able to properly share an ISO image that is located on the file system of one Hyper-V server with another.  This same procedure will also allow you to use ISO files located on any file share server.  This avoids the alternative of having to copy the file to each Hyper-V server.

Error Messages:
If you simply try to attach a network share ISO file to your virtual machine you will get an error.  It can be either of these depending on when you attempt to attach the ISO.

Error applying DVD drive changes

Failed to modify device 'Virtual CD/DVD Disk'
User Account does not have sufficient privilege to open attachment <iso location>
Error:  'General access denied error'



The server encountered an error while configuring the devices on < New virtual Machine Name >
Failed to add device 'Virtual CD/DVD Disk'
User Account does not have permission to open attachment



Resolving the problem
To get this to work properly there are a few steps to follow:

  • Configure the file share
  • Configure delegated authentication
  • Attach the file share ISO  


Step 1  - Configure the File Share
When dealing with the Hyper-V connection it is important to note that the user account being referred to is actually the Hyper-V server computer account.  It has nothing to do with the logged in user.


  • On the server that will host the file share
  • Create a folder for the share such as d:\ISO
  • Copy all the ISO files to this folder
  • Right click the folder - Properties
  • Select the Sharing Tab
  • Click Advanced Sharing
  • Check "Share this folder"
  • Click on Permissions
  • Click Add
  • Click Object Types
  • Check only Computers
  • Enter the computer name of the Hyper-V server 
  • Click Check Names
  • Click OK
  • You should now see that the computer account has been added it will be Hyper-VServerName$
  • Only read access is required
  • Click OK twice and close the file share options


Next up you will need to configure the NTFS permissions for the folder.


  • Form the folder properties screen select the Security Tab
  • Click Edit
  • Click Add
  • Click Object Types
  • Check only Computers
  • Enter the computer name of the Hyper-V server 
  • Click Check Names
  • Click OK


You should now see that the computer account has been added with Read access

Step 2 - Configure Delegated Authentication
The following is performed in Active Directory Users and Computers

  • Open the AD Users and Computers MMC
  • Find the computer account of the Hyper-V server
  • Open the properties and select the delegation tab
  • select Trust this computer for delegation to specific services only
  • Use any authentication protocol
  • Click Add
  • Click users or Computers
  • Enter the name of the server hosting the file share
  • Scroll through the list of service types and select cifs
  • Click OK


Once all of this is done we can start working on the Hyper-V server

Step 3 - Attach theFile Share ISO
Reboot the Hyper-V server for the setting to take affect
  • Select your virtual Machine
  • Select Settings
  • Select the DVD Drive
  • Choose Image file as the media
  • Click Browse
  • Specify the path to the file share eg. \\fileserver\share\install.iso
  • Click Apply


If everything is working properly it will successfully attach the network ISO file as the local DVD for the virtual machine

As you can see the steps will have to be repeated for all the Hyper-V server that need to access the file shared ISO.


6 comments:

Alefred said...

Is the solution for me :)

Anonymous said...

Thank your posting this solution.

Anonymous said...

Didn't work...
BUT
After i added my new virtual machine in the domain as a computer
it worked.

George said...

Wow!
I'm now running Windows 8 and found my WHS V1 server can't restore a backup of a W8 machine.

I built a solution using VMware Workstation 9 on the W8 machine running 2012 Essentials to backup to the WHS Server. It works and I don't need everything in a domain which WHS can't join anyway.

Thought I would try the same using hyper-v. All my iso files are on the WHS machine. What a mess to go through to even try and install an OS on a hyper-v machine. Access denied error and every solution I've found suggests adding permissions to the machine hosting the iso's. Unfortunately it can't see anything outside of itself.

I'll just stick with VMware which can access the WHS machine even from nested VM's.

Tesfaye said...

The delegation part was missing for me when I was trying to get this going. Once I made that change on my HV server objects in AD I was good to go. Thank you!

Anonymous said...

Worked perfectly - thank you.

Post a Comment