vagrant - Vagrant-Hyper-V:不应存在以下设置:customize、gui
问题描述
我试图在 Windows 10 中使用 Hyper-V 版本 10.0 运行版本 2.2.5 的 vagrant 我收到此错误
There are errors in the configuration of this machine.
Please fix the following errors and try again:
Hyper-V:
* The following settings shouldn't exist: customize, gui
我检查了其他类似的问题,但似乎没有任何帮助。
我的流浪档案
$script = <<-SCRIPT
echo "cd /vagrant" >> /home/vagrant/.profile
echo "All good!!"
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.ssh.username = 'vagrant'
config.ssh.password = 'vagrant'
config.ssh.insert_key = 'true'
# Ports foward
# For CouchDB Container
config.vm.network "forwarded_port", guest: 5984, host: 5984
# Zookeeper
#config.vm.network "forwarded_port", guest: 2181, host: 2181
# For Kafka Broker
#config.vm.network "forwarded_port", guest: 9092, host: 9092
# For Kafka Manager
config.vm.network "forwarded_port", guest: 9000, host: 9000
# This gets executed for both vm1 & vm2
#config.vm.provision "shell", inline: "echo 'All good'"
config.vm.provision "shell", inline: $script
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "1"]
vb.gui = false
end
config.vm.provider :hyperv do |hv|
hv.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "1"]
hv.gui = false
end
end
解决方案
您可以删除此部分
config.vm.provider :hyperv do |hv|
hv.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "1"]
hv.gui = false
end
全部一起。这些参数特定于 VirtualBox
如果需要,您可以查看可以添加到此部分的hyperv 特定设置
推荐阅读
- android - Android studio 这里不允许使用元素 androidx.coordinatorlayout.widget.CoordinatorLayout
- javascript - 重定向html页面并使用不同的URL打开新标签
- php - wordpress 上的回声删除 // 从图像 url
- c# - 为什么 IEnumerable.ToObservable 这么慢?
- web-worker - 网络工作者中的 h3-js:未定义文档
- service-worker - 我的 PWA 关闭时如何触发离线后台功能
- javascript - 这个 .then(function(reponse)) 发生了什么?
- android - 访问和共享内部/外部存储Android Q中图片文件夹下的文件
- python-3.x - 线程化参数列表并在 Python 中加入结果
- java - 毕加索图片加载不出来