Linux 与Docker的流浪者私密网络中断

Linux 与Docker的流浪者私密网络中断,linux,networking,vagrant,archlinux,docker,Linux,Networking,Vagrant,Archlinux,Docker,我使用默认设置通过Vagrant创建Virtualbox vm。使用vagrant up构建vm的工作方式与预期一致,并提供了一个运行框 然后,我需要转发端口的功能,并将以下内容添加到Vagrant文件中: 这是可行的,但我后来意识到我需要在两个方向上进行端口转发。我试图为此创建一个专用网络,而不是转发每个端口。将以下内容添加到配置中应该可以实现此目的: Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|

我使用默认设置通过Vagrant创建Virtualbox vm。使用vagrant up构建vm的工作方式与预期一致,并提供了一个运行框

然后,我需要转发端口的功能,并将以下内容添加到Vagrant文件中:

这是可行的,但我后来意识到我需要在两个方向上进行端口转发。我试图为此创建一个专用网络,而不是转发每个端口。将以下内容添加到配置中应该可以实现此目的:

Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
  config.vm.network :private_network, ip: "172.17.0.2"
end
但是,这会在创建vm时触发错误:

> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Running 'pre-boot' VM customizations...
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'poweroff' state. Please verify everything is configured
properly and try again.

If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.
知道如何调试和解决这个问题吗

主机操作系统:ArchLinux

VM OS:Ubuntu请参阅上面链接的Vagrantfile,网址为:

要确保桥接网络的完整功能,请确保 vboxnetadp、vboxnetflt和vboxpci内核模块也已加载并 已安装net tools软件包

内核模块 问题在于,用于在虚拟机中创建专用网络的核心模块需要单独加载:

sudo modprobe -a vboxnetadp vboxnetflt
要在每次重新启动后使此更改永久化,请将以下行放入/etc/modules-load.d/virtualbox.conf中:

包装 net工具需要安装:

sudo pacman -S net-tools
您还需要virtualbox主机模块包,以便使专用网络充满活力:

sudo pacman -S virtualbox-host-modules
从:

要确保桥接网络的完整功能,请确保 vboxnetadp、vboxnetflt和vboxpci内核模块也已加载并 已安装net tools软件包

内核模块 问题在于,用于在虚拟机中创建专用网络的核心模块需要单独加载:

sudo modprobe -a vboxnetadp vboxnetflt
要在每次重新启动后使此更改永久化,请将以下行放入/etc/modules-load.d/virtualbox.conf中:

包装 net工具需要安装:

sudo pacman -S net-tools
您还需要virtualbox主机模块包,以便使专用网络充满活力:

sudo pacman -S virtualbox-host-modules