arighi / virtme-ng

Quickly build and run kernels inside a virtualized snapshot of your live system
GNU General Public License v2.0
449 stars 50 forks source link

Avoid virtio-9p for RH environments #63

Closed jacquetpi closed 8 months ago

jacquetpi commented 9 months ago

As virtio-9p is not available on Redhat environments[1], is it possible to use a workaround?

Error encountered:

$vng -r -m 4G --cpu 4 
qemu-kvm: -device virtio-9p-pci,fsdev=virtfs5,mount_tag=/dev/root: 'virtio-9p-pci' is not a valid device model name

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1741907

arighi commented 9 months ago

It looks like 9p is not supported in the qemu shipped with RH... weird, which version of qemu is that?

Do you have / can you install virtiofsd? It can be used as an alternative to 9pfs. Actually vng tries to use virtiofsd first (that also has better performance than 9pfs).

jacquetpi commented 9 months ago

My environment is:

$ uname -r
4.18.0-513.9.1.el8_9.x86_64
$qemu-kvm --version
QEMU emulator version 6.2.0 (qemu-kvm-6.2.0-40.module+el8.9.0+1654+f4df84c4.2)
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers

Thanks for the pointer! virtme-ng tries to pass the following command which fails on my configuration. I will investigate


$/usr/libexec/virtiofsd --syslog --socket-path /tmp/virtmer60f6q98  --shared-dir / --sandbox none
fuse: invalid argument `/tmp/virtmer60f6q98'
``
arighi commented 9 months ago

...

Thanks for the pointer! virtme-ng tries to pass the following command which fails on my configuration. I will investigate

$/usr/libexec/virtiofsd --syslog --socket-path /tmp/virtmer60f6q98  --shared-dir / --sandbox none
fuse: invalid argument `/tmp/virtmer60f6q98'
``

Probably it's trying to use the virtiofsd included in qemu (that is not really good... and it's deprecated now), you need to see if it's possible to install the new virtiofsd: https://gitlab.com/virtio-fs/virtiofsd

jacquetpi commented 9 months ago

Indeed, it fixed this error. However, I wasn't able to go further:
Sharing files between the host and its VMs using the virtiofs file system is unsupported in RHEL 8.

From here

arighi commented 9 months ago

Meh... there's not much we can do I guess, if both 9pfs and virtiofs are not supported. Maybe you can try to install a newer qemu, even if it's a bit painful to install packages that are not included in the distro...

arighi commented 8 months ago

I'm going to close this for now, if a distro does not support the bare minimum packaging requirements there's not much to do I think...