vagrant is not read my homestead.yaml - macos

I guess vagrant is not read my homestead.yaml file.
$ vagrant reload --provision
==> default: Mounting shared folders...
default: /vagrant => /Users/ugurgungezerler/web/Homestead
my Homestead.yaml file folders configuration is:
folders:
- map: /Users/ugurgungezerler/web/sites
to: /home/vagrant/sites
i also tried vagrant destroy and up
OS = OSX El Capitan
Virtualbox 5.0.20

Related

Linux Vagrant Box compatible with VirtualBox version 6

I have been trying to install various Vagrant Boxes from Hashicorp's Vagrant Box Catalog but none seem to be compatible with:
Vagrant version: 2.2.9
VirtualBox versions: 6.0.x or 6.1.x
Host: Mac Catalina
I have tried multiple workarounds shared online and either the Guest Additions don't match or there are none available.
Both the plugin and the manual addition of guest additions also doesn't work.
Everything seems to work fine except for the shared folders syncing. Looking to get a workaround to fix the shared folder sync or a standard Linux Vagrant Box that is compatible with the VirtualBox guest additions.
The issue was fixed by manually mounting the Guest Additions VBoxGuestAdditions.iso file as CD-ROM in the VirtualBox.
Despite this, the Vagrant boxes may fail to sync shared folders via VirtualBox provider and instead use rsync for the same.
This can be fixed by updating the Vagrantfile by explicitly setting the provider type to VirtualBox in the config.
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
After this vagrant reload and the shared folder sync should work as expected.
$ vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Clearing any previously set forwarded ports...
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:
https://www.virtualbox.org/manual/ch04.html#sharedfolders
This option can be disabled globally with an environment variable:
VAGRANT_DISABLE_VBOXSYMLINKCREATE=1
or on a per folder basis within the Vagrantfile:
config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2222 (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:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => /Users/hemanik/vm/
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
Not sure if it was able to find the guest additions default: Checking for guest additions in VM... or if the previous tweaking with the guest additions took effect but the shared folder sync works as expected.
Just for an update, reinstalled Vagrant and the current working versions are as follows:
Vagrant version: 2.2.10
VirtualBox Version: 6.0.24 r139119

Laravel Homestead Windows Not Mapping Folders Properties

I'm unable to map my local project directory to Laravel's Homestead project directory. Inside of my homestead.yaml file I have:
folders:
- map: C:\Users\mdgre\Code
to: /home/vagrant/Code
When I run vagrant up I see the incorrect mapping taking place:
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/mdgre/.homestead
In addition when I ssh into the vagrant box no Code folder has been created at home/vagrant/Code.
Which version of homestead are you running? As of 5.0.0 there is no more ~/.homestead directory and shared folders are mounted using the Homestead.yaml config in the same directory as the Vagrantfile.
It doesn't work in the VirtualBox 5.1.16 version. You can update to the 5.1.18 version. It works in this version

Laravel Homestead error on chown

i tried to install homestead but when i run
vagrant up
at the middle i got this error
My folder structure is
c:/Hashicorp/vagrant
and the homestead at
c:/Homestead
I've added this line on my vagrantfile inside homestead:
config.vm.synced_folder ".", "/vagrant"
but still no luck.
Virtual box version: 5.0
Vagrant version : 1.7.3
What should i do to make it running?

Chef Vagrant, Can't Find Folder

Chef is really confusing me. Can you help me understand why it's not working?
Cliff Notes
I'm using Chef-Solo (not Berkshelf or anything else)
Everything works when I set it up from scratch, I can vagrant provision
But if I reboot the HOST (My main operating system) it breaks!
It appears to be looking inside a .chef folder which I did not specify in my vagrant configuration.
I have to do a vmboxmanage box destroy ubuntu/trusty64 and redownload everything and redo vagrant up if I reboot.
Vagrant Version 1.7.2
Virtual Box Version 4.3.20r96996
Inside Vagrant SSH Error:
Note: The files are not pointing to the .chef folder, but they are here?
[2015-01-30T16:23:44+00:00] WARN: Did not find config file:
/etc/chef/solo.rb, using command line options.
[2015-01-30T16:23:50+00:00] FATAL: None of the cookbook paths set in
Chef::Config[:cookbook_path],
["/vagrant/.chef/cookbooks", "/vagrant/.chef/site-cookbooks"],
contain any cookbooks
$vagrant up and $ vagrant provision error:
==> default: Mounting shared folders...
default: /vagrant => /home/jesse/if/indieflix/vagrant
default: /home/vagrant/chef-recipes => /home/jesse/projects/if/vagrant/chef-recipes
default: /home/vagrant/chef-resources => /home/jesse/projects/if/vagrant/chef-resources
==> default: Running provisioner: chef_solo...
==> default: Detected Chef (latest) is already installed
Shared folders that Chef requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the
machine. The fix is to run a `vagrant reload` so that the proper shared
folders will be prepared and mounted on the VM.
And, vagrant reload does nothing.
Vagrantfile
# ...
config.vm.synced_folder "chef-recipes", "/vagrant/chef-recipes"
config.vm.synced_folder "chef-resources", "/vagrant/chef-resources"
# ...
config.vm.provision "chef_solo" do |chef|
# Relevant to the Vagrantfile path
chef.cookbooks_path = ["chef-recipes"]
# This is just required by Chef, so it's minimal
chef.environments_path = "chef-resources/environments"
# This is the internal flag.
chef.environment = "development"
# This defines the cookbooks to run
chef.roles_path = "chef-resources/roles"
chef.add_role("development")
end
Folder Structure
chef-recipes/ (Git Submodule)
----python/
--------recipes/
------------default.rb
------------pip.rb
chef-resouces/ (Git Submodule)
----environments/
--------development.json
----roles/
--------development.json
Vagranfile
Anthony suggested in a comment I answer my question since it was answered in comments. Here it is!
Instead of using curl to install, I used omnibus which adds another step before provisioning:
$ vagrant plugin install vagrant-omnibus
Second, Chef-Solo/Vagrant has an issue with mounting files from the Host. The only workaround I have found is:
$ rm .vagrant/machines/default/virtualbox/synced_folders vagrant reload --provision
Optional: I created a bash script to make the above a little quicker:
reprovision.sh
#/bin/bash
rm .vagrant/machines/default/virtualbox/synced_folders
vagrant reload --provision
And of course chmod +x reprovision.sh and to run ./reprovision.sh

Vagrant error: Failed to mount folders in Linux guest

I have a vagrant error. The log as follows:
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> 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: Forwarding ports...
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: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => /Users/diguage/box/centos
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 vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
I Google it. StackOverflow had the same question:
Vagrant error : Failed to mount folders in Linux guest
I did it as the top answer: here. The different is that I downloaded the VBoxGuestAdditions_4.3.18.iso. But it did not work.
I try the second answer: here. It also did not work.
So, I have to ask the question.
My environment is :
Mac OSX 10.10
vagrant 1.6.3
CentOS release 6.5 (Final)
Kernel 2.6.32-431.29.2.el6.x86_64
VirtualBox 4.3.18
PS:
I used the box chef / centos-6.5. I first start the box, it was OK. But I sudo yum update,then sudo yum clean, restart the box, export the error.
Use Following is work fine for me.
vagrant plugin install vagrant-vbguest
I was having the same problem with the same setup, I noticed the problem is only with centos 6.5, so I am using chef/centos-6.6 and it has been working fine. There is very little difference between 6.5 and 6.6, so you shouldn't have any problems migrating your code over. Here's the link to the chef boxes.
EDIT
Ok, I ended up needing a 6.5 box, so I worked through it. The core issue is that the CentOS base repo doesn't include kernel headers(Ubuntu does). You first need to add the appropriate repos to your /etc/yum.repos.d/CentOS-Vault.repo, and you need to enable them. What you append should look something like this:
[C6.5-centosplus]
name=CentOS-6.5 - CentOSPlus
baseurl=http://vault.centos.org/6.5/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
You also need to check the /etc/yum.conf file and make sure there aren't any exclusions such as:
exclude=kernel*
if so comment this out for the time being, but make sure to uncomment it at the end.
Now, you can install the necessary headers for the kernel. The headers depend on kernel-devel, so lets grab that up first.
yum install kernel-devel-$(uname -r)
Then, grab up the headers
yum install kernel-headers-$(uname -r)
Finally, you'll need the dkms package
yum install dkms
Go back and uncomment the exclusions in yum.conf and you should be good to reboot. With only that installed you could then use:
vagrant package --base MyBase
This will give you a reusable CentOS 6.5 box that you can grab on demand. Hope this wasn't too late for you.
I have experienced this using Vagrant 1.8.1, VirtualBox 5.0.18, Chef 12.10.10 host MacOSX El Capitan and guest CentOS7.
I tried installing kernel-devel inside the guest, installing the latest GuestAdittions and running yum update, but none of these worked for me, so I changed the mount type for "nfs" in both my custom synced folders and chef temporary folder, and it worked!
In Vagrantfile, my synced folders:
config.vm.synced_folder ".", "/vagrant", type: "nfs"
and my chef_solo config:
chef.cookbooks_path = ["chef/cookbooks/"]
chef.synced_folder_type = "nfs"

Resources