在 Vagrantfile 设置中启用 gui [英] enabling gui in Vagrantfile settings

查看:25
本文介绍了在 Vagrantfile 设置中启用 gui的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过在 Vegrantfile 中使用 configure.vm.boot_mode = :gui,但得到这个错误:以下设置不应该存在:boot_mode

I've tried using configure.vm.boot_mode = :gui in Vegrantfile, but got this error: The following settings shouldn't exist: boot_mode

我现在修复它的方法是使用供应商配置(虚拟机):

the way I fixed it now is by using vendor configuration (virtualbox):

config.vm.provider "virtualbox" do |v|
    v.gui = true
end

但我想在不必要的时候避免特定于供应商的任何东西.对此有什么与供应商无关的替代方案?boot_mode 有替代品吗?

but I would like to avoid vendor-specific anything when not necessary. what vendor-agnostic alternative is there to this? is there a replacement to boot_mode?

推荐答案

vm.boot_mode 在 Vagrant 1.1 中消失了,但如果你将它包含在 V1 配置中,你仍然可以使用它阻止:

vm.boot_mode is gone with Vagrant 1.1, but you can still use it if you enclose it in a V1 configuration block:

Vagrant.configure("1") do |config|
  config.vm.boot_mode = :gui
end

Vagrant.configure("2") do |config|
  # V2 Config...
end

这篇关于在 Vagrantfile 设置中启用 gui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆