vagrant - 配置需要 VM 从 Vagrantfile 运行的 VBoxManage 命令

标签 vagrant virtualbox vagrantfile

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/

相关文章:

vmware - 从 VMWARE 迁移到 VirtualBox

vagrant - 如何在使用 Puppet 安装模块后立即使用模块中的类?

vagrant - 在 Vagrantfile 中声明的多台机器是否必须基于相同的基盒?

vagrant - 如何在公网访问 Vagrant Box

asp.net - .NET 开发人员的 Vagrant 文件(使用 Windows、IIS、MS SQL)

linux - Virtual Box 和 Windows 7 主机的 Gvim 重绘问题

Vagrant 同步文件夹权限

chef-infra - 调配时Chef-solo ssl警告

php - 无法安装 Vagrant box Laravel Homestead

sql-server - 如何从Mac主机连接Win7虚拟机中的SQL Server?