Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

[SOLVED] qemu - shared folder without networking ?

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
4 posts • Page 1 of 1
Author
Message
sdauth
l33t
l33t
User avatar
Posts: 770
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

[SOLVED] qemu - shared folder without networking ?

  • Quote

Post by sdauth » Sun Dec 17, 2023 7:41 pm

Hi,
I have a win10 vm and would like to share a folder (/mnt/data/winshare) without having to enable any networking on the vm.
My vm is started with '-nic none' option, so basically I would like to replicate what virtualbox can easily do but with qemu. What are my options ?

Thanks!
Last edited by sdauth on Tue Dec 19, 2023 10:46 pm, edited 1 time in total.
Top
blu3bird
Retired Dev
Retired Dev
Posts: 619
Joined: Sat Oct 04, 2003 10:19 am
Location: Munich, Germany

  • Quote

Post by blu3bird » Sun Dec 17, 2023 8:03 pm

virtiofs works okayish though permission can be a pain in the butt.

Personally, I'd go for a host-only network and just use samba.
Black Holes are created when God divides by zero!
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Mon Dec 18, 2023 6:22 pm

There is 9P in kernel.
Qemu is said to be capable of exposing a host's directory to the guest as a 9p device. I've never used it though, for one-time stuff I'd just use a file as a block device because I already know how to use it.
Top
sdauth
l33t
l33t
User avatar
Posts: 770
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

  • Quote

Post by sdauth » Tue Dec 19, 2023 12:22 am

Hi,
So I tried virtfiofsd, not straightforward to setup, arch wiki was helpful.

On my qemu command line, I added the following :

Code: Select all

-object memory-backend-memfd,id=mem,size=16G,share=on \
-numa node,memdev=mem \
-chardev socket,id=char0,path=/mnt/vm/win10/win10-virtfs.sock \
-device vhost-user-fs-pci,chardev=char0,tag=winshare \
Before starting the vm, you need to start virtiofsd with the vm socket and dir to share :

Code: Select all

/usr/libexec/virtiofsd --socket-path=/mnt/vm/win10/win10-virtfs.sock --shared-dir /mnt/data/winshare --cache always
Some warning, error, I don't know yet how to solve this. (I start virtiofsd as user)

Code: Select all

2023-12-18T23:46:53Z WARN  virtiofsd::limits Failure when trying to set the limit to 1000000, the hard limit (4096) of open file descriptors is used instead.
2023-12-18T23:46:53Z WARN  virtiofsd::sandbox Couldn't set the process uid as root: -1
2023-12-18T23:46:53Z WARN  virtiofsd::sandbox Couldn't set the process gid as root: -1
2023-12-18T23:46:53Z INFO  virtiofsd Waiting for vhost-user socket connection...
2023-12-18T23:46:54Z INFO  virtiofsd Client connected, servicing requests
Warning: Cannot announce submounts, client does not support it
2023-12-18T23:57:51Z ERROR virtiofsd::passthrough::credentials failed to change uid back to root: Invalid argument (os error 22)
2023-12-18T23:57:51Z ERROR virtiofsd::passthrough::credentials failed to change gid back to root: Invalid argument (os error 22)
2023-12-19T00:03:12Z INFO  virtiofsd Client disconnected, shutting down

Nonetheless, the share works fine. I copied, deleted files without issue.

On the windows side, you need to install latest WinFsp & virtio-win (See: https://virtio-fs.gitlab.io/howto-windows.html )
After reboot, go in "Services" and make sure that virtiofs service is set to start automatically.

Also, I tried with a win7 vm but unfortunately it doesn't work.

Thanks for the suggestion blu3bird!

@szatox, isn't 9p only Linux though ? I'll give a try to file as block device later, this could be even better than virtiofsd for my use case...
Top
Post Reply

4 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy