I'm working on a project and trying to setup the environment. In the Vagrantfile there is:
config.vm.synced_folder "./", "/vagrant", type: 'nfs'
config.vm.network "private_network", ip: "192.168.33.10"
I ssh into the box/guest, but can't see any of the files from the share. My /etc/exports looks okay:
# VAGRANT-BEGIN: 1000 14948e9b-4304-4359-9e8e-674f4ae10415
/home/{my_username}/open 192.168.33.10(rw,no_subtree_check,all_squash,anonuid=1000,anongid=1000,fsid=743045029)
# VAGRANT-END: 1000 14948e9b-4304-4359-9e8e-674f4ae10415
My UID on the box/guest when I ssh is 500, but on the host is 1000. I tried to add the following lines to my Vagrantfile to make it match up:
config.nfs.map_uid = Process.uid
config.nfs.map_gid = Process.gid
But, still no luck. The host is Ubuntu 14.04 LTS, the box is bento/Centos-6.7. There are no error msgs during vagrant up. But, it doesn't list the folder being synced:
[default] Mounting NFS shared folders...
{There should be some msg about the folders here right?}
[default] VM already provisioned. Run `vagrant provision` or use `--provision` to force it
EDIT: Here is the relevant info from debug:
INFO synced_folders: Synced Folder Implementation: nfs
INFO synced_folders: - /vagrant: ./ => /vagrant
INFO synced_folders: Invoking synced folder prepare for: nfs
INFO warden: Calling IN action: #<VagrantPlugins::ProviderVirtualBox::Action::PrepareNFSSettings:0x00000001b38818>
But, later, there is no mention of the folders:
INFO interface: info: Mounting NFS shared folders...
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
INFO ssh: SSH is ready!
INFO guest: Execute capability: mount_nfs_folder (redhat)
DEBUG guest: Searching for cap: mount_nfs_folder
Is there anything in particular I should be looking for?
Also, I did check if nfs is running:
service nfs-kernel-server status
and got:nsfd running
And showmount -e gives me:
/home/{My username}/open 192.168.33.10
So... if a run ls -l /vagrant on the guest I can see the shared files! So, how do I access them?
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?
Problem
I'm struggling to have vagrant mounting shared folders via SMB.
Environment
Windows 10 Pro with Hyper-V and SMB features enabled
Vagrant 2.2.6 with vagrant-vbguest (0.21.0, global) plugin
Homestead.yaml file
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: hyperv
authorize: c:/Users/sgrat/.ssh/id_rsa.pub
keys:
- c:/Users/sgrat/.ssh/id_rsa
folders:
- map: Sites/mysite
to: /home/vagrant/mysite
php: '7.3'
type: "smb"
smb_host: 127.0.0.1
smb_username: vagrant
smb_password: vagrant
sites:
- map: mysite.test
to: /home/vagrant/mysite
databases:
- mysitedb
features:
- mariadb: true
- ohmyzsh: false
- webdriver: false
Error
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:/Users/sgrat/Desktop/Sites/Homestead => /vagrant
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-4a666e6cffbb30e1d0bc7bb643cb3aee-6ad5fdbcbf2eaa93bd62f92333a2e6e5,uid=1000,gid=1000 //192.168.1.14/vgt-4a666e6cffbb30e1d0bc7bb643cb3aee-6ad5fdbcbf2eaa93bd62f92333a2e6e5 /vagrant
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)
Additional attempts
I also installed vboxsf fs on guest machine after vagrant ssh with sudo apt-get install virtualbox-guest-x11 and even checked for last cifs-utils version.
I even created a local/admin user with name/password vagrant and granted all privilages on both "Sites" folder and "Sites" shared folder.
Update #1
Shared "Sites" folder on Windows host, so updated homestead shared folder path to start from that instead from C: drive.
Is it correct?
I started using fedora 24 last year for my study/work computer. First time I run into an issue I cannot figure out within a reasonable amount of time.
We need to use Vagrant for a project, and I'm trying to get it running on my computer. The command vagrant up fails at the mounting nfs. Here's the output after the command:
Bringing machine 'default' up with 'libvirt' provider...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
==> default: Waiting for SSH to become available...
==> default: Creating shared folders metadata...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
[sudo] password for feilz:
Redirecting to /bin/systemctl status nfs-server.service
● nfs-server.service - NFS server and services
Loaded: loaded (/etc/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
Drop-In: /run/systemd/generator/nfs-server.service.d
└─order-with-mounts.conf
Active: active (exited) since Wed 2017-02-15 15:17:58 EET; 19h ago
Main PID: 16889 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 512)
CGroup: /system.slice/nfs-server.service
Feb 15 15:17:58 feilz systemd[1]: Starting NFS server and services...
Feb 15 15:17:58 feilz systemd[1]: Started NFS server and services.
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o 'vers=4' 192.168.121.1:'/home/feilz/env/debian64' /vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
mount.nfs: access denied by server while mounting 192.168.121.1:/home/feilz/env/debian64
My Vagrantfile looks like: (I skipped the commented out lines)
Vagrant.configure(2) do |config|
config.vm.box = "debian/jessie64"
config.vm.provider :libvirt do |libvirt|
libvirt.driver = "qemu"
end
end
I can run the vagrant ssh command to log in, and write the command
sudo mount -o 'vers=4' 192.168.121.1:'/home/feilz/env/debian64' /vagrant
inside vagrant to try again.Then the output becomes
mount.nfs: access denied by server while mounting 192.168.121.1:/home/feilz/env/debian64
I've gone through loads of webpages. I fixed missing ruby gems (nokogiri and libffi). I tried modifying the /etc/exports file, it doesn't work, and it gets reset after I run vagrant halt / up.
I have installed the vagrant plugin vagrant-libvirt
What haven't I tried yet, that would allow me to use the NFS file sharing for Vagrant?
After a lot of review trying to use rsync in Vagrant with Docker as provider. (bidirectional sync)
I moved on to use nfs to sync my files inside the VM boot2docker
I have this vagrant error message after vagrant up
dockerhost: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o 'vers=3,udp' 192.168.50.1:'/Users/myMac/workspace/docker-vagrant/test' /project
Stdout from the command:
Stderr from the command:
mount: RPC: Unable to receive; errno = No route to host
mount: mounting 192.168.50.1:/Users/myMac/workspace/docker-vagrant/test on /project failed: Bad file descriptor
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "dduportal/boot2docker"
config.vm.define "dockerhost"
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.network "private_network", ip: "192.168.50.4"
config.vm.synced_folder "../", "/project", type: "nfs"
...
My mac already have nfs because started up the service using nfsd start
In the Vagrant documentation recommend to use rsync but I didn't find a way to rsync from VM to my MAC and vice versa.
I'm using
Mac Yosemite
Vagrant 1.8.1
VM dduportal/boot2docker
I posted my question directly on the dduportal/boot2docker project.
and this is the correct configuration if you have your custom Docker Host in different directory.
config.vm.synced_folder "../", "/vagrant", type: "nfs", mount_options: ["nolock", "vers=3", "udp"], id: "nfs-sync"
Reference:
https://github.com/dduportal/boot2docker-vagrant-box/issues/48
I managed to setting up my Symfony2 project inside a ubuntu vagrant box. But it takes around 20 seconds to load the website through it's webserver. After some research, i came up with using nfs for the sync folder. Here're my setting from Vagrantfile:
config.vm.network "private_network", ip: "192.168.56.101"
config.vm.synced_folder ".", "/vagrant", :nfs => true, :mount_options => ["dmode=777","fmode=777"]
After starting de vagrant box i get the following error
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o 'dmode=777,fmode=777' 192.168.56.1:'/Users/marcschenk/Projects/teleboy.ch' /vagrant
Stdout from the command:
Stderr from the command:
stdin: is not a tty
mount.nfs: an incorrect mount option was specified
The VM seems to work, but the synced folder's obviously empty. What did i wrong?
My setup:
Vagrant 1.6.5 & Virtualbox 4.3.18
Host: OS X 10.10
Guest: Ubuntu 12.04
Found the solution for the problem here https://github.com/mitchellh/vagrant/issues/2546
The correct syntax for vagrant version 1.3 to 1.6 is:
config.vm.synced_folder ".", "/vagrant", :nfs => { :mount_options => ["dmode=777","fmode=777"] }