AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1494457
Accepted
InterLinked
InterLinked
Asked: 2019-10-22 05:36:23 +0800 CST2019-10-22 05:36:23 +0800 CST 2019-10-22 05:36:23 +0800 CST

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

  • 772

我在使用 VirtualBox 时遇到了一个非常奇怪的问题。

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

我在 VirtualBox 中的网络配置是NAT.

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

另一方面,每当我连接到 Wi-Fi 时,从客人那里获得 Internet 连接总是存在问题。

有一次我遇到问题,我打字ipconfig /flushdns,突然事情开始了。从那时起,这还不够。刷新我的 DNS 并不足以使事情在 Wi-Fi 上运行。

我发现强制它工作的唯一方法是进入来宾的 VirtualBox 设置并将网络适配器从 更改NAT为Bridged. 在这一点上,它仍然不起作用。但是,现在如果我输入ipconfig /flushdns(在来宾上),一切都会突然起作用:我可以访问网络。更奇怪的是我现在可以把它改回NAT. 突然,它会停止工作,但是,如果我再做ipconfig /flushdns 一次,它就会工作。

换句话说,我已经绕了一圈,回到了NAT最终有效的连接。开始和结束状态完全相同,所以我很困惑为什么客人无法自行获得网络连接。如果我只需要ipconfig /flushdns在连接到 Wi-Fi 时输入,那将是一回事,但必须退出来宾并将适配器从NATto更改为Bridged然后再返回到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

我提前终止了它,所以输出丢失了,但是在我刷新 DNS 之前 ping 失败:

^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>

我改Bridged回NAT:

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 wireless-networking
  • 1 1 个回答
  • 633 Views

1 个回答

  • Voted
  1. Best Answer
    InterLinked
    2019-11-24T05:30:13+08:002019-11-24T05:30:13+08:00

    正如所暗示的,启用 VirtualBox DNS 解析器是解决方案。

    以下是具体步骤:

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

    <VM name>只是虚拟机的名字,也可以通过运行找到VBoxManage list runningvms。

    • 0

相关问题

  • 来宾运行时主机 MacOS 自动更新后虚拟框 linux 来宾死机

  • Genymotion 如何绕过 VirtualBox 缺乏 Wi-Fi 仿真?

  • Win10 1803:如何让移动热点成为专用网络?

  • virtualbox 是否需要 CPU 来支持 VT-d 以托管 64 位客户操作系统?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    Windows 10 服务称为 AarSvc_70f961。它是什么,我该如何禁用它?

    • 2 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Marko Smith

    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1056)

    • 4 个回答
  • Marko Smith

    我如何知道 Windows 安装在哪个驱动器上?

    • 6 个回答
  • Martin Hope
    Albin 支持结束后如何激活 WindowsXP? 2019-11-18 03:50:17 +0800 CST
  • Martin Hope
    fixer1234 “HTTPS Everywhere”仍然相关吗? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    Kagaratsch Windows 10 删除大量小文件的速度非常慢。有什么办法可以加快速度吗? 2019-09-23 06:05:43 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    Inter Sys Ctrl+C 和 Ctrl+V 是如何工作的? 2019-05-15 02:51:21 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve