TrueNAS: Only one Virtual CPU is allowed in this system

I’m on TrueNAS SCALE 25.10.4 – Goldeye (Community Edition).

First, we need to change the permission of /usr to read-write. If you do not do this, you cannot save the changes.

sudo mount -o remount,rw /usr

Create a backup of the original file /usr/lib/python3/dist-packages/middlewared/plugins/vm/vms.py (optional).

sudo cp /usr/lib/python3/dist-packages/middlewared/plugins/vm/vms.py /usr/lib/python3/dist-packages/middlewared/plugins/vm/vms.py.bak

Edit /usr/lib/python3/dist-packages/middlewared/plugins/vm/vms.py (it should be around line 227, on my version it’s on line 248-256).

sudo vim /usr/lib/python3/dist-packages/middlewared/plugins/vm/vms.py
#elif flags['intel_vmx']:
#    if vcpus > 1 and flags['unrestricted_guest'] is False:
#        verrors.add(
#            f'{schema_name}.vcpus', 'Only one Virtual CPU is allowed in this system.')
#elif flags['amd_rvi']:
#    if vcpus > 1 and flags['amd_asids'] is False:
#        verrors.add(
#            f'{schema_name}.vcpus', 'Only one virtual CPU is allowed in this system.'
#        )

Restart the service:

sudo systemctl restart middlewared

Change the permission of /usr back to read-only.

sudo mount -o remount,ro /usr

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *