You are not logged in.

#1 2018-02-14 19:36:32

jemin
Member
Registered: 2018-02-07
Posts: 21

Mounting hosts dir in VirtualBox Arch guest without sudo

I can mount the shared host's dirs in Arch host, but only with sudo, e.g.

 sudo mount -t vboxsf Downloads ~/vb_share 

But then I need to use sudo to create files and edit them in that dir. I can't mount the dir without the sudo.

What is the most sensible way to deal with this (avoid sudo)?

Offline

#2 2018-02-14 21:36:23

headkase
Member
Registered: 2011-12-06
Posts: 1,975

Re: Mounting hosts dir in VirtualBox Arch guest without sudo

If multi-user considerations aren't a problem - it's only you for your system - then you can add an entry in the sudoers file that automatically elevates mount when called with sudo.  You will still have to input the "sudo" as part of the command but it won't prompt for a password.  The entry can be specific down to the executable, mount.

Edit: And once mounted you should not need elevated permissions any more.  If you do then see what permissions you're mounting with.

Last edited by headkase (2018-02-14 21:37:48)

Offline

#3 2018-02-14 23:03:41

seth
Member
Registered: 2012-09-03
Posts: 50,008

Re: Mounting hosts dir in VirtualBox Arch guest without sudo

This has nothing to do with sudo and sudoer entries (which work per user) won't help w/ the mount permissions.

Read this:
https://wiki.archlinux.org/index.php/Vi … ed_folders

Offline

#4 2018-02-15 08:24:46

jemin
Member
Registered: 2018-02-07
Posts: 21

Re: Mounting hosts dir in VirtualBox Arch guest without sudo

This was helpful, thank you.

Offline

#5 2018-02-15 08:45:26

seth
Member
Registered: 2012-09-03
Posts: 50,008

Re: Mounting hosts dir in VirtualBox Arch guest without sudo

If you figured it and are fine with the results, please always mark [SOLVED] threads by editing your initial posts subject. Thanks.

Offline

Board footer

Powered by FluxBB