Cannot install VM - internal error: cannot load AppArmor /27.0.0-RC.1/

Hello, recently I’ve tried to install VM on 27.0.0-RC.1
No matter what options I do select , whether i try to install linux or windows I always get :
[EFAULT] internal error: cannot load AppArmor profile ‘libvirt-e3f3ad28-b55a-4f2e-bb52-6cdd3d77301c’

Full error is :

Error Name: EFAULT
Error Code: 14
Reason: [EFAULT] internal error: cannot load AppArmor profile 'libvirt-7b16b916-5786-4a5b-85ee-cb7bef4fc445'
Error Class: CallError
Trace: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/truenas_pylibvirt/error.py", line 44, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/truenas_pylibvirt/domain/manager.py", line 90, in start
if libvirtd_domain.create() < 0:
~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/lib/python3/dist-packages/libvirt.py", line 1390, in create
raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: cannot load AppArmor profile 'libvirt-7b16b916-5786-4a5b-85ee-cb7bef4fc445'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_lifecycle.py", line 53, in start
self.middleware.libvirt_domains_manager.vms.start(self.pylibvirt_vm(vm, options))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/truenas_pylibvirt/error.py", line 49, in wrapper
raise Error(str(e)) from e
truenas_pylibvirt.error.Error: internal error: cannot load AppArmor profile 'libvirt-7b16b916-5786-4a5b-85ee-cb7bef4fc445'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/middlewared/api/base/server/ws_handler/rpc.py", line 375, in process_method_call
result = await method.call(app, id_, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/middlewared/api/base/server/method.py", line 70, in call
result = await self.middleware.call_with_audit(self.name, self.serviceobj, methodobj, params, app,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
message_id=id_)
^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1107, in call_with_audit
result = await self._call(method, serviceobj, methodobj, params, app=app,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
audit_callback=audit_callback_messages.append, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 937, in _call
return await self.run_in_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
)
^
File "/usr/lib/python3/dist-packages/middlewared/main.py", line 817, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3/dist-packages/middlewared/api/base/decorator.py", line 227, in wrapped
result = func(*args)
File "/usr/lib/python3/dist-packages/middlewared/plugins/vm/vm_lifecycle.py", line 55, in start
raise CallError(str(e))
middlewared.service_exception.CallError: [EFAULT] internal error: cannot load AppArmor profile 'libvirt-7b16b916-5786-4a5b-85ee-cb7bef4fc445'

Any help more than welcomed :slight_smile:

What is VM?

Virtual Machine

Actually, I think @shoulders was asking what settings you were using for the VM in question. In particular, was this a pre-25 VM that had been migrated into incus, or was this one built in the VM UI?

Fresh using native UI. Nothing significant :
Linux (Tried also setting it as windows with windows defaults) , 1 CPU , 2 Cores , 1 Thread PC, Ram Max 2GB Min 256MB , 20 GB drive (fresh) , connected through bridged NIC

Details of your hardware, please. Do you have VT-x enabled in your BIOS?

Beelink Me Mini Pro (N150 / 16GB Ram, reporting 6GB free for use with VM)
vmx flags : vnmi preemption_timer posted_intr invvpid ept_x_only ept_ad ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_guest vapic_reg vid ple shadow_vmcs ept_violation_ve ept_mode_based_exec tsc_scaling usr_wait_pause

Problem seems to be solved by usual routine - I’ve restarted TrueNas and now everything works.
Thank you @Samuel_Tai for these questions. :slight_smile: Otherwise I probably would be stuck for longer not thinking about routine “have you tried to …”