I did a quick test on my local Samba 4.0 + Hyper-V 2012 setup and see
an access denied error, which appears to be due the following ACL issue:
- Hyper-V connects using the machine account (machine$)
- Hyper-V connects using the login account (admin)
- admin creates VM container directory (vmdir)
- admin sets security descriptor on vmdir:
acl: machine$(inherit only)=0x001f01ff
- machine$ attempts to open a non-existing "vmdir\Virtual Machines"
path, which fails at realpath() with EPERM. The ACL on the parent
does not allow machine$ execute permission, so realpath() is unabled
to traverse. This step would succeed on Windows, as the "Bypass
traverse checking" user right is granted by default.
I was able to work around the ACL issue by putting the VM metadata on local disk. The VM virtual disk remains on the Samba share.
The next road block appears to be support for resilient/persistent file-handles.
After creating the .vhdx file, Hyper-V issues a FSCTL_LMR_REQUEST_RESILIENCY request. Hyper-V cleans-up and disconnects after receiving the STATUS_INVALID_DEVICE_REQUEST response from Samba.
See bug #10159 for an explanation of why this fails. HyperV strictly requires FSCTL_LMR_REQUEST_RESILIENCY when used against SMB 2.10 or higher.
I assume this is the same issue that is causing Hyper-V to error: "Remote SMB share does not support resiliency." when moving from local storage to a Samba 3 SMB share?
Looking forward to developments on this, according to MS this should be supported by non-Microsoft SMB 3.0 hosts: http://technet.microsoft.com/en-us/library/jj134187.aspx