I have a Windows laptop with Virtualbox. I'm virtualizing Arch Linux. I installed the Guest Additions and I can see my shared folder automounted as /media/sf_shared.

I created a new user with useradd -m -d /media/sf_shared/<homedir_name> -G vboxsf <username>. But when I try to login with it, I get a change directory failed: Permission denied error.

I noticed that the home directory (automatically created by the -m option of useradd) does not belong to the new user, but to root, with group vboxsf. I think this happens because of the way that directory is automounted on startup by VirtualBox. I don't think this should create problems, given that I added my new user to that group with -G vboxsf, so that it has access.

Am I missing something?

  • I solved my own problem. Waiting 2 days to mark the answer as accepted. – lodo May 20 '17 at 19:51

While /media/sf_shared belonged to root:vboxsf, /media itself belonged to root:root. As I'm only using it to contain the shared folder, I chown-ed it to root:vboxsf and this solved the issue. Not sure why, though.

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.