0

I was reading multiple answer in order to access from guest to host on Linux, and I found two methods.

But, they are not working for me.

I using VirtualBox Version 6.1.12 r139181 (Qt5.12.5)

$ uname -r
5.7.8-1.el8.elrepo.x86_64
$

Now, from the Guest

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:    20.04
Codename:   focal
$

$ uname -r
5.4.0-42-generic
$

Location

$ pwd
/home/anita
$

anita@ubuntu--k8s-master:~$ ll
total 112
drwxr-xr-x 19 anita anita  4096 jul 29 19:58 ./
drwxr-xr-x  3 root  root   4096 jul 23 00:10 ../
-rw-------  1 anita anita  5909 jul 31 09:15 .bash_history
-rw-r--r--  1 anita anita   220 jul 23 00:10 .bash_logout
-rw-r--r--  1 anita anita  3771 jul 23 00:10 .bashrc
drwx------ 15 anita anita  4096 jul 27 00:33 .cache/
drwxr-xr-x 14 anita anita  4096 jul 26 14:22 .config/
drwxr-xr-x  2 anita anita  4096 jul 23 00:34 Desktop/
drwxr-xr-x  3 anita anita  4096 jul 28 00:05 Documents/
drwxr-xr-x  2 anita anita  4096 jul 23 00:34 Downloads/
drwx------  3 anita anita  4096 jul 28 00:00 .gnupg/
drwxrwx---  1 root  vboxsf 4096 jul 31 08:34 host/
drwxrwxr-x  4 anita anita  4096 jul 29 12:04 .kube/
drwxr-xr-x  3 anita anita  4096 jul 23 00:34 .local/
drwx------  5 anita anita  4096 jul 23 23:03 .mozilla/
drwxr-xr-x  2 anita anita  4096 jul 23 00:34 Music/
drwxr-xr-x  2 anita anita  4096 jul 23 00:34 Pictures/
-rw-r--r--  1 anita anita   807 jul 23 00:10 .profile
drwxr-xr-x  2 anita anita  4096 jul 23 00:34 Public/
drwxr-xr-x  3 anita anita  4096 jul 23 21:57 snap/
drwx------  2 anita anita  4096 jul 26 14:20 .ssh/
-rw-r--r--  1 anita anita     0 jul 23 22:03 .sudo_as_admin_successful
drwxr-xr-x  2 anita anita  4096 jul 23 00:34 Templates/
-rw-r-----  1 anita anita     5 jul 29 19:57 .vboxclient-clipboard.pid
-rw-r-----  1 anita anita     5 jul 29 19:57 .vboxclient-display-svga-x11.pid
-rw-r-----  1 anita anita     5 jul 29 19:57 .vboxclient-draganddrop.pid
-rw-r-----  1 anita anita     5 jul 29 19:57 .vboxclient-seamless.pid
drwxr-xr-x  2 anita anita  4096 jul 23 00:34 Videos/
anita@ubuntu--k8s-master:~$

using usermod

anita@ubuntu--k8s-master:~$ sudo usermod -aG vboxsf $USER
anita@ubuntu--k8s-master:~$

using adduser

anita@ubuntu--k8s-master:~$ sudo adduser $USER vboxsf
The user `anita' is already a member of `vboxsf'.
anita@ubuntu--k8s-master:~$

The test in order to access (for read/write)

anita@ubuntu--k8s-master:~$ cd host/
bash: cd: host/: Permission denied
anita@ubuntu--k8s-master:~$

instead of root.

anita@ubuntu--k8s-master:~$ sudo -i
[sudo] password for anita: 
root@ubuntu--k8s-master:~# ls -l /home/anita/host/
total 69032
drwxrwx--- 1 root vboxsf     4096 jul 21 06:02  bin
drwxrwx--- 1 root vboxsf     4096 jul  5 20:30  Desktop
drwxrwx--- 1 root vboxsf     4096 jul 23 00:00  Develops
drwxrwx--- 1 root vboxsf     4096 ago  1 10:31  Documents
drwxrwx--- 1 root vboxsf     4096 ago  1 10:12  Downloads
-rwxrwx--- 1 root vboxsf 58477923 jul 21 07:26  minikube
drwxrwx--- 1 root vboxsf     4096 jul  5 20:30  Music
drwxrwx--- 1 root vboxsf     4096 jul 23 01:03  Pictures
drwxrwx--- 1 root vboxsf     4096 jul  7 19:16  Programs
drwxrwx--- 1 root vboxsf     4096 jul  5 20:30  Public
drwxrwx--- 1 root vboxsf     4096 ago  1 10:55  snap
drwxrwx--- 1 root vboxsf     4096 jul  5 20:30  Templates
-rwxrwx--- 1 root vboxsf  1764044 jul  6 01:03  test.wav
-rwxrwx--- 1 root vboxsf     1905 jul  6 02:50  text
drwxrwx--- 1 root vboxsf     4096 jul  6 05:40  Videos
drwxrwx--- 1 root vboxsf     4096 jul 25 21:08 'VirtualBox VMs'
root@ubuntu--k8s-master:~#

What happens?

How I can solve this?

1

by looking at the sequence of the commands you have provided you should be able to access your ~/host mounted directory.

I assume you need to logout + login from the current shell for it to re-read your groups and enable you to access the group permissions. Either open a new terminal window / tab or logout / login from X-window manager to be able to use GUI applications when accessing the ~/host folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.