Vagrant Laravel Homestead - error when running vagrant up
Solution 1
The issue you're experiencing with Homestead has been documented in Github. There is a workaround provided, which is as follows:
Solution: Remove type: "nfs" on your folders of Homestead.yaml.
http://docs.vagrantup.com/v2/synced-folders/nfs.html
"Windows users: NFS folders do not work on Windows hosts. Vagrant will ignore your request for NFS synced folders on Windows.
Original Answer (for the question before it was edited)
Now the issue seems to be with your ssh key, or lackthereof.
No such file or directory @ rb_sysopen - C:/Users/Anders/.ssh/id_rsa (Errno::ENOENT)
The section in the guide you linked titled Set Your SSH Key has the following instructions to help you generate one (trimmed to the relevant Windows instructions):
Set Your SSH Key
[...]
On Windows, you may install Git and use the
Git Bash
shell included with Git to issue the command above. Alternatively, you may use PuTTY and PuTTYgen.Once you have created a SSH key, specify the key's path in the authorize property of your
Homestead.yaml
file.
If you are not that comfortable with commandlines, I would recommend using the PuTTYgen method.
Solution 2
In case anyone else ends up here via Google and didn't read all the comments too well (like I did).
I ran into the same issue of not being able to vagrant up
with the following error:
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
mount -t vboxsf -o actimeo=1,nolock,uid=1000,gid=1000 var_www_dev.mybox /var/www/dev.mybox
The error output from the command was:
fmask =<arg> umask of regular files
As Lucas mentioned here Windows users can install the vagrant-winnfsd plugin which allows you to use NFS shared folders in Vagrant and Homestead).
So I solved this error by running vagrant plugin install vagrant-winnfsd
followed by a vagrant up
.
Solution 3
This is a problem with your Homestead.yaml file in ~/.homestead directory. I need see the file content to help you more.
After you had fixed the indention style to use only space characters, the another problem happenned because you not generate a pair (public and private) of keys yet. To do that:
mkdir -p ~/.ssh && cd ~/.ssh
ssh-keygen -b 2048 -t rsa -C "[email protected]"
You can let the default file name (id_rsa), type the password and repeat the same password.
AHL
Updated on June 16, 2022Comments
-
AHL almost 2 years
I have followed the tutorial on https://laravel.com/docs/5.0/homestead and when running the step 'vagrant up', I get the following error message (below) Any ideas what the problem is? Running latest version of Oracle VirtualBox and the latest version of Vagrant. Regards
--
C:\Users\Anders\Vagrant\Homestead>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-7 ==> 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 (guest) => 8000 (host) (adapter 1) default: 443 (guest) => 44300 (host) (adapter 1) default: 3306 (guest) => 33060 (host) (adapter 1) default: 5432 (guest) => 54320 (host) (adapter 1) 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: 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! GuestAdditions versions on your host (5.0.16) and guest (5.0.12) do not match. Reading package lists... Building dependency tree... Reading state information... dkms is already the newest version. linux-headers-3.19.0-25-generic is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso mount: block device /tmp/VBoxGuestAdditions.iso is write-protected, mounting rea d-only Installing Virtualbox Guest Additions 5.0.16 - guest version is 5.0.12 Verifying archive integrity... All good. Uncompressing VirtualBox 5.0.16 Guest Additions for Linux............ VirtualBox Guest Additions installer Removing installed version 5.0.12 of VirtualBox Guest Additions... Stopping VirtualBox Additions ...fail! (Cannot unload module vboxguest) Removing existing VirtualBox DKMS kernel modules ...done. Removing existing VirtualBox non-DKMS kernel modules ...done. Stopping VirtualBox Guest Addition service ...done. Copying additional installer modules ... Installing additional modules ... Removing existing VirtualBox DKMS kernel modules ...done. Removing existing VirtualBox non-DKMS kernel modules ...done. Building the VirtualBox Guest Additions kernel modules ...done. Doing non-kernel setup of the Guest Additions ...done. You should restart your guest to make sure the new modules are actually used Installing the Window System drivers Could not find the X.Org or XFree86 Window System, skipping. An error occurred during installation of VirtualBox Guest Additions 5.0.16. Some functionality may not work as intended. In most cases it is OK that the "Window System drivers" installation failed. ==> default: Checking for guest additions in VM... ==> default: Setting hostname... ==> default: Configuring and enabling network interfaces... ==> default: Mounting shared folders... default: /vagrant => C:/Users/Anders/Vagrant/Homestead default: /home/vagrant/Code => C:/Users/Anders/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 vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3`, actimeo=1 home_vagrant_Code /home/vagrant/Code mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant`,actimeo=1 home_vagran t_Code /home/vagrant/Code The error output from the last command was: unknown mount option `actimeo=1' valid options: rw mount read write (default) ro mount read only uid =<arg> default file owner user id gid =<arg> default file owner group id ttl =<arg> time to live for dentry iocharset =<arg> i/o charset (default utf8) convertcp =<arg> convert share name from given charset to utf8 dmode =<arg> mode of all directories fmode =<arg> mode of all regular files umask =<arg> umask of directories and regular files dmask =<arg> umask of directories fmask =<arg> umask of regular files C:\Users\Anders\Vagrant\Homestead>
--
vagrant file:
--
require 'json' require 'yaml' VAGRANTFILE_API_VERSION = "2" confDir = $confDir ||= File.expand_path("~/.homestead") homesteadYamlPath = confDir + "/Homestead.yaml" homesteadJsonPath = confDir + "/Homestead.json" afterScriptPath = confDir + "/after.sh" aliasesPath = confDir + "/aliases" require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb') Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| if File.exists? aliasesPath then config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases" end if File.exists? homesteadYamlPath then Homestead.configure(config, YAML::load(File.read(homesteadYamlPath))) elsif File.exists? homesteadJsonPath then Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath))) end if File.exists? afterScriptPath then config.vm.provision "shell", path: afterScriptPath end end
--
yaml file:
--
--- ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox authorize: ~/Vagrant/Homestead/homestead.pub keys: - ~/.ssh/id_rsa folders: - map: ~/Code to: /home/vagrant/Code type: "nfs" sites: - map: homestead.app to: /home/vagrant/Code/Laravel/public hhvm: true databases: - homestead
-
AHL about 8 yearsthanks Lucas -> I issues the commands thru my GitShell on Windows and solved the issue. New problem edited above
-
AHL about 8 yearsthanks Brian Morton -> I issues the commands thru my GitShell on Windows and solved the issue. New problem edited above
-
Brian Brownton about 8 years@AHL could you clarify exactly what your current issue is? The original question is quite confusing now with all the edits!
-
Lucas Silva about 8 yearsI never used the vagrant-login neither vagrant-vbguest and maybe the latter is causing the problem. Try remove it
vagrant plugin uninstall vagrant-vbguest
and install the nfs kernel server in your host machinesudo apt-get install nfs-kernel-server
. -
AHL about 8 yearsCan I install the nfs-kernel-server on a Windows machine also? Or is this only applicable if the host is Linux based?
-
Brian Brownton about 8 years@AHL I have updated the answer to reflect the updates to your question.
-
Lucas Silva about 8 yearsOn Windows you can install a vagrant plugin to add the support for NFS:
vagrant plugin install vagrant-winnfsd
. (github.com/winnfsd/vagrant-winnfsd) -
AHL about 8 yearsthanks Brian - this was the issue. Another question: where do I put my code so that I can access it at 192.168.10.10:8000 ? I put a file under C:\Users\Anders\Vagrant\Homestead\Code but when I try to access 192.168.10.10:8000 in my browser in the host machine I get a "Unable to Connect" error
-
Brian Brownton about 8 years@AHL you may need to open a separate question since that is a separate issue, but as a start you can run
sudo netstat -lnutp
and see if:8000
andnginx
show up anywhere in that list (they should). If they do not, that meansnginx
, the webserver on the vagrant box` is not running. -
Yevgeniy Afanasyev over 6 yearsRemoving type: "nfs" fixed it for me. Win 10, Vagrant 1.9.7, laravel 5.4, homestead.