Page 1 of 1

SMB Shared folder on Windows 10

Posted: 22. Aug 2022, 17:53
by JohnyV
Hi, I'm running Windows 10 Home with Virtualbox Verzion 6.1.36 r152435 (Qt5.6.2) with latest guest aditions installed, Vagrant 2.3.0. I'm uneable make shared folder working. I've tryied also nfs, but that seems to be unsupported.

Vagrant configuration:

config.vm.synced_folder './build', '/var/www',
type: "smb",
mount_options: ["smb_username=desktop-xxxxx\hxxxx","smb_password=xxxxxx"]

The output is like this:
> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'generic/ubuntu2204' version '4.1.6' is up to date...
==> default: Clearing any previously set forwarded ports...

Vagrant requires administrator access for pruning SMB shares and
may request access to complete removal of stale shares.
==> default: Preparing SMB shared folders...
default: You will be asked for the username and password to use for the SMB
default: folders shortly. Please use the proper username/password of your
default: account.
default:
default: Username (user[@domain]): desktop-xxxx\hxxxx
default: Password (will be hidden):

Vagrant requires administrator access to create SMB shares and
may request access to complete setup of configured shares.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 3306 (guest) => 3306 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting SMB shared folders...
default: C:/projects/xxxxx/build => /var/www
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-xxxxxxx-xxxxxxx,uid=1000,gid=1000,mfsymlinks,_netdev,smb_username=desktop-xxxxxhxxxx,smb_password=*****,nofail //192.168.1.245/vgt-xxxxxxxxxxxxxxxxxxxxxxxxxxx /var/www

The error output from the last command was:

mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

Could anybody help please?

Re: SMB Shared folder on Windows 10

Posted: 22. Aug 2022, 18:17
by scottgus1
This forum doesn't support Vagrant, so you'll have to ask them about configuration issues in their setups.

However, if you can demonstrate the same issue happening with a non-Vagrant-affect Virtualbox VM, then we can help.

For Virtualbox's Shared Folders, see the Virtualbox manual, section 4.3 https://www.virtualbox.org/manual/ch04. ... redfolders

Re: SMB Shared folder on Windows 10

Posted: 22. Aug 2022, 18:41
by JohnyV
Well it works same for non vagrant environment as well. I've created Ubuntu 22.04 directly and tried to mount usig this:
//192.168.1.245/projects/xxxxx/build /var/www/ cifs vers=2.0,credentials=/home/xxxx/.smbcredentials,iocharset=utf8,gid=1000,uid=1000,file_mode=0777,dir_mode=0777 0 0
in
.smbcredentials I have
username=xxxxx
password=xxxxx
Sinc I'm on Windows Home, there is no domain - Home doesn't support it.

The result is completly same.
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

Re: SMB Shared folder on Windows 10

Posted: 22. Aug 2022, 19:34
by mpack
If "SMB" means SMB1 then this is deprecated and disabled by default on Windows 10 onwards due to security and performance concerns. It can be enabled again in "Optional Features". Modern PCs use SMB2.

Re: SMB Shared folder on Windows 10

Posted: 27. Aug 2022, 12:26
by arQon
vers=2.0 should resolve any SMB1 issues, but current kernels default to 3 anyway (which is also what OP should be using, unless Vagrant requires it to be done badly for some reason).

Several reasons why it could fail the way you have it, but nearly all of them are because of where you're doing it". Get it working first with mount commands, *then* move it in there.

Re: SMB Shared folder on Windows 10

Posted: 27. Aug 2022, 15:10
by scottgus1
One thing, if I remember correctly: SMB isn't used for Virtualbox Shared Folders through Guest Additions. I can get XP VM to read 10 host's Virtualbox Shared Folders without any changes to 10's SMB#. I think the Vagrant settings were using Virtualbox Shared Folders, not a real shared folder shared by the host over the network. I could be wrong...
JohnyV wrote:tried to mount usig this:
I'm not sure what that command was, but please try using the Shared Folders setting in the main Virtualbox window GUI, VM settings.
JohnyV wrote:I'm on Windows Home, there is no domain
Not a full-blown domain, no, but there is a 'domain' component: for username, you'd have to specify 'computername\username', where computername is the network name for the Windows computer.

However, Virtualbox Shared Folders does not use the host's permissions system to share a host folder through Guest Additions into the VM. VSF does not use any of the host's typical shared folder components. I've never had to provide a host computername\username & password to share a Windows host folder through VSF into my VMs.

Please try the Virtualbox Shared Folders settings in the main Virtualbox window, and let us know what happened. Please see viewtopic.php?f=6&t=106876&p=522942#p522878 for a working auto-mount example and a discussion for why it works.

Re: SMB Shared folder on Windows 10

Posted: 28. Aug 2022, 09:25
by arQon
scottgus1 wrote:SMB isn't used for Virtualbox Shared Folders through Guest Additions.
AFAICT, he's trying to mount a different device on his LAN - at least, that's what the command says. If you're right though and he's actually just trying to mount a local shared folder then he's got his wires very crossed indeed. :)