I have a vagrant box that is running on top of hyper-v. All seems to work fine except shared folder. It just incredible slow. Its like stuck on something. I run yarn install and it dint finish even after like a 18 hours of work.. ( it was working and adding new files with with incredible slow speed). I know there a lot of small files ( ~80k was created during yarn install until i cancelled it), but no way it should take 18 hours to create such amount of files, and i have a fast ssd. I tried to copy this files over smb inside windows itself and all copied withing few minutes.
I checked process load when its running, everything near zero. No cpu usage, a lot of free mem.
Host system : windows 10
Guest system : ubuntu 16.04
Here is my vagrant file:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "kmm/ubuntu-xenial64"
config.vm.provider "hyperv"
config.vm.network "public_network"
config.vm.synced_folder 'C:/Dev/PycharmProjects/scrapers', '/opt/scrapers', disabled: false, type: "smb", smb_username: "xxx", smb_password: "xxx", mount_options: ['vers=2.1']
config.vm.synced_folder '.', '/vagrant', disabled: false, type: "smb", smb_username: "xxx", smb_password: "xxx", mount_options: ['vers=2.1']
config.vm.provider "hyperv" do |h|
h.enable_virtualization_extensions = true
h.differencing_disk = true
h.ip_address_timeout = 240
h.memory = 1024
h.cpus = 4
h.vm_integration_services = {
key_value_pair_exchange: true,
}
end
end
I tried mounting with vers=3.0 with the same result.
I even tried to copy that folder on guest machine to another one and it just stuck, it copies like 20 files and then nothing happens after it for few hours.
I have noticed that SMB / CIFS shares into Vagrant Linux guests are extremely slow and unreliable using the "Default Switch" provided with the Windows 10 upgrade to "Fall Creator's Edition" 1709 (Version 10.0.16299 Build 16299.)
If you just upgraded to the latest build of Windows, then you could try using an External Switch instead of the "Default Switch" NAT network. I changed my Vagrant Files back to using an External Switch and it solved* my CIFS performance problems.
* Even with an External Switch, the maximum file transfer speeds I see using local-to-local rsync from a Linux guest internal filesystem to a CIFS mount from the host is around 10MB/s and typically much slower, so it is still terrible. Just not completely unusable like it is with "Default Switch".