A VirtualBox machine with the name 'homestead&

2019-01-10 01:25发布

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 the project directory. Homestead up OR Vagrant up create the following message

A VirtualBox machine with the name 'homestead' already exists.

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...
A VirtualBox machine with the name 'homestead' already exists.
Please use another name or delete the machine with the existing
name, and try again.

29条回答
何必那么认真
2楼-- · 2019-01-10 01:50

Open VirtualBox GUI. See for your VM and remove it. It solved my problem.

查看更多
我命由我不由天
3楼-- · 2019-01-10 01:50

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.

查看更多
虎瘦雄心在
4楼-- · 2019-01-10 01:54

If you're using homestead in Windows, just open up your Oracle VM VirtualBox and delete the homestead VM.

查看更多
Emotional °昔
5楼-- · 2019-01-10 01:55

You probably have a virtualbox running! Open the programme virtualbox and shut down the other virtualbox ;) http://smallbusiness.chron.com/shut-down-virtualbox-43657.html

If this isn't working then you might want to delete the old homestead folder and place all your projects in the new folder ;)

查看更多
冷血范
6楼-- · 2019-01-10 01:55

None of this worked for me. I was using an old dev machine

I attempted:

  1. vagrant global-status > destroy any by id which you don't need or match what is conflicting

  2. open virtualbox and remove + delete files for any which you don't need or are conflicting

What worked:

  • locate your ~/.vagrant/machines/ or ~/.vagrant.d/boxes folder. In my case, it contained the conflicting vm and also a bunch of old left over vm machines which steps 1 & 2 did not remove for some reason.

  • after clearing these, everything worked fine again, finally!

查看更多
Fickle 薄情
7楼-- · 2019-01-10 01:56

I was receiving the same error message, even after running "homestead destory", and "vagrant destroy". Same as you, I was using the VirtualBox provider, vagrant, and homestead. Here's what I did:

  1. Opened VirtualBox GUI. I see "homestead" as a VM, but I cannot remove it, button is greyed out.
  2. I logged out of my OS, logged back in and re-opened VirtualBox. Status is now "aborted" and i'm able to remove.
  3. There were some residual files in ~/VirtualBox\ VMs/homestead, so i ran rm -r /Users/gabriel/VirtualBox\ VMs/homestead
  4. I am now able to run "homestead up"
查看更多
登录 后发表回答