Windows 10 + VirtualBox:无法将主机从VM + VM连接到主机?


2

我对虚拟化并不熟悉。我可以在Windows 7/8上没有问题地使用它。最近我想在我的新Windows 10笔记本电脑上使用VirtualBox来试用服务器:Kaa。他们提供了一个 沙箱环境 。所以我开始用它。

我已经设法在我的VM上安装Ubuntu 14.04(服务器的主机)作为客户操作系统。但我无法从我的主机笔记本电脑连接它。我从过去知道你必须设置一个桥接适配器,它允许VM连接到互联网并从主机进行通信。 (我希望如此)。

问题: 主机无法与VM通信。而VM也无法与主机通信!

到目前为止,我已经访问了以下问题

到目前为止,他们都建议使用“桥接网络”或“仅限主机”。但两者都没有提供结果。问题仍然存在。

下面是两个图像,一个显示网络配置,另一个显示我的笔记本电脑的拓扑

image 1 - network setting of VM

image 2 - noob topology design of network

VirtualBox版本如下所示

5.0.14 r105127

(这意味着最新的)主机和VM的IP如下

PS C:\Users\foo> ipconfig

Windows IP Configuration


Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::1490:45a1:b9cd:3790%3
   IPv4 Address. . . . . . . . . . . : 192.168.56.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::5cef:ef4f:6ab4:37a4%7
   IPv4 Address. . . . . . . . . . . : 192.168.1.42
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

和我的VM的eth0接口

kaa@kaa-sandbox.kaaproject.org:/$ ifconfig eth0 | grep addr
eth0    Link encap:Ethernet HWaddr 08:00:27:a0:10:f0
        inet addr:192.168.0.112  Bcast:192.168.0.255  Mask:255.255.255.0
        inet6 addr: fe80::a00:27ff:fea0:10f0/64 Scope:Link

从主机到VM的PING测试:

PS C:\Users\foo> ping 192.168.0.112

Pinging 192.168.0.112 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.0.112:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
PS C:\Users\foo> tracert -h 10 -w 1000 -4 192.168.0.112

Tracing route to 192.168.0.112 over a maximum of 10 hops

  1     5 ms     1 ms     1 ms  192.168.1.1
  2     *        *        *     Request timed out.
  3     *        *        *     Request timed out.
  4     *        *        *     Request timed out.
  5  PS C:\Users\foo>
PS C:\Users\foo>

从VM到主机的PING测试:

kaa@kaa-sandbox.kaaproject.org:/$ ping -c 4 192.168.1.42
PING 192.168.1.42 (192.168.1.42) 56(84) bytes of data.
From 192.168.1.42 icmp_seq=1 Destionation Net Unreachable
From 192.168.1.42 icmp_seq=2 Destionation Net Unreachable
From 192.168.1.42 icmp_seq=3 Destionation Net Unreachable
From 192.168.1.42 icmp_seq=4 Destionation Net Unreachable

--- 192.168.1.42 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3004ms

虽然值得一提的是VM位于不同的子网中。这是“桥接适配器”的预期行为吗?

我怀疑问题不在于虚拟机,而在于如何建立网络?我确实有网络知识,但只有基本知识。由于我不明白虚拟适配器的工作原理,我不直接看到问题所在的线索。

或者是Windows 10本身的问题?

也许有人可以指出我的问题并提供解决方案?那将是值得赞赏的。


主人和客人之间缺乏沟通 一定 由于他们躺在不相交的子网中。你应该发布输出 ip route show 在Ubuntu客人。另外:1。您的网络是否使用MAC过滤器? 2.它是否使用VLAN?你有没有 guest 网络?
MariusMatutiae

另外,执行此实验: sudo service network-manager stop; sudo ip link set dev eth0 down; sudo ip addr flush dev eth0; sudo ip link set dev eth0 up; sudo ip addr add 192.168.1.217/24 dev eth0 ; ping -c1 192.168.1.42。你有回复吗?请确保主机通过以太网连接,并且在网络下,您已选择: Name: eth0 (或以太网,或类似于eth的任何东西)。
MariusMatutiae

Answers:


1

NAT怎么样? 如果主机和来宾计算机上都有服务器,您甚至可以在设置>下进行端口转发。网络>高级


1
是的,你说的是正确的(它也有效),但“桥接适配器”选项也应该有效。但我不确定问题出在设置或主机操作系统上。
KarelG

0

虽然值得一提的是VM位于不同的子网中。   这是“桥接适配器”的预期行为吗?

如果VM和主机在不同的子网中具有IP配置,则需要路由器以允许它们相互通信。

桥接适配器就像网络交换机,而不是路由器。

考虑将VM和主机放在同一子网中,至少是临时的,以确认它们可以一起通信。

还检查windows防火墙,它可能阻止通信。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.