我可以使用 `vagrant box update` 而已经通过 `vagrant up` 拥有机器 运行 吗?

Can I use `vagrant box update` while already having the machine running by `vagrant up`?

我在 Laravel 中有一些项目,当我必须对它们进行一些维护时,有时当我 运行 vagrant up 时,它会警告我有一个更新的laravel版本的盒子,宅基地,喜欢下面的留言:

A newer version of the box 'laravel/homestead' is available! You currently
have version '1.1.0'. The latest is version '2.0.0'. Run
`vagrant box update` to update.

我的问题是,当我 运行 vagrant box update 时,总是要花十年的时间才能下载新版本的盒子,因为 hashicorp 的服务器似乎不够好处理...

考虑到这一点,我可以在安装机器的同时对我的项目进行维护,同时更新盒子吗?我真的不明白这是否真的可能,或者这会对事情产生什么影响。

非常感谢,希望能请教其他网友也有的问题

不,你不能更新 运行 机器.. 只需 update 命令下载新图像.. 所以如果你真的必须更新机器( 运行 或不) 你必须摧毁它。

查看 vagrant 版本控制 documentation 了解更多详情

Having that in mind, can I give maintenance to my project while putting the machine up, and in parallel, also update the box?

是 - 您可以启动当前的 VM 运行 vagrant up 并同时更新现有框 vagrant box update(您甚至可以从任何文件夹执行此操作,在本例中指向要更新的框 vagrant box update --box laravel/homestead)

请注意,当您第一次启动时,该框用于创建 VM(流浪者基本上是克隆该框以创建新的 VM),因此如果您更新该框,它不会影响您当前的 VM

正如其他人所提到的,如果您希望您的 VM 反映盒子的更新(例如第 3 方软件),那么是的,您需要销毁 VM 并重新创建 VM (运行 vagrant up)