无法从主机连接到Vagrant专用网络-无法访问目标主机

马克尔·阿劳佐(Markel Arauzo)

我正在尝试将我的Virtualbox VM设置为与Vagrant一​​起运行。到目前为止,我一直无法连接到机器。

我正在使用Vagrant 2.2.4和Virtualbox 6.0.8r130520(用于Debian / Ubuntu 18的官方Oracle软件包:deb [arch = amd64] http://download.virtualbox.org/virtualbox/debian仿生贡献者”)

在Vagrantfile中使用带有静态ip链接的专用网络

config.vm.network "private_network", ip: "192.168.33.10"

另外:

    v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
    v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]

这是无业游民的输出:

Bringing machine 'test' up with 'virtualbox' provider...
==> test: Importing base box 'dev'...
==> test: Matching MAC address for NAT networking...
==> test: Setting the name of the VM: test
==> test: Fixed port collision for 22 => 2222. Now on port 2200.
==> test: Clearing any previously set network interfaces...
==> test: Preparing network interfaces based on configuration...
    test: Adapter 1: nat
    test: Adapter 2: hostonly
==> test: Forwarding ports...
    test: 22 (guest) => 2200 (host) (adapter 1)
==> test: Running 'pre-boot' VM customizations...
==> test: Booting VM...
==> test: Waiting for machine to boot. This may take a few minutes...
    test: SSH address: 127.0.0.1:2200
    test: SSH username: username
    test: SSH auth method: password
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

流浪状态显示:

Current machine states:

test                    running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

ping 192.168.33.10的输出:

PING 192.168.33.10 (192.168.33.10) 56(84) bytes of data.
From 192.168.33.1 icmp_seq=1 Destination Host Unreachable
From 192.168.33.1 icmp_seq=5 Destination Host Unreachable
From 192.168.33.1 icmp_seq=6 Destination Host Unreachable

我曾尝试设置public_network而不是private_network在Vagrantfile但没有差别的链接

ifconfig输出:

ens2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.64.62.141  netmask 255.255.255.254  broadcast 10.64.62.141
        inet6 fe80::dc1c:3cff:fe64:2047  prefixlen 64  scopeid 0x20<link>
        inet6 2001:bc8:47a0:1f46::1  prefixlen 127  scopeid 0x0<global>
        ether de:1c:3c:64:20:47  txqueuelen 1000  (Ethernet)
        RX packets 764159  bytes 2552235354 (2.5 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 473453  bytes 124372499 (124.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 35498  bytes 451319135 (451.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 35498  bytes 451319135 (451.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vboxnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.33.1  netmask 255.255.255.0  broadcast 192.168.33.255
        inet6 fe80::800:27ff:fe00:0  prefixlen 64  scopeid 0x20<link>
        ether 0a:00:27:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 434  bytes 42136 (42.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

路由-n输出:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.64.62.140    0.0.0.0         UG    0      0        0 ens2
10.64.62.140    0.0.0.0         255.255.255.254 U     0      0        0 ens2
192.168.33.0    0.0.0.0         255.255.255.0   U     0      0        0 vboxnet0

我想念什么吗?此框在本地工作。任何帮助或建议,将不胜感激。

万达维·纳吉布R

是的,这是一个很大的问题,VM的第一级只能模拟硬件。

要使其正常工作,需要大量的调整和自定义驱动程序。

在裸机上运行,​​这是VirtualBox设计的。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

无法连接到虚拟专用网络

网络:目标主机无法访问

无法连接到VM上的Internet(启用了NAT和主机专用网络)

ORA-12543: TNS:目标主机无法访问

ping响应“请求超时。” 与“目标主机无法访问”

与机械手的TCP通信-目标主机无法访问-

无法访问使用 Microstack 启动的虚拟机 - 目标主机无法访问

无法通过PsExec连接到专用网络上的远程计算机

ipv6 ping主机无法访问目标主机,直到运行tcpdump

通过不同的接口连接到同一服务器(SO_BINDTODEVICE):无法访问目标主机

网关可从虚拟机访问,但网络中的其他计算机无法访问(目标主机不可访问)

无法在专用网络上建立TCP连接

在Kali Linux中对移动设备执行ping操作时无法访问目标主机

两个 Raspberry PI 之间无法访问目标主机

主机在Docker容器内无法访问

Zabbix JMX监控主机无法访问

ansible:静默跳过无法访问的主机

Ansible跳过无法访问的主机

无法访问的 Ansible 主机的报告

JmsConnectionFactory主机放置的WAS MQ无法访问

debian 9 伸展 vagrant vm box 主机无法访问

VMware Workstation桥接网络主机无法访问

openstack:无法从实例和 neutron-gateway/0 ping Internet - 错误“目标主机无法访问”

Kubernetes的“ Windows pod”无法相互通信 “无法解析主机” | “无法连接网络无法访问”

火力认证FirebaseNetworkException:网络错误(例如,超时,中断连接或无法访问的主机)已经发生

Ansible,连接到 AWS VPC 中的堡垒服务器,主机无法访问

尝试从另一个VM ping一个VM的IP:无法访问目标主机

无法访问本地网页(错误:无法解析主机)

无法与主机smtp.gmail.com建立连接。Laravel电子邮件中无法访问网络#101错误