我已在 OS X 主机上安装了预构建的 Virtual Box 映像,并启动了它。它运行 Ubuntu 12 和 Tomcat。
在框中,适配器信息仅包含 inet6 地址(请参见下面的屏幕截图)
我似乎看不到主机的运行框。如何使用主机上的网络浏览器访问 8080 端口?
ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 options=3<RXCSUM,TXCSUM> inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff000000 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 nd6 options=1<PERFORMNUD> gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280 stf0: flags=0<> mtu 1280 en0: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500 options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV> ether 3c:07:54:28:be:39 nd6 options=1<PERFORMNUD> media: autoselect (none) status: inactive en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether b8:8d:12:1c:62:2a inet6 fe80::ba8d:12ff:fe1c:622a%en1 prefixlen 64 scopeid 0x5 inet 192.168.178.20 netmask 0xffffff00 broadcast 192.168.178.255 nd6 options=1<PERFORMNUD> media: autoselect status: active fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078 lladdr a4:b1:97:ff:fe:63:2c:18 nd6 options=1<PERFORMNUD> media: autoselect <full-duplex> status: inactive en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500 options=60<TSO4,TSO6> ether d2:00:16:32:c1:80 media: autoselect <full-duplex> status: inactive p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304 ether 0a:8d:12:1c:62:2a media: autoselect status: inactive bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=63<RXCSUM,TXCSUM,TSO4,TSO6> ether 3e:07:54:82:d2:00 Configuration: id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0 maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200 root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0 ipfilter disabled flags 0x2 member: en2 flags=3<LEARNING,DISCOVER> ifmaxaddr 0 port 7 priority 0 path cost 0 nd6 options=1<PERFORMNUD> media: <unknown type> status: inactive vboxnet0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 0a:00:27:00:00:00 vboxnet1: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 0a:00:27:00:00:01
答案1
找到了问题——也许它会对将来的人有所帮助。
我的笔记本没有eth0,只有wifi。我关闭虚拟机并将桥接设置更改为 wifi,然后它就可以工作并且我可以在内部访问 IP 地址。
从虚拟机内部