canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.32k stars 926 forks source link

`virtiofsd` is not detected on Arch Linux #12086

Closed libricoleur closed 1 year ago

libricoleur commented 1 year ago

Required information

Issue description

On Arch Linux hosts, any virtual machine using a shared folder currently falls back to a 9p mount because virtiofsd cannot be located by LXD. The reason seems to be that the code used to locate the virtiosfsd executable only looks in /usr/lib/qemu/ and /usr/libexec/. The former was used by the internal QEMU implementation which has now been removed, and the latter does not generally exists on Arch systems because its use is discouraged in favor of /usr/lib/*package*/. virtiofsd thus resides in /usr/lib/ on Arch.

Would it be acceptable to add /usr/lib/ to the list of directories checked by DiskVMVirtiofsdStart()? I can submit a pull request for this if it helps.

Steps to reproduce

  1. create a virtual machine
  2. add a shared folder to it eg. # lxc config device add foobar home disk source=/home path=/home
  3. start the virtual machine and check the filesystem used by the shared folder eg. lxc exec foobar mount | grep /home
  4. filesystem will be '9p' instead of 'virtiofs'

Additional info

tomponline commented 1 year ago

I think that would be fine, thanks.