How does one configure shared folders to automount for arch/manjaro linux VM in virtualbox?

4.3k views Asked by At

I have a manjaro/arch virtual machine running in virtualbox with a windows 10 host. I have configured the shared folder I want to share in virtualbox as c:\tfs with the name tfs but it doesn't show up in the linux vm anywhere. I am able to mount it manually, but it won't auto-mount. I created the /media and /media/tfs folder in the VM, since it did not exist, and now the following command successfully manually mounts my folder sudo mount -t vboxsf tfs /media/tfs. How do I get the automount to work as intended without resorting to editing /etc/fstab?

1

There are 1 answers

2
Brandon Culley On BEST ANSWER

It turns out that a few more steps are needed to configure the automount for shared folders of virtualbox. This tiny forum post was the key. You need to enable and start the virtualbox service vboxservice.service installed with the guest utils.

  1. First ensure you have a folder /media, this is where it will try to mount your shared folders

  2. Ensure that the guest utils are installed with sudo pacman -Q virtualbox-guest-utils

  3. Enable service with sudo systemctl enable vboxservice.service

  4. Start service with sudo systemctl start vboxservice.service

  5. Reboot, I tried just logging out but reboot was necessary for me to start the service

  6. Verify that your folder is now automounted in /media with sf_ prefix, mine is /media/sf_tfs

    p.s. I also ran this command based on another post to add my username to the vboxsf group, although I'm not sure whether this one was necessary or not. sudo usermod -aG vboxsf brandon