vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

SMB mounts

Open FarahBoudabous opened this issue 4 years ago • 4 comments

Hi, I want to share and mount folders with type SMB but I got this problem: Vagrant version: 2.2.14 Host OS: Windows Box: ubuntu/bionic64 And this is the line in the vagrant file of SMB mounts : config.vm.synced_folder ".", "/var/farah", type: "smb" , smb_password: "vagrant", smb_username: "vagrant", mount_options: ["mfsymlinks","vers=2.0"] This is the debug output: ==> default: Checking for guest additions in VM... ==> default: Mounting SMB shared folders... default: C:/Users/boudabou/Desktop/*****/box2 => /var/www/test Vagrant is currently configured to mount SMB folders with the mfsymlink option enabled. This is equivalent to adding the following to your Vagrantfile:

config.vm.synced_folder '/host/path', '/guest/path', type: "smb", mount_options: ['mfsymlink']

This option may be globally disabled with an environment variable:

VAGRANT_DISABLE_SMBMFSYMLINKS=1 Failed to mount folders in Linux guest. This is usually because the "vboxsf" file system is not available. Please verify that the guest additions are properly installed in the guest and can work properly. The command attempted was:

mount -t cifs -o vers=2.0,credentials=/etc/smb_creds_vgt-96fa08f743a95a0db5af7a30854059c6-cb426b02ca9dbcd1a5e7bb7b4985d549,uid=1000,gid=1000,mfsymlinks,_netdev //10.131.225.244/vgt-96fa08f743a95a0db5af7a30854059c6-cb426b02ca9dbcd1a5e7bb7b4985d549 /var/www/test

The error output from the last command was:

mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

FarahBoudabous avatar May 10 '21 13:05 FarahBoudabous

Hi there,

Thank you for opening an issue. However, there is not enough information here to reproduce or provide a recommendation. When you first open an issue, a template is pre-filled in the box. That template provides instructions for getting your host and guest information, the version of Vagrant, and the debug output. Without that information, it is very challenging for us to assist you.

Please supply that information either by updating this ticket or by closing this ticket and opening a new one. Thank you! 😄

soapy1 avatar May 10 '21 17:05 soapy1

Hi, I have updated the issue, if there is an information still missing please tell me, Thank you!

FarahBoudabous avatar May 11 '21 07:05 FarahBoudabous

Any progress on this issue? I'm having same problem (i.e. mount error(13): Permission denied). I have Vagrant version: 2.3.1 Host OS: Windows 10 Enterprise Box: almalinux/8

From the debug output it looks like part of the problem may be that Vagrant isn't running the mount command as sudo, which it seems like is required unless the user edits the sudoers file on the box prior to Vagrant attempting to mount the SMB (not even sure if there is a script hook to be able to do that).

mbheinen avatar Oct 07 '22 21:10 mbheinen

I was able to work around by add mount option to my synced_folder config (i.e. config.vm.synced_folder "files", "/home/vagrant/tmp", { mount_options: ["username=<user>"] } .

Not sure if this is related, but I am working on computer logged in as user associated with active directory so when Vagrant prompts for SMB username and password I have to enter "domain\user" for the username. Note that "user@domain" fails for me with message invalid credentials despite this being the way the Vagrant long message says a domain should be entered. Not sure why that is happening. I wonder if mount command is failing beacuse it is passing in username=domain\user, when what mout expects is username=user,domain=domain?

mbheinen avatar Oct 07 '22 21:10 mbheinen