[SOLVED] VirtualBox shared folders

Questions about virtualization software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Mage of Maple
Level 2
Level 2
Posts: 70
Joined: Tue Jul 10, 2018 10:41 am
Location: Maryland USA
Contact:

[SOLVED] VirtualBox shared folders

Post by Mage of Maple »

Hello,

I'm having an issue with shared folders. (they don't work.) My host is Mint 19 and my guest in Mint 19. I'm running the network in bridged mode. I have guest additions installed. A created the share with AutoMount set to yes. I've turned the firewall off on both host and guest. If it matters, I'm running Mullvad VPN on both the host and the guest.

Basically, I see nothing mounted in /media/greg. Attempting to mount it manually gives "mounting failed with the following error: Protocol error"

Any ideas?

Thanks!
Greg
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
redlined

Re: VirtualBox shared folders

Post by redlined »

hi Greg!

I'm new to linux and don't use virtualbox but I really think it is VPN setup, especially if both host and guest are each connected to VPN and routes are complicting things by doing so- unless you've got routes tweaked as a known issue.

This help/answer response may help with your issue which sounds close enough related to fix your issue:
https://superuser.com/questions/987150/ ... hrough-vpn
User avatar
AndyMH
Level 21
Level 21
Posts: 13704
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: VirtualBox shared folders

Post by AndyMH »

I assume you have set up shared folders in VB through the settings:
Screenshot from 2018-12-16 22-38-49.png
Then in the VM (in my case win7) they appear as network drives (so I suspect with mint in a VM you need to go computer > network):
Capture.PNG
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
ajgringo619

Re: VirtualBox shared folders

Post by ajgringo619 »

Once you get it running, make sure you're in the vboxsf group on the guest.
User avatar
Mage of Maple
Level 2
Level 2
Posts: 70
Joined: Tue Jul 10, 2018 10:41 am
Location: Maryland USA
Contact:

Re: VirtualBox shared folders

Post by Mage of Maple »

Thanks for the help, everyone. I've got it working now. It was something I wasn't even thinking of but I should have been - not the first time this has burned me.

VirtualBox was running under Firejail. When I installed Firejail, I used firecfg to automatically set up sandboxing for all installed apps that it had default configurations for. Unfortunately, this creates various problems. It breaks the Linux Mint "X-Apps" entirely, which I solved by just unlinking them from /usr/local/bin. (I don't need my text editor sandboxed.) But I do like the idea of having VirtualBox sandboxed. The primary reason I run a Mint VirtualBox guest on a Mint host is so that I can do some things with less fear of corrupting my system. Most notably, I use Wine and this potentially exposes me to Windows viruses, so I do that in my guest (along with most things I do), but do all online banking, etc, on the host. In theory, it should not be possible for a virus to bust out of a VM anyway, but sandboxing gives me another layer of protection. Unfortunately, it breaks the shared folders, which I guess kinda makes sense as that would be a potential avenue for escape (although networking in general does work.) I guess I need to look into the Firejail configuration stuff and see if I can change the profile for VirtualBox to allow this...

Anyway, thanks everyone! :)
Laugh2
Level 4
Level 4
Posts: 275
Joined: Fri Aug 16, 2013 4:01 am

Re: VirtualBox shared folders

Post by Laugh2 »

ajgringo619 wrote: Sun Dec 16, 2018 7:06 pm Once you get it running, make sure you're in the vboxsf group on the guest.
Thank you, ajgringo619. You comment solved my problem - I was being told I didn't have permissions to access the folder when inside my Guest. Adding myself to this group (also inside the Guest) solved the problem.
:D
For anyone unfamiliar with how to do this, I found a CLI command by 1Fallen at https://ubuntuforums.org/showthread.php?t=2411025:

sudo usermod -G vboxsf -a myusername

change "myusername" to your login user name and make sure the VirtualBox Guest Additions are installed. Reboot.

My System
Host: LM18.3 64-bit
VirtualBox Version 6.0.6 r130049 (Qt5.6.1)
Guest: LM 19.1 64-bit
Locked

Return to “Virtual Machines”