KVM Passthrough Filesystem

  • Hi there,

    I do have a Layer 8 problem with the Passthrough Filesystem in KVM Plugin. ?(

    How does the Passthrough Filesystem setup work?

    Where do I find the Mount Tag in the running VM to mount the passthrough?

    • Official Post

    How does the Passthrough Filesystem setup work?

    https://libvirt.org/kbase/virtiofs.html


    Where do I find the Mount Tag in the running VM to mount the passthrough?

    Depends on the OS. The link above describes it for Linux. No idea about Windows.

    omv 8.0.6-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.2 | compose 8.1.2 | cterm 8.0 | borgbackup 8.0.2 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • @ ryecoaaron

    Hello,

    I did not get to try out the link until today.

    The first thing, I noticed was, that the Domain XML differs to the one on libvirt.org (my domain xml.png, from libvirt.org.png)


    Reading the note: this requires virtiofs support in the guest kernel (Linux v5.4 or later).

    I found a guide on https://wiki.sep.de/wiki/index…ng_guestfs-tools_on_Linux and installed the guestfs-tools package.


    I ran the command, as shown at libvirt.org mount -t virtiofs mount_tag /mnt/mount /path an got this error (mount error- noVNC.png)


    What am I missing again? :cursing::cursing::cursing:


    THX

    • Official Post

    What am I missing again?

    Not sure. I haven't tried in a long time but I know the xml the plugin is generating works. I will have to try it again even though I have no use for this. It might be a couple of days.

    that the Domain XML differs to the one on libvirt.org

    There is more than one way to configure.

    omv 8.0.6-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.2 | compose 8.1.2 | cterm 8.0 | borgbackup 8.0.2 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I'm trying the same to mount the passthrough filesystem, but I'm failing.


    I guess I did it right on the host


    Code
    <filesystem type='mount' accessmode='mapped'>
          <source dir='/srv/dev-disk-xxxx/DLNA'/>
          <target dir='/DLNA'/>
          <alias name='fs0'/>
          <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
        </filesystem>

    But what do I have to do on the guest?

    Guestsystem is Home Assistant, I do not know if this matters.


    I tried it with this on the guest

    mount -t 9p -o trans=virtio /DLNA /media/Music

    but without success. ("no such device")


    Any idea how to mount the host folder?

    • Official Post

    What is the output of: lsmod | grep -i 9p

    omv 8.0.6-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.2 | compose 8.1.2 | cterm 8.0 | borgbackup 8.0.2 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    The command only matters on the guest. You don't have 9p support loaded. I have no idea how home assistant is built but you could try loading the module with sudo modprobe 9p

    omv 8.0.6-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.2 | compose 8.1.2 | cterm 8.0 | borgbackup 8.0.2 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • seems it is not working or installed :(


    modprobe: can't change directory to '/lib/modules': no such file or directory


    tried to created the missing folder, but this does not help, too


    modprobe: can't change directory to '5.15.72': no such file or directory

    • Official Post

    seems it is not working or installed

    That would be a good question for the home assistant forum.

    omv 8.0.6-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.2 | compose 8.1.2 | cterm 8.0 | borgbackup 8.0.2 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Official Post

    where I find the passthough filesystem on a generic Ubuntu?

    Where you "find" it? Not sure why you are trying to find it. You really should take the slash out of the tag for the target since it is not a path. Then you mount by tag - mount -t virtiofs mount_tag /mnt/mount/path. So, nothing to find. https://libvirt.org/kbase/virtiofs.html

    omv 8.0.6-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.2 | compose 8.1.2 | cterm 8.0 | borgbackup 8.0.2 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Ah I see. What I do not get is, how to edit the XML config file over the OMV userinterface. I can edit it, but when I saved it and re-open all modifications are gone.

    I tried to edit it, because I have this entry

    Code
        <filesystem type='mount' accessmode='mapped'>
          <source dir='/srv/dev-disk-by-uuid-xxx/DLNA'/>
          <target dir='DLNA'/>
          <alias name='fs0'/>
          <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
        </filesystem>


    But I would like to try this one


    Code
    <filesystem type='mount' accessmode='passthrough'>
          <driver type='virtiofs'/>
          <source dir='/path'/>
          <target dir='mount_tag'/>
        </filesystem>


    Anyway your command returns an error (worng filesystem, wrong options, Superblock corrupted).

    • Official Post

    I can edit it, but when I saved it and re-open all modifications are gone.

    You should do it when the VM is not running.


    Anyway your command returns an error (

    It was an example not something you should try. You should follow the docs I linked to.

    omv 8.0.6-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.2 | compose 8.1.2 | cterm 8.0 | borgbackup 8.0.2 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Thanks again.

    I tried it, with "shutoff"-state. But the XML won't save my changes.


    But anyway, I guess this gets to complicated here for to less of use. I will try another way to get my Music Directory to the Home Assistant :)

  • I did manage to passthrough a folder using the method described in ryecoaaron 's link, with editing the xml and inserting the Memorybacking and Filesystem entries.


    Only thing that threw me for a loop for a second is that when you use the UI to create a passthrough link, in the xml the accesmode is set as "mapped" instead as "passthrough", and I don't need mapped.


    So my fix was to not use the UI and just do it all in the xml while the VM is down:


    Code
         <filesystem type='mount' accessmode='passthrough'>
          <driver type='virtiofs' queue='1024'/>
          <binary path='/usr/lib/qemu/virtiofsd'/>
          <source dir='/srv/dev-disk/shared_folder'/>
          <target dir='shared_folder_tag'/>
          <alias name='fs0'/>
          <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
        </filesystem>

    After that in the VM create a mountpoint mount_here (with correct permissions, read section mapped, passthrough, squash in link) and mount the tag :


    Code
    mount -t virtiofs shared_folder_tag /mnt/mount_here


    EDIT : see my post below concerning unique hardware addressing.

    Edited 2 times, last by DaisyF8: Found out something important ().

  • And something to add : How to add unique passthrough hardware/folders


    I only found this out afterwards, so only editing the xml would be more difficult. You need to use UI and edit xml.


    The tricky bit is that in the xml the virtual addressing for the passthrough "hardware"" needs to be unique. This is in every device-entry handeled by this line :

    Code
    <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>

    I tried changing for instance slot or bus to a random number but if you get it wrong (not unique or not conforming to general linux rules) the entire device-entry gets removed.


    So what you can do is first use the UI to add a "mapped" folder in the xml. This way you get an entry with a unique address. And then you change accessmode "mapped" to "passthrough" and add two lines like in my post above.

    Code
          <driver type='virtiofs' queue='1024'/>
          <binary path='/usr/lib/qemu/virtiofsd'/>

    Also, to mount automatically use this in /etc/fstab :

    Code
    shared_folder_tag            /mnt/mount_here       virtiofs     defaults 0 0
  • fbohnen

    Added the Label resolved

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!