Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The first thing that I needed to do as part of my big rebuild was to move non-critical virtual machines to a remote file server. The easiest way to do this would have been to export the virtual machines to a local location and then move them up to a network share. Unfortunately I did not have enough space on the local hard disk to do this. So what I needed to do was to export the virtual machines directly to a remote network share.
Luckily I had two things working in my favor:
- Both my Hyper-V server and my file server (okay, it was actually my desktop computer) are in the same domain
- I was performing the operation directly from the Hyper-V console (not using remote management tools)
Now it is possible to do this still if the above two items are not true – but it gets a lot more complicated.
Given this setup I needed to create and configure a share for the exported virtual machines to be created on. I logged into my desktop computer and created a share – which granted full access to my user account by default. But this is not enough for Hyper-V.
Hyper-V does a lot of operations using local service accounts on the Hyper-V computer. So the network share needs to have permission granted for both the user account that you are using and for the computer account for the Hyper-V server. The user account is easy to setup (and in my case was setup by default). Setting up the computer account is a little trickier.
To do this on a Windows 7 computer you will need to go to the folder that is being shared and:
Right click on the folder and select Properties.
Click on the Sharing tab.
Click on the Advanced Sharing… button.
Click on the Permissions button.
Click on the Add… button.
If your user account does not have access on the share – now is a good opportunity to add it. The next step is a little bit tricky – because this dialog does not allow you to add computer accounts by default.
Click on the Object Types… button.
Check Computers and click OK.
Type the name of Hyper-V server followed by a “$” into the text box and click OK.
My Hyper-V server is named “Hyper-V” (original – I know) so for me I have to type in “Hyper-V$”.
Give the Hyper-V server computer account full control on the share (and your user account if you are adding it at the same time) by checking the Allow option next to Full Control when the computer account is selected.
Click OK and click OK again.
Click on the Security tab.
Click Edit…
Click Add…
Click on the Object Types… button.
Check Computers and click OK.
Type the name of Hyper-V server followed by a “$” into the text box and click OK.
Give the Hyper-V server computer account full control on the share by checking the Allow option next to Full Control when the computer account is selected.
Click OK
Click Close
Now that all of that is done you can go to the Hyper-V server, select the virtual machine that you want to export, and when you are prompted for a location you can type in the UNC path of the share you have just created, and specify a subfolder for the virtual machine. For example – if I was exporting a virtual machine called “WDS Server” to the “Export” share on my computer “Benjamins-PC” I would enter “\\Benjamins-PC\Export\WDS Server” into the export location for the virtual machine.
When you want to import the virtual machines back off the network share – you need to ensure that you select to “Duplicate all files so the same virtual machine can be imported again” – as we do not support running virtual machines from a network share.
One final note to make – while we do not support running virtual machines from folders where NTFS compression is enabled – you can enable it on a folder where you are storing exported virtual machines to reduce the amount of space needed.
Cheers,
Ben
Comments
Anonymous
August 16, 2010
I want to export the VM to a NAS System which is Unix based, so I cannot use the description given here. I would have to set up an account on the NAS with the same User name and Password to make it work. How can I solve this problem?Anonymous
September 22, 2010
The comment has been removedAnonymous
January 25, 2011
The comment has been removedAnonymous
April 06, 2011
Hi Ben , Is there a way to use export onto a library server and later import from library server onto the host ? ThanksAnonymous
January 03, 2012
I mistakenly copied the VM's to a USB attached drobo from 2008r2 and delted them from the host. What a mistake, Since I did no export. I exported a new one and now see a structure and a couple xml type files. Two files and a file structure are missing from the ones I had earlier moved/copied out. Can I fake it to get them back? Looks like one file is easy but the other looks like a cab file with a familiar xml structure, but lacks info I cannot see that needs edit...Anonymous
May 20, 2012
Many thanks for taking the time to post this - explains the strange error I am getting while attempting to export to a network share.. Thank you.Anonymous
November 14, 2012
Hi Ben, I did what you mentioned above. Yet it does not work in my environment. Could it be because I'm using the Hyper-V console from the destination host? The source host is server Core therefore it has no console.Anonymous
December 28, 2013
Hi, Do I have to this if I'm exporting the VMs to Cluster Shared Volumes (CSV)? I need to export 5 VMs from Hyper-V R2 (W2K8 R2) to Hyper-V 3.0 (W2K12)..... Thanks in advanced.Anonymous
March 18, 2014
OK, Scenarios: both Hyper-Vs joined to the same domain (or trusted domains): the Computername$ trick will work. the source joined to the domain and the destination not joined: enable Guest account temporarily, give Share and NTFS permission to guest. the export will work. the source not joined to the domain, the destination joined: have not tested! neither the source nor the destination joined to the domain: I can NOT get the export working what so ever! will not give up on this though. Do you have any idea why this is like this? my VMs are rather big and it takes twice the time to export it to a local storage and then manually copy over the network. I prefer to be able to export over the network even if the 2 hyper-Vs are not joined to any domain.Anonymous
March 24, 2014
Another solution, on Hyper-V 2012 R2 core, this is what I used...
- Connected usb ext drive to host, not joined to domain. Shared drive: net share <share name>=e: /GRANT:<hyper-v admin user>,FULL
- From domain member VM, SBS 2011(or other vm of your choice), map network drive, check reconnect at logon and connect using different credentials. <host server name><share name above> and enter the credentials for the hyper-v admin user above. Used to backup files for off-site using 2 external drives to alternate backups. Works for using the same drive mapping on the VM for file backups. Paul
- Anonymous
August 09, 2016
The comment has been removed