Friday, October 20, 2017

VirtualBox shared folder on Linux Centos guest and Windows host

my main Linux user is "centos".

in VirtualBox, right-click on your VM, Settings, Shared Folder, create an entry with Folder Path = d:\pierre\pvshared and Folder Name = pvshared , check "auto-mount" and "make permanent"

Make sure you have the latest VBoxAdditions installed:

cd /run/media/centos/VBOXADDITIONS_5.1.30_118389/
sudo ./autorun.sh

#group vboxsf should already exist, so this should fail:
sudo groupadd vboxsf
sudo usermod -a -G vboxsf centos

reboot!

login again with your user (centos)

id
uid=1000(centos) gid=1000(centos) groups=1000(centos),983(vboxsf) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

cd /media/sf_pvshared
touch pippo.txt

you should see the file pippo.txt on your d:\pierre\pvshared folder in Windows

I have also done

sudo chmod 777 /media/sf_pvshared

but I don't think it's required once the centos user is assigned to vboxsf group



No comments: