6

I have a Windows host and a Linux guest. I can easily use the "shared folders" functionality to mount a windows directory inside the guest using the Virtualbox Guest Addons.

I would like to, instead, mount a guest directory inside Windows.

Does Virtualbox give us anything here? Or is the only possibility to install Samba on the guest and mount it as usual (i.e., without Virtualbox in the mix)?

AnoE
  • 872
  • 5
  • 12
  • You answered your own question with "Install Samba" – HackSlash Jan 19 '18 at 23:43
  • Does this answer your question? [Share VirtualBox folders in reverse? Guest-Host?](https://superuser.com/questions/241825/share-virtualbox-folders-in-reverse-guest-host) – StayOnTarget Oct 08 '21 at 17:09
  • Not really, @StayOnTarget. It confirms the result that what I have asked 4 years ago is impossible - i.e., "native" sharing using the guest tools without using any of the regular mechanisms like Samba/CIFS/NFS... – AnoE Oct 08 '21 at 18:01
  • You could try to mount the image file itself onto a directory on the host. https://askubuntu.com/q/19430/2355 – Flimm Jan 11 '22 at 13:03

2 Answers2

1

It turns out that Virtualbox has no such provisions, and thinking about it, it would not make sense to expect this feature. Virtualbox is the host, it is living on the host, it has no idea about the guest. I could not elicit access from the guest in any way.

Possible they could, in the future, add a new guest helper (like the display/drag&drop etc. helpers) that could do that. But this is a) obviously not in, right now, and b) would be incredibly more complex, so it would be very unlikely to do so.

kenorb
  • 24,736
  • 27
  • 129
  • 199
AnoE
  • 872
  • 5
  • 12
  • VirtualBox Guest Additions install software on the guest. If you install that, VirtualBox does have access to the guest, so to speak. – Flimm Jan 11 '22 at 13:11
  • Thanks, @Flimm, but this question is about the opposite use-case (mounting a guest directory onto the host). – AnoE Jan 11 '22 at 13:34
  • Yes, I know. I'm just saying, the introductory paragraph of your answer doesn't make sense once you know about VirtualBox Guest Additions. It does make sense to expect this feature, since VirtualBox Guest Additions install software, which could in theory make it possible to share a folder from the guest onto the host. – Flimm Jan 11 '22 at 13:50
1

Inside your Linux guest you can "export" a folder, then mount it in the Windows host. For this to work, the guest and host would need to see each other, i.e. they would need to be on the same IP network, or a route would need to exist between their IT networks. If you export it as CIFS (SAMBA), it will appear in Windows with standard UNC path: \\server\share where server would be the hostname and share would be the exported folder name. If you export it as NFS, and your version of Windows has NFS for Windows available, you'll be able to access/map through UNC path.

HOWEVER there is an easier way. Mount a host directory in the guest and put the files you want to transfer in that directory. Additionally, if you have any sort of NAS or file server on your network, you could mount a folder from it on host and guest and use it as a drop box.

Jeter-work
  • 523
  • 2
  • 9
  • While this answer is technically the best one, the question was specifically about "onboard" features of Virtualbox. Using Samba/CIFS/NFS/... is always an option of course. Regarding the "easier way", in my case, as far as I can recall, my issue was that I really wanted to keep the files in the guest FS for some reason. – AnoE Jan 21 '21 at 08:13