There are 3 machines:
1."desktop"
Windows 10 desktop
(Has the windows shared folder in its hard disk).
NOTE: This is my colleague's machine.
2."laptop"
Windows 10 laptop
(In the same local area network of "desktop", and can read and write the shared folder).
NOTE: This is my machine.
3."vagrant-centos7"
vagrant virtual machine centos7
(a guest machine hosted at "laptop" use vagrant virtualbox provider).
Now my question is like this:
I use "laptop", need make a "desktop" windows shared folder to be a synced folder to "vagrant-centos7".
I tried this vagrantfile setting, but faild.
"z://" is windows map network drive of the "desktop" share folder.
192.168.0.108 is the ip of "desktop"
config.vm.synced_folder "Z://", "/vagrant_data2",
type: "smb",
smb_host: "192.168.0.108",
smb_username: "abc",
smb_password: "123456"
The error message is:
Host path: Z:
Stderr: dev or path not exists.
thanks for any helps :)
Related
After running vagrant up I get the following error message.
Vagrant requires administrator access to create SMB shares and
may request access to complete setup of configured shares.
==> homestead: Setting hostname...
==> homestead: Mounting SMB shared folders...
homestead: C:/Code => /home/*****/code
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=3.02,credentials=/etc/smb_creds_vgt-07cc5c30ef2cc20d12e837c88c36370a-66f0bd5cbca4d218f5f0b8a5f1712727,uid=1000,gid=1000,mfsymlinks,_netdev,nofail //169.254.x.x/vgt-07cc5c30ef2cc20d12e837c88c36370a-66f0bd5cbca4d218f5f0b8a5f1712727 /home/*****/code
The error output from the last command was:
mount error(2): No such file or directory
I am able to ssh into the HyperV instance and when I run the command it returns the same. If I look at the properties of C:/Code folder I can see the network path is \\PCNAME\vgt-07cc5c30ef2cc20d12e837c88c36370a-66f0bd5cbca4d218f5f0b8a5f1712727 so the same as the mount command other than the PCNAME is now an IP. I can ping the IP from within the instance and seems to work ok.
Homestead file:
folders:
- map: C:/Code
to: /home/vagrant/code
type: smb
smb_username: vagrant
smb_password: vagrant
The vagrant user has full permissions to the local code folder.
I am running Windows 11, Vagrant 2.3.1, HyperV 10. The External Switch is set-up via my Wi-Fi - could that cause an issue?
the main point is that we don't have internet connectivity to the guest VM
we have a HyperV-VM with windows server 2019 and have a guest VM of ubuntu 18.04
we have tried all the possible scenarios like unmounting of vhdx drive of guest VM and creating a shared folder and etc
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".
I did an internship and they used vagrant so all the developers whould run the same latest version of the web application.
But now i want to create my own vagrant webserver.
I got to the point that i setup vagrant using the hashicorp/precise32 box.
I got nginx running on my own special ip adress that i changed in the hosts file.
So now i can go to mytestsite.com and it will show me welcome to nginx.
But now my question is, how can i get my own file(small test web application) into the vagrant server because i do not know how to transfer my files to vagrant.
And how can i let my friends use my vagrant test web application.
Thank you for your help!
Sincerely Mex
19 years old
web application student in the Netherlands
By default vagrant will have a synced folder between your vm and the host machine. It is in the same folder as the vagrantfile and can accessed through /vagrant on your host machine.
However if you want more customization and mount certain folders on your host machine and sync them to the vagrant VM it can be done in the vagrant file as follows:
Vagrant.configure("2") do |config|
# other config here
config.vm.synced_folder "src/", "/srv/website"
end
Here is a quick guide to get you started using vagrants synced folders and the example i posted
I have used vagrant and virtual box. I make a syncfolder for shared file between host and guest. I see shared folder in virtual box and I put some files in it but when I check the shared folder in host I see this folder is empty I have used the following command for making synced folders:
config.vm.synced_folder "/home/jody/Desktop/MYSHARE", "/home/vagrant/share",owner:"vagrant"
What is the problem?