Since homestead 2.0 homestead laravel has not been working
I don\'t know why \'homestead init\' creates a Homestead.yaml file in mydirectory/.homestead and not in
You can open the VirtualBox GUI and remove the conflicting virtual machine.
The Vagrant relies on VirtualBox (if that's the default provider) so it checks for existing environment first before provisioning your VM.
It is executing the following command:
VBoxManage list vms
and when it finds the VM with the same hostname, so it'll fail.
You can debug it by:
vagrant --debug up
to find out the exact reason.
If you're planning to use multiple VMs in different folders, then you need to change your config.vm.hostname
(possibly config.vm.provider(name)
as well) in your Vagrantfile
to make it unique. Or simply remove it, so Vagrant will assign a different name for each VM.
If that's not the case, simply shutdown and unregister previous VM which conflicts by running:
VBoxManage controlvm NAMEOFVM poweroff
VBoxManage unregistervm NAMEOFVM --delete
and re-run your vagrant up
.
If it fails on directory rename (because you missed --delete
), then rename or remove the destination folder, for example:
rm -fr ~/"VirtualBox VMs/NAMEOFVM"
and re-try again.
This problem may be related to: GitHub issue #2969 - vagrant up not detecting a previously run VM
From the following message :
A VirtualBox machine with the name 'vm_name' already exists. Please use another name or delete the machine with the existing name, and try again.
I listed current running virtual machines from the command line :
VBoxManage list vms
Result :
"vm_name" {8ba467b7-da96-4f68-9bf8-671dd6f0d007}
Then proceeded with the removal of the offending virtual machine :
VBoxManage unregistervm 8ba467b7-da96-4f68-9bf8-671dd6f0d007 --delete
I had the following error:
Error:
A VirtualBox machine with the name 'homestead-7' already exists.
Please use another name or delete the machine with the existing
name, and try again.
Solution:
~/VirtualBox VMs
ls
command, and review if the virtual machine is therevagrant up
command in the homestead folderThat's all, I hope it's helpful, that was my solution.
Regards!
If you want to keep keep your machine, without destroying and recreating following steps should solve your problem. (I work on OS X El Captain, Vagrant 1.8.1)
Run homestead in debug mode
homestead --debug up
Look for something like in the output:
INFO machine: Initializing machine: default INFO machine: - Provider: VagrantPlugins::ProviderVirtualBox::Provider INFO machine: - Box: # INFO machine: - Data dir: /Users/YOUR_HOME_DIR/Workspace/Homestead/.vagrant/machines/default/virtualbox
Data dir, is the path which is interesting for you.
Then vboxmanage list vms
"homestead" {0e8438b9-4a67-4fb1-80cb-2c62cf04ab5c} "settler_default_1447385930122_73498_1474294682778_13108" {93ecb93f-f159-4406-a384-5312b4d3ab34}
Edit id file, in the path which you found out in the previous command
vi /Users/YOUR_HOME_DIR/Workspace/Homestead/.vagrant/machines/default/virtualbox/id
Replace content of that file, with the id of the VM you want to fix, in this scenario it is
0e8438b9-4a67-4fb1-80cb-2c62cf04ab5c
Now try
homestead up
VM should start booting. It might work, or you might have issues with ssh authentication
default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Authentication failure. Retrying... default: Warning: Authentication failure. Retrying...
To fix that do following Check Homestead SSH config
homestead ssh-config
You should get something like
Host default HostName 127.0.0.1 User vagrant Port 2222
UserKnownHostsFile /dev/null StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile "/Users/pryznar/.vagrant.d/insecure_private_key"
IdentitiesOnly yes LogLevel FATAL
Edit IdentityFile file
/Users/YOUR_HOME_DIR/.vagrant.d/insecure_private_key
Check Homestead.yml
cat /Users/YOUR_HOME_DIR/.homestead/Homestead.yaml
Then copy path to the file under the key keys, and copy private key from that file
cat ~/.homestead/ssh/id_rsa
Last step is to replace private key in /Users/YOUR_HOME_DIR/.vagrant.d/insecure_private_key with the one you just copied
Now try rung homestead again, should work.
homestead up
I got some warnings, but so far it works without issues
==> default: Warning: Using a password on the command line interface can be insecure. ==> default: ERROR 1045 (28000): Access denied for user 'homestead'@'localhost' (using password: YES) 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.
The following procedure will destroy your VM and may be only suiteable in a desting-environment like mine! For production environments, consider to repair the association like described here
I had this problem after overriding the default name of an already existing VM by using
Vagrant.configure("2") do |config|
config.vm.define :ubuntu_test
where the VirtualBox name was also set (as a newbie I assumed that Vagrand will use this name too)
config.vm.provider "virtualbox" do |vb|
vb.name = "Ubuntu-Test"
end
By adding config.vm.define
it seems that Vagrant doesn't associate the VirtualBox VM any more with the Vagrant file since even vagrant destroy -f
say VM not created
but vagrant up
throw this error
To delete those zombie VMA VirtualBox machine with the name 'Ubuntu-Test' already exists.
vboxmanage shutdown <VMName>
(Here the name is Ubuntu-Test
)vboxmanage list vms
vboxmanage unregistervm <Id> --delete
vagrant up
vagrant global-status --prune
, your new name is present