Laravel Homestead:“VM 未创建.. 继续”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28297892/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 10:49:00  来源:igfitidea点击:

Laravel Homestead: "VM not created.. moving on"

phplaravelvagranthomestead

提问by rdiz

I did a global install of Laravel homestead, edited my ~/.homestead/Homestead.yaml-file and spun up the VM with homestead up. Everything worked fine, but then I needed to add another site. I edited Homestead.yamlto contain the new project, the tried to run homestead provisionto apply the changes to the VM. The only thing that outputs is:

我对 Laravel homestead 进行了全局安装,编辑了我的~/.homestead/Homestead.yaml-file 并使用homestead up. 一切正常,但后来我需要添加另一个站点。我编辑Homestead.yaml以包含新项目,尝试运行homestead provision以将更改应用于 VM。唯一输出的是:

==> default: VM not created. Moving on...

I interpret that as the VM is not running, but it is. The only thing working here is homestead destroyfollowed by homestead up, but that (by its nature) detroys the VM's saved state. I though that vagrant commands was applicable to homestead as well, but vagrant suspend && vagrant up --provisiondoesn't help.

我将其解释为 VM 没有运行,但它确实在运行。在这里工作的唯一的东西是homestead destroy其次homestead up,但(其性质)detroys虚拟机的保存状态。我认为 vagrant 命令也适用于宅基地,但vagrant suspend && vagrant up --provision没有帮助。

So.. How do I apply my new config to an already-existing homestead VM?

那么.. 我如何将我的新配置应用到已经存在的 Homestead VM?

回答by rdiz

I found the answer at Laracasts. Copied directly from there:

我在Laracasts找到了答案。直接从那里复制:

Try doing this... You should see a vagrant box that is listed that is linked to your composer/vendor...

尝试这样做...您应该看到一个链接到您的作曲家/供应商的流浪框列出...

vagrant global-status

Example Output:

示例输出:

$ vagrant  global-status
id       name    provider   state   directory
-----------------------------------------------------------------------------------------------------
1ace413  default virtualbox running (...)/laravel/homestead

Then go ahead and run:

然后继续运行:

vagrant provision {ID}

Example input:

示例输入:

vagrant provision 1ace413

ID being the id of the vagrant instance in the above step.

ID 是上述步骤中的 vagrant 实例的 id。

You should then be good to go!

然后你应该很高兴去!

回答by Apit John Ismail

I recently change my laptop from 32 bit to 64 bit and have to redo installation and setup of my Homestead again.

我最近将我的笔记本电脑从 32 位更改为 64 位,并且必须再次重新安装和设置我的 Homestead。

After setup everything I run below command

设置完所有内容后,我在命令下运行

vagrant reload --provision

and I get the same feedback which is

我得到了相同的反馈

==> default: VM not created. Moving on...

After that I try this command and all works well.

之后我尝试这个命令并且一切正常。

vagrant up

I think for first time running Homestead, no need to reload --provision.

我认为第一次运行 Homestead,不需要重新加载 --provision。

回答by ddelnano

You can run vagrant provisionto update homesteads websites. However you have to find where the Vagrantfile for the Homestead VM is. If you did the global install it should be in .composer/vendor/laravel/homestead/directory. You need to change into that directory

您可以运行vagrant provision以更新宅基地网站。但是,您必须找到 Homestead VM 的 Vagrantfile 在哪里。如果您进行了全局安装,它应该在.composer/vendor/laravel/homestead/目录中。你需要切换到那个目录

cd ~/.composer/vendor/laravel/homestead

Then you need to provision the VM

然后你需要配置虚拟机

vagrant provision

Your homestead box should then reflect the changes in the Homestead.yml file.

然后你的 homestead 框应该反映 Homestead.yml 文件中的更改。

Edit: I am not at my mac right now so the directory path is a guess of what I remember it being the last time I provisioned my box so please take that into consideration but I am very sure that path should be correct.

编辑:我现在不在我的 mac 上,所以目录路径是我记得上次我配置我的盒子时的猜测,所以请考虑这一点,但我非常确定路径应该是正确的。

回答by Emma

I had my VM provision vertualbox running so i had to exit first

我的 VM 配置 vertualbox 正在运行,所以我必须先退出