I recently got hugepages working with Ubuntu 22.04 and an Ubuntu 24.04 guest. It was very easy, I just enabled it in /etc/sysctl.conf and that seemed to be it.
I upgraded the host of 24.04 today. hugepages now cause permission errors with virt-manager in the same guest.
Error starting domain: internal error: QEMU unexpectedly closed the monitor (vm='ubuntu24.04'): 2024-07-16T02:27:17.591625Z qemu-system-x86_64: failed to resize memfd to 17179869184: Permission denied
Error starting domain: internal error: QEMU unexpectedly closed the monitor (vm='ubuntu24.04'): 2024-07-16T02:44:28.703713Z qemu-system-x86_64: failed to resize memfd to 17179869184: Permission denied
Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in cb_wrapper callback(asyncjob, *args, **kwargs) File "/usr/share/virt-manager/virtManager/asyncjob.py", line 108, in tmpcb callback(*args, **kwargs) File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 57, in newfn ret = fn(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/virt-manager/virtManager/object/domain.py", line 1402, in startup self._backend.create() File "/usr/lib/python3/dist-packages/libvirt.py", line 1379, in create raise libvirtError('virDomainCreate() failed') libvirt.libvirtError: internal error: QEMU unexpectedly closed the monitor (vm='ubuntu24.04'): 2024-07-16T02:44:28.703713Z qemu-system-x86_64: failed to resize memfd to 17179869184: Permission denied
I have tried mounting hugepages, change permissions and so on, but nothing has worked. I disabled apparmor; it made no difference.