Public bug reported:

Today I upgraded from 22.04 to 24.04

10.0.0-2ubuntu8.2


I have a VM with 16GB of hugepages allocated to it.

This no longer works.

I can not defeat the virtual machine start up error (from virtual
manager):

Error starting domain: internal error: QEMU unexpectedly closed the
monitor (vm='ubuntu24.04'): 2024-07-16T04:54:51.443751Z 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-16T04:54:51.443751Z qemu-system-x86_64: failed to 
resize memfd to 17179869184: Permission denied

I have done this:

sudo aa-complain /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper
sudo aa-complain /etc/apparmor.d/usr.sbin.libvirtd

While I did not have to take any such steps with 22.04, I have mounted

sudo mount -t hugetlbfs -o mode=1770,gid=kvm none /dev/hugepages

and these permissions are observed:

root@black:/etc/apparmor.d# ls -ld /dev/hugepages
drwxrwx--t 3 root kvm 0 Jul 16 14:47 /dev/hugepages

root@black:/etc/apparmor.d# id libvirt-qemu
uid=64055(libvirt-qemu) gid=109(kvm) 
groups=109(kvm),139(libvirt),64055(libvirt-qemu),1002(hugetlb)

I have edited /etc/libvirt/qemu.conf to uncomment the mount point of the
hugepages, even though this was not necessary with 22.04

log entries don't add anything (for me):

2024-07-16T04:54:51.443751Z qemu-system-x86_64: failed to resize memfd to 
17179869184: Permission denied
2024-07-16 04:54:51.477+0000: shutting down, reason=failed

kernel stuff:

# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-6.8.0-38-generic 
root=UUID=756dca1f-0eb5-440e-a84e-dfa56a27e355 ro quiet splash zswap.enabled=1 
zswap.compressor=lz4 zswap.zpool=z3fold mitigations=off vt.handoff=7

** Affects: libvirt (Ubuntu)
     Importance: Undecided
         Status: New

** Summary changed:

- hugespages causes permissions error
+ hugepages causes permissions error

** Description changed:

  Today I upgraded from 22.04 to 24.04
  
  I have a VM with 16GB of hugepages allocated to it.
  
  This no longer works.
  
  I can not defeat the virtual machine start up error (from virtual
  manager):
  
  Error starting domain: internal error: QEMU unexpectedly closed the
  monitor (vm='ubuntu24.04'): 2024-07-16T04:54:51.443751Z 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')
+   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-16T04:54:51.443751Z qemu-system-x86_64: failed to 
resize memfd to 17179869184: Permission denied
- 
  
  I have done this:
  
  sudo aa-complain /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper
  sudo aa-complain /etc/apparmor.d/usr.sbin.libvirtd
  
- 
- While I did not have to take any such steps with 22.04, I have mounted 
- 
+ While I did not have to take any such steps with 22.04, I have mounted
  
  sudo mount -t hugetlbfs -o mode=1770,gid=kvm none /dev/hugepages
  
  and these permissions are observed:
  
  root@black:/etc/apparmor.d# ls -ld /dev/hugepages
  drwxrwx--t 3 root kvm 0 Jul 16 14:47 /dev/hugepages
  
- 
  root@black:/etc/apparmor.d# id libvirt-qemu
  uid=64055(libvirt-qemu) gid=109(kvm) 
groups=109(kvm),139(libvirt),64055(libvirt-qemu),1002(hugetlb)
  
  I have edited /etc/libvirt/qemu.conf to uncomment the mount point of the
  hugepages, even though this was not necessary with 22.04
  
- 
  log entries don't add anything (for me):
  
  2024-07-16T04:54:51.443751Z qemu-system-x86_64: failed to resize memfd to 
17179869184: Permission denied
  2024-07-16 04:54:51.477+0000: shutting down, reason=failed
+ 
+ 
+ kernel stuff:
+ 
+ # cat /proc/cmdline
+ BOOT_IMAGE=/vmlinuz-6.8.0-38-generic 
root=UUID=756dca1f-0eb5-440e-a84e-dfa56a27e355 ro quiet splash zswap.enabled=1 
zswap.compressor=lz4 zswap.zpool=z3fold mitigations=off vt.handoff=7

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2073214

Title:
  hugepages causes permissions error

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/2073214/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to