今天,我正计划使用流浪者将最新的Ubuntu版本放到我的虚拟盒中。在加载映像并运行vagrant up之后,我得到了一个错误,如下所述,该错误与虚拟盒的网络配置有关。
有趣的是,已经有一些在线帖子(主要在GitHub上,比如:https://github.com/mitchellh/vagrant/issues/7155),但也有AskUbuntu (https://askubuntu.com/questions/760871/network-settings-fail-for-ubuntu-xenial64-vagrant-box)、StackOverflow (vagrant up command giving error and eth1 not showing a resolvable ip address)和StackExchange (https://unix.stackexchange.com/questions/188413/not-able-to-resolve-ip-address-for-eth1-in-vagrant-vm)的帖子。但是,这些问题要么与xenial64 (即而不是 bento)有关,要么涉及使用public_network配置。
正如https://askubuntu.com/questions/760871/network-settings-fail-for-ubuntu-xenial64-vagrant-box中所报告的,ubuntu/trusty64或ubuntu/wily64不存在此问题,但似乎对ubuntu/xenial64和bento/ubuntu-16.04 (即Ubuntu16box)都是一个问题。
正如您将在下面的Vagrantfile中看到的那样,我为bento/ubuntu-16.04做了一个简单的设置,并且只使用private_network。为了明确起见,我不能真正使用这个帖子(vagrant up command giving error and eth1 not showing a resolvable ip address),因为它建议注释掉流浪配置的public_network部分。此外,我应该指出,在发生此错误时,没有其他VM正在运行。
从错误日志中可以看出,netowrk接口eth1显然存在问题,但我不清楚到底是什么问题。我以前已经成功地启动了hashicorp/precise32和ubuntu/trusty64 Ubuntu,具有相同的变化无常配置和相同的Oracle,并且没有遇到这个问题。
任何帮助都是非常感谢的。下面列出了我的技术设置和参考文件。
干杯AHL
设置:
Vagrantfile:
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.network "private_network", ip: "192.168.33.10"
end输出:
C:\Users\AHL\workspace>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/ubuntu-16.04' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
GuestAdditions 5.0.16 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
/sbin/ifdown eth1 2> /dev/null
Stdout from the command:
Stderr from the command:
mesg: ttyname failed: Inappropriate ioctl for device
C:\Users\AHL\workspace>发布于 2016-09-04 19:38:49
我认为在你的列表中,你需要添加https://github.com/mitchellh/vagrant/issues/6871
这个问题仍然存在--有些用户报告说他们可以解决这个问题(https://github.com/mitchellh/vagrant/issues/6871#issuecomment-223290622或https://github.com/mitchellh/vagrant/issues/6871#issuecomment-222348226)。
如果你可以自己用封隔器来构建你的盒子,在网络问题上有一些修正。
发布于 2016-11-27 22:55:41
我遇到了问题,发现由于某种原因,虚拟盒没有将虚拟电缆连接到网络接口。
我解决了这个问题
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]例如,在我的config.vm.provider "virtualbox" do |vb|循环中,我希望连接1GB内存、USB3和网络电缆:
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.customize ["modifyvm", :id, "--usbxhci", "on"] # Connect USB3 disk
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
end我不需要在我使用过的任何其他框中使用这个--cableconnected1行,只在config.vm.box = "bento/ubuntu-16.04"中使用。
也许你必须检查做vagrant up是否没有连接你的任何电缆,我也有一个额外的网络,eth0是不连接的,eth1是有线的。
查查你的案子。也许你必须选择之后的号码。
希望这能有所帮助!
https://stackoverflow.com/questions/39316612
复制相似问题