如何在Vagrant中自动选择桥接网络接口? [英] How to automatically select bridged network interfaces in Vagrant?

查看:732
本文介绍了如何在Vagrant中自动选择桥接网络接口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该在Vagrant文​​件中添加些什么以防止询问(在vagrant up命令之后)

What should I add in Vagrant file to prevent asking (after vagrant up command)

网络应该连接到哪个接口?

Available bridged network interfaces:
1) Intel(R) 82579LM Gigabit Network Connection
2) VMware Virtual Ethernet Adapter for VMnet1
3) VMware Virtual Ethernet Adapter for VMnet8

我要选择#1选项. 当前,我需要手动输入"1". 请帮忙!

I want to select the #1 option. Current I need to enter "1" manually. Please help!

推荐答案

在您的Vagrant文​​件中,您应该添加

in your Vagrantfile, you should add

config.vm.network "public_network", bridge: "Intel(R) 82579LM Gigabit Network Connection"

然后,它应该使无所事事的人开心(实际上,在这种情况下,它变得更加开心),并为VM选择正确的网络适配器

Then it should make vagrant happy (actually its more VirtualBox that is getting happy in this case) and select the correct network adapter for the VM

这篇关于如何在Vagrant中自动选择桥接网络接口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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