--- page_title: "SMB - Synced Folders" sidebar_current: "syncedfolder-smb" --- # SMB **Synced folder type:** `smb` Vagrant can use [SMB](http://en.wikipedia.org/wiki/Server_Message_Block) as a mechanism to create a bi-directional synced folder between the host machine and the Vagrant machine. SMB is built-in to Windows machines and provides a higher performance alternative to some other mechanisms such as VirtualBox shared folders.
Windows only! SMB is currently only supported when the host machine is Windows. The guest machine can be Windows or Linux.
Vagrant.configure("2") do |config| config.vm.synced_folder ".", "/vagrant", type: "smb" end## Preventing Idle Disconnects On Windows, if a file isn't accessed for some period of time, it may disconnect from the guest and prevent the guest from accessing the SMB-mounted share. To prevent this, the following command can be used in a superuser shell. Note that you should research if this is the right option for you.
net config server /autodisconnect:-1## Limitations Because SMB is a relatively new synced folder type in Vagrant, it still has some rough edges. Hopefully, future versions of Vagrant will address these. The primary limitation of SMB synced folders at the moment is that they are never pruned or cleaned up. Once the folder share is defined, Vagrant never removes it. To clean up SMB synced folder shares, periodically run `net share` in a command prompt, find the shares you don't want, then run `net share NAME /delete` for each, where NAME is the name of the share. ## Common Issues ### "wrong fs type" Error If during mounting on Linux you're seeing an error message that includes the words "wrong fs type," this is because the SMB kernel extension needs to be updated in the OS. If updating the kernel extension is not an option, you can workaround the issue by specifying the following options on your synced folder:
mount_options: ["username=USERNAME","password=PASSWORD"]Replace "USERNAME" and "PASSWORD" with your SMB username and password. Vagrant 1.8 changed SMB mounting to use the more secure credential file mechanism. However, many operating systems ship with an outdated filesystem type for SMB out of the box which doesn't support this. The above workaround reverts Vagrant to the insecure before, but causes it work.