#805624 libvirt-bin: document how to access host file system

Package:
libvirt-bin
Source:
libvirt
Submitter:
Ritesh Raj Sarraf
Date:
2023-04-17 15:57:35 UTC
Severity:
wishlist
Tags:
#805624#5
Date:
2015-11-20 12:06:39 UTC
From:
To:
Hello Guido,

Please find attached a small update to the README.Debian. It has
pointers on how a Host file system inteface can be attached to the
Guest. I've only documented the most common use case.

#805624#10
Date:
2015-11-20 20:51:01 UTC
From:
To:
Hi Ritesh,
Thanks for the patch! First off wouldn't we be better off improving the
upstream docs?  What didn't you like about them?

If we do this on the Debian side we should explain the whole thing, that
is the libvirt XML _and_ the client side. What do you think? A bit like

http://wiki.qemu.org/Documentation/9psetup

but much shorter. We also need to mention that this is a QEMU/KVM thing.
Cheers,
 -- Guido

#805624#15
Date:
2015-11-21 07:21:29 UTC
From:
To:
Hello Guido,

I did not try them. Actually I did not know where to look at, for
upstream docs.

I'm not sure if putting everything complete in the README.Debian file
would be practical. My understanding always was to use this file for
the obvious questions and brief answers to them, and further
pointers/hints on what to look for.

#805624#20
Date:
2015-11-26 10:26:40 UTC
From:
To:
Hi, Ritesh,
On Sat, Nov 21, 2015 at 12:51:29PM +0530, Ritesh Raj Sarraf

So in this case s.th. like:

* How can I mount a directory from the host in a QEMU VM.

  Use the 9pfs filesystem with a domain xml like:

    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/direcgory/on/host'/>
      <target dir=share'/>
    </filesystem>

  and to mount it within the guest use:

  cat <<EOF > /etc/fstab
      share /mnt/share  9p  trans=virtio,rw,_netdev 0       0
  EOF
  mount /mnt/share

  See https://libvirt.org/formatdomain.html#elementsFilesystems for
  details.

Or maybe we want to have more like a "How do I switch from VirtualBox to
QEMU" section?

What I'd like to understand is what motivated you to submit the patch.
I'm pretty sure we need to improve on the docs, just trying to figure
out _where_.

Cheers,
 -- Guido

#805624#25
Date:
2015-11-26 12:06:39 UTC
From:
To:
This is pretty good.

I'd rather stick with documenting basic obvious things only. I think
the catch is on what constitutes "basic obvious things".

So, virt-manager, shows the option to add a share. There, in that
window, it gives no feedback on what needs to be done on the guest.

So the standard expectation would be that on next boot the guest would
have the storage accessible. FYI, that's how it is on VBox (Assuming
you have the VBox Guest Extensions Installed).

So with nothing being accessible in the Guest VM, my next step was to
look at the maintainer docs (README.Debian), if anything obvious is
documented.

Next, Google for "libvirt mount hostfs" led to a bunch of blog entries
that gave me the hint about 9p file system.

Assuming, that there may be users who may not have access to the
internet, this is not the most optimal option.



But that said, I do think too, that there needs to be a line ensuring
we don't clutter our usual README docs.




Looking again at this stack:

libvirt-bin package has no direct relationship with libvirt-doc.
Neither does virt-manager package.

virt-manager GUI app has a Help menu. But just with 1 button talking
"About" the tool.


Actually, you put the right question on what led me to write the patch.
So in my case, the usual practice has been to refer README.Debian. But
while writing this reply, it has made me wonder what a normal user
would do. Because there is no direct relationship established in-
between the tool and the documentation; even though both are available
in Debian.

#805624#30
Date:
2016-02-13 16:37:38 UTC
From:
To:
Hmmm...so how would we go from here? Looking from the VBox->KVM
migration for "desktop" scenarios this would need improvements in
virt-managers help system or even better: make things simpler by using
qemu-ga to actually add a mount point for the 9pfs filesystem.  We seem
to have more than enough in  qemu-ga nowadays to make this possible:

https://github.com/qemu/qemu/blob/master/qga/qapi-schema.json

We have such nice tools but sometimes we lack the plumbing to make
things simple.

Cheers,
 -- Guido

#805624#35
Date:
2016-02-19 11:28:35 UTC
From:
To:
Guido Günther wrote (13 Feb 2016 16:37:38 GMT) :

Sounds like a good idea. I guess it would need to be exposed in
libvirt as a domain option, so that virt-manager can expose it to
GUI users. Next step may be to raise this topic upstream.

Absolutely.

Cheers,

#805624#40
Date:
2016-02-19 14:25:55 UTC
From:
To:
We can already run all the agent commands through libvirt via
virDomainQemuMonitorCommand so the libvirt end is already fine. Somebody
just needs to find the time to issue these comands through virt-manager
and add "a bit" of UI so we can propose it upstream. I'll add least add
this to my todo list.