Bug 1220304 - Filesystem virtiofs fails to start with "internal error: virtiofsd died unexpectedly"
Summary: Filesystem virtiofs fails to start with "internal error: virtiofsd died unexp...
Status: RESOLVED DUPLICATE of bug 1220592
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: KVM (show other bugs)
Version: Current
Hardware: x86-64 openSUSE Tumbleweed
: P5 - None : Minor (vote)
Target Milestone: ---
Assignee: Caleb Crane
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-25 15:31 UTC by Jecho Jekov
Modified: 2024-02-29 12:24 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jecho Jekov 2024-02-25 15:31:35 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0
Build Identifier: 

The latest updates broke the Filesystem sharing feature of KVM/QEMU. The reason seems to be the location of `virtiofsd`. The current location on my machine is `/usr/libexec/virtiofsd/virtiofsd` instead of `/usr/libexec/virtiofsd`. This causes AppArmor to deny permission to execute the file.

Reproducible: Always

Steps to Reproduce:
1. Configure a VM that uses the Filesystem feature with the `virtiofs` driver
2. Attempt to start the VM
Actual Results:  
An error message:

```
Error starting domain: internal error: virtiofsd died unexpectedly

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 71, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 107, 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 1425, in startup
    self._backend.create()
  File "/usr/lib64/python3.11/site-packages/libvirt.py", line 1379, in create
    raise libvirtError('virDomainCreate() failed')
libvirt.libvirtError: internal error: virtiofsd died unexpectedly

```

Expected Results:  
The VM starts successfully.

Excerpt from `/var/log/libvirt/qemu/{vm-name}-fs0-virtiofsd.log`:

```
libvirt:  error : cannot execute binary /usr/libexec/virtiofsd/virtiofsd: Permission denied
```

Excerpt from `/etc/apparmor.d/usr.sbin.virtqemud`:

```
/usr/{lib,lib64,lib/qemu,libexec}/virtiofsd PUx,
```

Workaround: Add the following line to `/etc/apparmor.d/usr.sbin.virtqemud`

```
/usr/{lib,lib64,lib/qemu,libexec}/virtiofsd/virtiofsd PUx,
```

Permanent solution: The location of `virtiofsd` should be `/usr/libexec/virtiofsd`
Comment 1 OBSbugzilla Bot 2024-02-26 15:35:02 UTC
This is an autogenerated message for OBS integration:
This bug (1220304) was mentioned in
https://build.opensuse.org/request/show/1151775 Factory / virtiofsd
Comment 2 David Disseldorp 2024-02-29 04:16:47 UTC
Thanks for the report...

(In reply to Jecho Jekov from comment #0)
...
> ```
> libvirt:  error : cannot execute binary /usr/libexec/virtiofsd/virtiofsd:
> Permission denied
> ```
> 
> Excerpt from `/etc/apparmor.d/usr.sbin.virtqemud`:
> 
> ```
> /usr/{lib,lib64,lib/qemu,libexec}/virtiofsd PUx,
> ```
> 
> Workaround: Add the following line to `/etc/apparmor.d/usr.sbin.virtqemud`
> 
> ```
> /usr/{lib,lib64,lib/qemu,libexec}/virtiofsd/virtiofsd PUx,
> ```

I wouldn't call fixing the apparmor profile to match the install path a workaround :-)

> Permanent solution: The location of `virtiofsd` should be
> `/usr/libexec/virtiofsd`

Path changes need to be handled carefully, as otherwise they can result in upgrade issues...

(In reply to OBSbugzilla Bot from comment #1)
> This is an autogenerated message for OBS integration:
> This bug (1220304) was mentioned in
> https://build.opensuse.org/request/show/1151775 Factory / virtiofsd

With the virtiofsd-1.10.1-3.1 update the path change results in:

Checking for file conflicts: ...........................................................................................................................................[done]
error: unpacking of archive failed on file /usr/libexec/virtiofsd;65e0040e: cpio: File from package already exists as a directory in system
error: virtiofsd-1.10.1-3.1.x86_64: install failed
error: virtiofsd-1.10.1-2.1.x86_64: erase skipped
(1/1) Installing: virtiofsd-1.10.1-3.1.x86_64 .........................................................................................................................[error]
Installation of virtiofsd-1.10.1-3.1.x86_64 failed:
Error: Subprocess failed. Error: RPM failed: Command exited with status 1.
Comment 3 James Fehlig 2024-02-29 04:59:03 UTC
(In reply to David Disseldorp from comment #2)
> With the virtiofsd-1.10.1-3.1 update the path change results in:
> 
> Checking for file conflicts:
> .............................................................................
> ..............................................................[done]
> error: unpacking of archive failed on file /usr/libexec/virtiofsd;65e0040e:
> cpio: File from package already exists as a directory in system
> error: virtiofsd-1.10.1-3.1.x86_64: install failed
> error: virtiofsd-1.10.1-2.1.x86_64: erase skipped
> (1/1) Installing: virtiofsd-1.10.1-3.1.x86_64
> .............................................................................
> ............................................[error]
> Installation of virtiofsd-1.10.1-3.1.x86_64 failed:
> Error: Subprocess failed. Error: RPM failed: Command exited with status 1.

This issue is already reported as bug#1220592.
Comment 4 Benjamin Greiner 2024-02-29 12:24:24 UTC
Yet another duplicate

*** This bug has been marked as a duplicate of bug 1220592 ***