我正在 VM 上运行 Web 应用程序。
我可以localhost:8888在 VM中通过浏览器查看应用程序。
我无法在同一 URL 上看到来自主机的应用程序。这就是目标。
我试过了,VBoxManage modifyvm "VM name" --natdnshostresolver1 on但没有影响。
我的配置是:
(访客)ifconfig在 NAT 上时
kirkland@GC:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:d0:fc:0e
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::4c67:70b5:c37b:8fa8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7431 errors:0 dropped:0 overruns:0 frame:0
TX packets:3587 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7444830 (7.4 MB) TX bytes:731870 (731.8 KB) …Run Code Online (Sandbox Code Playgroud)