Hyper-V Win Server 2019 export VM failed - operation not permited.

lukasfazik

Cadet
Joined
Jun 9, 2021
Messages
4
Version: TrueNAS-12.0-U4
Hardware config: TrueNAS is a virtual machine inside Hyper-V with attached 10TB disk via pass trough
Processor: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
RAM: 4GB virtual memory assigned via Hyper-V
Boot drive: Hyper-V virtual disk
This is temporary configuration until I move other VMs to the cluster

What I have done:
  1. Joined TrueNAS to the domain via an administrator account
  2. Created pool and "test" dataset on the TrueNAS
  3. Created SMB share from that dataset, enabled ACL
  4. Granted my domain account (is in Domain Admins) full permissions to the TrueNAS share/dataset
  5. Granted via Windows explorer full permissions on that dataset to a machine domain account
  6. As my troubleshooting steps I have enabled in TrueNAS share: Time Machine, Export Recycle Bin, Enable FSRVP, Enable ACL, Browsable to Network Clients, Enable SMB2/3 Durable Handles, Enable Alternate Data Streams, Enable Shadow Copies
  7. To fix temporarily non-domain backups that use robocopy, in Domain services -> Active Directory I have enabled Allow Trusted Domains
  8. To troubleshoot I have enabled in Services -> SMB: Enable Apple SMB2/3 Protocol Extensions and added Domain Admins group as Administrators group
My problem:
I can't export Hyper-V virtual machine on Windows Server 2019 to TrueNAS SMB share. The configuration level of virtual machines is 9.0. I receive an error:
1623243627499.png

I don't think it's a basic permission issue. I have full permission for the user account that exports the VM and also for the system account of the Hyper-V host. I have noticed that Hyper-V VMs with configuration level 8.0 export just fine. I think it's maybie some issue with samba that it doesn't support some commands that WIndows sends. Export to the Windows computer or server that hosts Windows share works fine.

I have found similar threads but no solution:
Exporting Hyper-V VM's using Export-VM to a Seagate NAS Device (microsoft.com)
Hyper-V Export von Windows Server 2019 auf Synology-NAS schlägt fehl. Event-ID 18350 (microsoft.com)
(I used google translate to translate the second thread to English)

Last words:
I don't want to export VMs locally and use robocopy to copy them over to the TrueNAS later because I want to create Hyper-V hyper-converged cluster with no shared storage. So it would require another machine to accepts exports and copy them to the NAS. Also, some VMs are large (One is 1,2TB for example)

To all readers, I wish good rest of the day and to replyers, I am thanking them in advance :)
 

lukasfazik

Cadet
Joined
Jun 9, 2021
Messages
4
Thank you!
My problem is now solved I have downgraded SMB to SMB2 version 2.0.2, later versions don't support FSCTL_LMR_REQUEST_RESILIENCY feature which should be available from version 2.10.
To fix the issue add protocol = SMB2_02 to Services -> SMB in TrueNAS
1623931229847.png

This is the link from the thread mentioned above that describes the issue: 9938 – Create VM fails on Hyper-V 2012 (samba.org) this bug is old (2013). But it wasn't fixed as one person from 2021 have said, it's still present. But the interesting thing is that only Windows Server 2019 version 9.0 VMs are affected. Probably they started using this feature for exports as well, not only to run VMs from SMB Share.

I will continue the testing on SMB version 2.0.2. If something bad happens with exports I will try to let you know. Otherwise, I will mark this as solved.

Hope samba will fix this so we can use encryption and a more modern SMB protocol. Export could be faster without encryption overhead.
 

lukasfazik

Cadet
Joined
Jun 9, 2021
Messages
4
I have another issue. I can export only VMs that are turned off. When I export VM that is turned on I will get:
1624437611944.png

I have permissions for the computer account and the user account that initalizes the export. Currently I am testing various SMB versions on TrueNAS
 

lukasfazik

Cadet
Joined
Jun 9, 2021
Messages
4
My temporary solution is that I have created VHDX virtual hard drive on SMB share that I have mounted in the Hyper-V host. The only thing I need to resolve is that It only allows only one computer to mount it.
 
Last edited:
Top