Can't see the NFS shared directory in Vagrant - ruby

I try to create an NFS share directory in the vagrant box, but for some reasons I can not see the shared directory when I login to the box via ssh.
This is my Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.synced_folder "./shared", "/st/data", :nfs => true
config.vm.network "private_network", ip: "192.168.33.10"
end
Vagrant reload output:
vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'hashicorp/precise32' is up to date...
==> default: Clearing any previously set forwarded ports...
==> 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: 22 => 2222 (adapter 1)
==> 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 timeout. Retrying...
==> default: Machine booted and ready!
GuestAdditions 5.0.6 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
==> default: Mounting shared folders...
default: /vagrant => /Users/stk/Documents/vagrant
==> default: Check for insecure vagrant key: OK (not present)
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
After vagrant ssh I can't see any nfs directory.
vagrant -v
Vagrant 1.7.4
OSX:
10.10.3
I tried most of the solutions mentioned here, but still no luck.

Related

I want to run a basic Windows guest on OSX with Vagrant, but I keep getting authentication failures

I'm trying to run a Windows 10 guest on an OSX host.
I've installed the latest versions of Vagrant, VirtualBox. I set up a very basic Vagrantfile as follows:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "Microsoft/EdgeOnWindows10"
config.vm.box_version = "1.0"
end
When I try to start Vagrant by executing "vagrant up", I get the following console output which ends with a neverending series of Authentication failure error messages.
TCR-C02X29QPJHC9:automation salimfadhley$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'Microsoft/EdgeOnWindows10'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'Microsoft/EdgeOnWindows10' version '1.0' is up to date...
==> default: Setting the name of the VM: automation_default_1548152471264_36082
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
I don't need Edge - I just need Windows and possibly some dot-Net runtimes. I'd like to get started by getting any Windows image up and running.
You probably just need to use the following in your Vagrantfile:
config.vm.communicator = "winrm"
This option is described here, and you can further configure winrm with the settings listed here.

Getting Started with Openshift using Vagrant

I wanted to stand up a local instance of Openshift, but vagrant up doesn't finish.
I downloaded cdk-2.2.0.zip and rhel-cdk-kubernetes-7.2-29.x86_64.vagrant-virtualbox.box from developers.redhat.com.
Running vagrant up after installation gets stuck at Configuring and enabling network interfaces...:
me:~/cdk/components/rhel/rhel-ose $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'cdkv2'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: rhel-ose_default_1476736433516_4922
==> 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: 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: Remote connection disconnect. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Registering box with vagrant-registration...
default: Would you like to register the system now (default: yes)? [y|n]y
default: username: me#email.com
default: password:
==> default: Registration successful.
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
Any ideas how to troubleshoot this? Not sure if it's vagrant or the VM or something else.
Thank you for your time!
Same happened to me but after updating Vagrant to 1.9.1 version the problem was solved.
I am using OSX but it might be the same for all others OS.
the easiest is to install the vagrant vbguest plugin and let it install and configure the Virtual Box Guest Addition for the right version of your VirtualBox

vagrant - The capability 'nfs_mount' could not be found

The capability 'nfs_mount' could not be found. This is an internal error
that users should never see. Please report a bug.
Cmd
C:\var\www\cc-dev-env>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> 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: 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: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.36
default: VirtualBox Version: 5.0
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: [vagrant-hostsupdater] found entry for: 192.168.100.100 cc.dev
==> default: Mounting NFS shared folders from guest...
The capability 'nfs_mount' could not be found. This is an internal error
that users should never see. Please report a bug.
I am using
Windows 10 64-bit
Vagrant 1.8.1
vagrant-hostsupdater (1.0.2)
vagrant-nfs_guest (0.1.8)
vagrant-share (1.1.5, system)
vagrant-winnfsd (1.1.0)
Of course I would like to not see this error and see the VM that I am trying to boot open.

Vagrant up error: I can ssh but nginx is giving me errors

I am using Vagrant/Homestead combo with Laravel 5.2 and I tried to make HTTP calls to the server and something broke but I don't know why, I kept getting a 405 bad gateway error and someone recommended I just create a new vagrant box.
So I went to my VirtualBox Manager and deleted my homestead box/deleted all files as well, then ran vagrant up to create a new one and I was able to ssh just fine but now when I try to make a HTTP call, namely in Postman, I get:
<html>
<head>
<title>502 Bad Gateway</title>
</head>
<body bgcolor="white">
<center>
<h1>502 Bad Gateway</h1>
</center>
<hr>
<center>nginx/1.9.7</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
When running vagrant up, I get this error (look at the very last line):
Lansana#DESKTOP-UV14VGF MINGW64 ~/Homestead (master) $ vagrant up Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: homestead
==> 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: 80 => 8000 (adapter 1)
default: 443 => 44300 (adapter 1)
default: 3306 => 33060 (adapter 1)
default: 5432 => 54320 (adapter 1)
default: 22 => 2222 (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 timeout. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/Lansana/Homestead
default: /home/vagrant/Sites => C:/Users/Lansana/Homestead/Projects
==> default: Running provisioner: file...
==> default: Running provisioner: shell...
default: Running: inline script
==> default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4q2BHIAHJ/yUc9zwJVCUbtbPe5xPJmbsbUJmtjldEnaIZ00tG/memsDHbOlGsbTxRU2QgKmrKSu7Iz8r+FglDbXLzbrg0O9rrQWi9FCpl8J630o1/fz3vejVIslcnuRBtiW/UUjYTZ5vsU2E/aMmxJFA31IzWslmQKHzOW+2XHyQ3e8QQBI7owA4QpVHtki0g0xlISA+H7kgG90NY0uEF+t4GK0KY/CN2GzxMFCAxtXLa2M8uGimySImsPBZByMNuLsdiok8W8vLWtDr9qvXhQkXOpxSTUflfCiJQmOke3hJpjWGPCcaVg9gPmr3wH9GUKnGQJ6SPQlslMI+Mekr/ lansana#homestead
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Running provisioner: shell...
default: Running: C:/Users/Lansana/AppData/Local/Temp/vagrant-shell20160109-5024-pucyip.sh
==> default: Running provisioner: shell...
default: Running: C:/Users/Lansana/AppData/Local/Temp/vagrant-shell20160109-5024-1dw603v.sh
==> default: nginx stop/waiting
==> default: nginx start/running, process 1943
==> default: php5-fpm: unrecognized service The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong.
Anyone know what is going wrong here?
Try doing the following:
$ composer remove laravel/homestead
$ composer clear-cache
$ composer require laravel/homestead
$ vagrant destroy && vagrant up
For some reason, doing a composer update laravel/homestead didn't grab the latest version of the homestead files (I think it has something to do with the composer.json using "^3.0", and didn't think 3.0.1 required an update or something), I noticed homestead.rb was not the current version.

Vagrant Omnibus Plugin Not Working on My Windows 7 PC

I want to spin up a Fedora-20 VM using Vagrant and Chef on my Windows 7 PC and provision it as a LAMP server. I have Vagrant 1.6.5. and the vagrant-omnibus plugin (1.4.1) is installed.
My Vagrantfile includes the "config.omnibus.chef_version = :latest" statement, but after running "vagrant up", expected provisioning does not occur. Instead,
==> default: Running provisioner: chef_solo...
The chef binary (either `chef-solo` or `chef-client`) was not found on
the VM and is required for chef provisioning. Please verify that chef
is installed and that the binary is available on the PATH.
It appears that the omnibus plugin did not install Chef on the VM. What else do I need to do to get this working on my PC?
This is my Vagrant file:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "chef/fedora-20"
config.omnibus.chef_version = :latest
config.vm.network "forwarded_port", guest: 80, host: 4567
config.vm.synced_folder "shared-files", "/var/www"
config.vm.provision "chef_solo" do |chef|
chef.cookbooks_path = "chef-recipes/cookbooks"
chef.roles_path = "chef-recipes/roles"
chef.add_role "lamp_stack"
end
end
and here is STDOUT:
C:\Users\wbj\f20>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'chef/fedora-20'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'chef/fedora-20' is up to date...
==> default: Setting the name of the VM: f20_default_1413836754304_46591
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 80 => 4567 (adapter 1)
default: 22 => 2222 (adapter 1)
==> 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 timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /var/www => C:/Users/wbj/f20/shared-files
default: /vagrant => C:/Users/wbj/f20
default: /tmp/vagrant-chef-3/chef-solo-2/roles => C:/Users/wbj/f20/chef-recipes/roles
default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks => C:/Users/wbj/f20/chef-recipes/cookbooks
==> default: Running provisioner: chef_solo...
The chef binary (either `chef-solo` or `chef-client`) was not found on
the VM and is required for chef provisioning. Please verify that chef
is installed and that the binary is available on the PATH.
Thank you!
I ran into this exact problem. The solution was to downgrade to Vagrant 1.6.2 until Vagrant version 1.7.1 was released. Both versions fixed the problem for me.

Resources