从虚拟机外部访问python SimpleHTTPServer

2024-04-26 20:39:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我在一个虚拟的盒子里运行一个pythonsimplehttpserver。可以从主机访问它吗? 在主机上运行ipconfig给了我以下地址。我尝试在我的主机浏览器中使用这个,但似乎不起作用。 我应该看另一个IP地址吗?在

  $> ipconfig

    Windows IP Configuration


    Ethernet adapter Ethernet 2:

       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :

    Ethernet adapter VirtualBox Host-Only Network #2:

       Connection-specific DNS Suffix  . :
       Link-local IPv6 Address . . . . . : xx:xx:xx:xxxx:xxx:xxxx
       IPv4 Address. . . . . . . . . . . : 192.168.99.1
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . :

Tags: adapteraddressdns地址浏览器connectionmediasuffix