SOLVED Error creating VM Windows 10 on 12.0-U7 / solved: create a new zvol+use AHCI !

Ordi

Cadet
Joined
Aug 8, 2016
Messages
7
Hi.

I'm on TrueNAS v12.0-U7.
When I try to create a Windows VM, I get the following error message at step 6 "Confirm options": "Error creating VM: expected bytes, NoneType found".
The detailed message is:

Error: concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last): File "/usr/local/lib/python3.9/concurrent/futures/process.py", line 243, in _process_worker r = call_item.fn(*call_item.args, **call_item.kwargs) File "/usr/local/lib/python3.9/site-packages/middlewared/worker.py", line 94, in main_worker res = MIDDLEWARE._run(*call_args) File "/usr/local/lib/python3.9/site-packages/middlewared/worker.py", line 45, in _run return self._call(name, serviceobj, methodobj, args, job=job) File "/usr/local/lib/python3.9/site-packages/middlewared/worker.py", line 39, in _call return methodobj(*params) File "/usr/local/lib/python3.9/site-packages/middlewared/worker.py", line 39, in _call return methodobj(*params) File "/usr/local/lib/python3.9/site-packages/middlewared/schema.py", line 979, in nf return f(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/zfs.py", line 494, in query datasets = list(datasets) File "libzfs.pyx", line 391, in libzfs.ZFS.__exit__ File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/zfs.py", line 484, in query datasets = [zfs.get_dataset(filters[0][2]).__getstate__(**state_options)] File "libzfs.pyx", line 1175, in libzfs.ZFS.get_dataset TypeError: expected bytes, NoneType found """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 138, in call_method result = await self.middleware._call(message['method'], serviceobj, methodobj, params, app=self, File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1213, in _call return await methodobj(*prepared_call.args) File "/usr/local/lib/python3.9/site-packages/middlewared/service.py", line 484, in create rv = await self.middleware._call( File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1213, in _call return await methodobj(*prepared_call.args) File "/usr/local/lib/python3.9/site-packages/middlewared/schema.py", line 975, in nf return await f(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/vm.py", line 1282, in do_create await self.__common_validation(verrors, 'vm_create', data) File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/vm.py", line 1376, in __common_validation await self.middleware.call( File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1256, in call return await self._call( File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1213, in _call return await methodobj(*prepared_call.args) File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/vm.py", line 2283, in validate_device zvol = await self.middleware.call( File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1256, in call return await self._call( File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1224, in _call return await self.run_in_executor(prepared_call.executor, methodobj, *prepared_call.args) File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1128, in run_in_executor return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs)) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.9/site-packages/middlewared/schema.py", line 979, in nf return f(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/pool.py", line 2772, in query self.__transform(self.middleware.call_sync( File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1276, in call_sync return self.run_coroutine(self._call_worker(name, *prepared_call.args)) File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1312, in run_coroutine return fut.result() File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 438, in result return self.__get_result() File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result raise self._exception File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1227, in _call_worker return await self.run_in_proc(main_worker, name, args, job) File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1154, in run_in_proc return await self.run_in_executor(self.__procpool, method, *args, **kwargs) File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1128, in run_in_executor return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs)) TypeError: expected bytes, NoneType found

What I do from step 1 to step 6:

1.png


2.png

3.png

4.png

5.png

6.png

7.png


What is happening here?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
You need to select your zvol under the disk screen. Also, you should change your disk type to AHCI, as Windows doesn't have native drivers for VirtIO disks.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
@Samuel Tai I would still recommend a VirtIO based disk. You can add a second CDROM device with the Fedora driver CD image mounted and load the drivers during installation. That's what I do, at least.
 

Ordi

Cadet
Joined
Aug 8, 2016
Messages
7
You need to select your zvol under the disk screen. Also, you should change your disk type to AHCI, as Windows doesn't have native drivers for VirtIO disks.
Yes, I suspected it too, but I CAN'T select a zvol. The GUI doesn't give me any choice.

By the way, I didn't create a zvol for the VM. Should I do?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
If the choice to select a zvol is unavailable, then there's no zvol within your pool. You should either create a zvol of the desired size, or choose the "Create new disk image" to have the wizard create a zvol for you.
 

Ordi

Cadet
Joined
Aug 8, 2016
Messages
7
I created a new zvol named VM, but still the same problem, at step 3, "Disks", I can't select the zvol.

8.png
 

Ordi

Cadet
Joined
Aug 8, 2016
Messages
7
If the choice to select a zvol is unavailable, then there's no zvol within your pool. You should either create a zvol of the desired size, or choose the "Create new disk image" to have the wizard create a zvol for you.
My pool:

9.png
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Sorry, VM is a dataset, not a zvol. Delete it and recreate it as a zvol, and it will show up in the pool with type zvol. It can be selected then.
 

Ordi

Cadet
Joined
Aug 8, 2016
Messages
7
Sorry, VM is a dataset, not a zvol. Delete it and recreate it as a zvol, and it will show up in the pool with type zvol. It can be selected then.
Yes you were right.

Now another problem: Now the installation wizard of Windows 10 starts, the storage virtIO driver loads correctly and Windows see the storage, but as soon as the installation begins, when the wizard starts to write on the disk, the vnc connection is closed and I can't connect to the VM anymore.
When I try to stop the Windows VM, an error happens: "Failed: an error occured, but the cause is unknown".
...
Don't know what to try. But I need some sleep now.
Thank you all!
The journey will continue soon.
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
The built-in VNC viewer is trash. Use an external VNC viewer, and hardcode the port for the VNC device.
 

Ordi

Cadet
Joined
Aug 8, 2016
Messages
7
I have bound the VM to a static ip address and hardcoded a simple port for VNC.

However, the same problem happens with VNC Viewer: the installation starts, then the connexion is cut. When I try to reconnect, the connexion is rejected by VNC.

If I shut down the VM and start it again, I can connect again to the VM. But as soon as I have selected the virtIO driver for the storage, the VNC connexion shuts down.

I have no choice but to delete the VM and the zvol, and start all over again.

I'm sure that both virtIO and Windows ISOs are compliant.

I'm wondering...
When I set the dataset "Volume-6X8To-Z2" for the first time (the zvol hosting the VM is a member of it), I change its permissions.
Originally, the permissions of Volume-6X8To-Z2 were:
Code:
drwxr-xr-x root wheel Volume-6X8To-Z2

and I changed them for:
Code:
drwxrwx--- root wheel Volume-6X8To-Z2

Could it be the root of my inability to write on the zvol of the VM?
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Yes, please don't change the permissions of the top-level of your pool.
 

Ordi

Cadet
Joined
Aug 8, 2016
Messages
7
Last edited:
Top