VBoxManage 下有几个命令要求 guest 计算机已经运行(例如 controlvm、guestcontrol),但我在 Vagrantfile 中看到的所有 vbox 配置都发生在计算机启动之前。/p>
Vagrantfile 中有没有办法在机器启动后配置机器?
最佳答案
vagrant 的目标是为多个提供者(包括 VirtualBox)抽象化 VM 的创建,它并不是真正提供之后对 VM 的所有操作并取代 VBoxManage -
如果您需要在虚拟机启动后运行命令并从 Vagrantfile
运行它,我建议查看 vagrant-triggers plugin其中:
Allow the definition of arbitrary scripts that will run on the host before and/or after Vagrant commands.
关于vagrant - 配置需要 VM 从 Vagrantfile 运行的 VBoxManage 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36504052/