13

Hi everyone! I want to be able to access a folder inside the guest that corresponds to a cloud drive that is mounted inside the guest for security purposes. I have tried setting up a shared filesystem inside Virt-Manager (KVM) with virtiofs (following this tutorial: https://absprog.com/post/qemu-kvm-shared-folder) but as soon as I mount the folder in order for it to be accessible on the guest the cloud drive gets unmounted. I guess a folder cannot have two mounts at the same time. Aliasing the folder using bind and then sharing the aliased folder with the host doesn't work either. The aliased folder is simply empty on the host.

Does anyone have an idea regarding how I might accomplish this? Is KVM the right choice or would something like docker or podman better suited for this job? Thank you.

top 13 comments
sorted by: hot top controversial new old
[-] possiblylinux127@lemmy.zip 1 points 2 hours ago

You don't

That is going to be painful and not beneficial

[-] Appoxo@lemmy.dbzer0.com 6 points 2 days ago

Maybe NFS share the drive from guest to host?

[-] GathererStuff@lemmy.ml 1 points 1 day ago

What would be the performance implications? Isn't virtiofs theoretically faster?

[-] Appoxo@lemmy.dbzer0.com 1 points 20 hours ago

Not an expert.
Assuming it's internal I'd assume it's probably as fast as the guest nic allows?

[-] Atherel@lemmy.dbzer0.com 2 points 2 days ago

This, had the same idea for other purposes, sharing a folder from vm to host through network share is the easiest way. Every other solution looks more elegant on paper but has lots of pitfalls.

[-] GathererStuff@lemmy.ml 1 points 1 day ago* (last edited 1 day ago)

Every other solution looks more elegant on paper but has lots of pitfalls

A very sane and fair comment.

[-] GathererStuff@lemmy.ml 1 points 2 days ago

I can try but I might end up in the same situation as with virtiofs. The cloud drive will get unmounted and I will end up with an empty folder when I try to access it from the host.

[-] wildbus8979@sh.itjust.works 2 points 2 days ago

Absolutely not, NFS is a shared mount. Virtiofs is more complicated because it is emulating a block device.

[-] GathererStuff@lemmy.ml 1 points 2 days ago

Then I will try NFS and get back to you. Thanks :)

[-] DetachablePianist@lemmy.ml 2 points 2 days ago

Maybe see if 'rclone mount' solves the problem for ya. Rclone can often be a super handy swiss army knife for stuff like this.

[-] GathererStuff@lemmy.ml 1 points 2 days ago

The cloud binary is proprietary and it's not supported by rclone unless I find out how the binary works but I doubt it uses something standardized like WebDAV underneath.

[-] NeoNachtwaechter@lemmy.world 1 points 2 days ago* (last edited 2 days ago)

You say it is mounted. Then you can share it in all the same ways as you would share any other of the VM's folders.

I am using SMB shares for that (but that is not always the best way ofc).

[-] GathererStuff@lemmy.ml 1 points 2 days ago

The cloud drive is mounted on the guest, yes, but once I mount it with virtiofs in order to share it with the host it gets unmounted and I end up with an empty folder. bind doesn't work either.

this post was submitted on 03 Nov 2024
13 points (93.3% liked)

Selfhosted

39677 readers
387 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS