Wi-Fi的VirtualBox网络适配器/ DNS问题

相互联系

我遇到了VirtualBox的一个非常奇怪的问题。

大多数时候,我的笔记本电脑都硬连接到以太网连接。有时候,当我不在办公桌旁时,除了Wi-Fi之外,我别无选择。连接到Wi-Fi时,我的主机(Windows 10)可以在几秒钟内访问网络,而没有任何问题。但是,来宾(Windows XP SP3)将像仍处于脱机状态一样工作。

我在VirtualBox中的网络配置为NAT

奇怪的是,这仅发生在无线网络上。每当我对计算机进行硬连线时,主机操作系统获得网络连接时就不会有任何问题。我将其设置为NAT是因为我需要来宾OS可以访问Internet,但是我不希望主机之外的客户端连接到它。我也不想将访客计算机绑定到有线网卡或无线网卡,因为那样一来它只能在一个或另一个上工作。

另一方面,无论何时我连接到Wi-Fi,从访客获得Internet连接总是会出现问题。

有一次我遇到问题,我打了个打字ipconfig /flushdns,突然事情开始了。从那以后,还远远不够。刷新DNS不足以使事情在Wi-Fi上正常工作。

我发现强迫它工作的唯一方法是进入guest虚拟机的VirtualBox设置,然后将Network adapter从更改NATBridged在这一点上,它仍然无法正常工作。但是,现在,如果我ipconfig /flushdns在来宾上键入内容,一切都会突然起作用:我可以访问网络。更奇怪的是,我现在可以将其更改回NAT突然,它将停止工作,但是,如果我再做ipconfig /flushdns 一次,它将工作。

换句话说,我已经走了整整一圈,回到了NAT最终可行连接。起始状态和结束状态完全相同,因此我感到困惑,为什么来宾无法自行获得网络连接。如果ipconfig /flushdns只要在连接Wi-Fi时只需要键入,那将是一回事,但是必须退出来宾并将适配器从更改NATBridged,然后再更改NAT,然后键入命令,这确实是一个痛苦

为什么会发生这种情况,更重要的是,我如何解决此问题,使其与硬连线时一样无缝地工作?ipconfig /flushdns例如,当从Wi-Fi返回以太网时,不需要输入任何内容,也不需要弄乱任何适配器设置)。

这是最近的故障排除会话的命令提示符输出:

刚刚连接到Wi-Fi,无法访问网络:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\InterLinked>ping google.com
Ping request could not find host google.com. Please check the name and try again
.

C:\Documents and Settings\InterLinked>ping google.com
^C
C:\Documents and Settings\InterLinked>ipconfig /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

C:\Documents and Settings\InterLinked>ping google.com
Ping request could not find host google.com. Please check the name and try again
.

更改NAT为,Bridged然后重试:

C:\Documents and Settings\InterLinked>

C:\Documents and Settings\InterLinked>ping google.com

我提早终止了它,因此缺少输出,但是ping失败,直到刷新DNS:

^C
C:\Documents and Settings\InterLinked>ipconfig /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

C:\Documents and Settings\InterLinked>ping google.com

Pinging google.com [172.217.7.14] with 32 bytes of data:

Reply from 172.217.7.14: bytes=32 time=15ms TTL=48
Reply from 172.217.7.14: bytes=32 time=13ms TTL=48
Reply from 172.217.7.14: bytes=32 time=15ms TTL=48
Reply from 172.217.7.14: bytes=32 time=20ms TTL=48

Ping statistics for 172.217.7.14:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 13ms, Maximum = 20ms, Average = 15ms

C:\Documents and Settings\InterLinked>

我改BridgedNAT

C:\Documents and Settings\InterLinked>ping google.com

Pinging google.com [172.217.7.14] with 32 bytes of data:

Reply from 172.217.7.14: bytes=32 time=15ms TTL=47
Destination host unreachable.
Destination host unreachable.
Destination host unreachable.

Ping statistics for 172.217.7.14:
    Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),
Approximate round trip times in milli-seconds:
    Minimum = 15ms, Maximum = 15ms, Average = 15ms

C:\Documents and Settings\InterLinked>ipconfig /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

C:\Documents and Settings\InterLinked>ping google.com

Pinging google.com [172.217.7.14] with 32 bytes of data:

Reply from 172.217.7.14: bytes=32 time=12ms TTL=47
Reply from 172.217.7.14: bytes=32 time=6ms TTL=47
Reply from 172.217.7.14: bytes=32 time=188ms TTL=47
Reply from 172.217.7.14: bytes=32 time=14ms TTL=47

Ping statistics for 172.217.7.14:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 6ms, Maximum = 188ms, Average = 55ms

C:\Documents and Settings\InterLinked>
相互联系

如前所述,启用VirtualBox DNS解析器是解决方案。

具体步骤如下:

  1. 关闭虚拟机。打开机器电源后,无法打开DNS解析器。
  2. 从命令提示符导航到主机上的VirtualBox目录cd C:\Program Files\Oracle\VirtualBox
  3. 运行以下命令: VBoxManage modifyvm "<VM name>" --natdnshostresolver1 on

<VM name>只是VM的名称,也可以通过运行找到它VBoxManage list runningvms

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

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

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何让无线网络适配器的Wi-Fi IP地址在Python?

如何在Ubuntu中启用Wi-Fi网络适配器“ Intel AC 3168”?

Rosewell网络适配器的问题

Qualcomm Atheros AR9285适配器的Wi-Fi连接问题

未找到 WI-FI 适配器,并且 Git 存储库无法修复该问题?

WI-Fi问题,适配器可在安装中使用,但现在不再可用

HWE更新后的网络适配器问题

Ubuntu 16.04上的Netgear A6210高增益Wi-Fi USB 3.0适配器问题

在 Ubuntu 18.04.4 上安装双频 USB 适配器 2.4/5GHz Wi-Fi 时出现问题

Nighthawk 夜鹰 AC1900 Wi-Fi USB 适配器问题 (0846:9054 NetGear) on 18.04

通过 PowerShell 获取活动网络适配器并设置 DNS

I219网络适配器和em 7.6.2的问题

Realtek的无线网络适配器问题

找不到 Wi-Fi 适配器 - Ubuntu - iwlwifi

CentOS 8 找不到 Wi-Fi 适配器

Lenovo 18.04未找到Wi-Fi适配器

找不到 Wi-Fi 适配器 Ubuntu 20.04

Qualcomm Atheros QCA6174 802.11ac无线网络适配器[168c:003e](32版)无法启用wi-fi

在 Windows 注册表中设置时,网络适配器 DNS 服务器不会立即应用

Sql Developer上此问题“ IO错误:网络适配器无法建立连接”的原因是什么?

Wi-Fi的特殊问题

VirtualBox网络适配器无法安装

Virtualbox虚拟机中的网络适配器

如何删除仅VirtualBox主机的网络适配器

我通过安装 ubuntu 18.04 双启动了我的 hp 笔记本电脑。我的 wi-fi 无法正常工作,它显示未找到 wifi 适配器。请帮我解决这个问题

Broadcom Wi-Fi 适配器不适用于 Ubuntu 20.04.2

服务器16.04:配置Wi-Fi连接(USB适配器)

如何通过内置的Wi-Fi适配器将智能电视用作监视器?

在Windows 7双启动的Ubuntu 18.04中找不到Wi-Fi适配器