从虚拟机外部访问python SimpleHTTPServer

从虚拟机外部访问python SimpleHTTPServer,python,networking,localhost,virtualbox,simplehttpserver,Python,Networking,Localhost,Virtualbox,Simplehttpserver,我正在虚拟机中运行python SimpleHTTPServer。是否可以从主机访问它? 在我的主机中运行ipconfig给了我以下地址。我尝试在主机的浏览器中使用此功能,但似乎不起作用。 我应该看一个不同的IP地址吗 $> ipconfig Windows IP Configuration Ethernet adapter Ethernet 2: Media State . . . . . . . . . . . : Media disconne

我正在虚拟机中运行python SimpleHTTPServer。是否可以从主机访问它? 在我的主机中运行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 . . . . . . . . . :

虚拟箱中的端口转发有助于解决此问题。

确保使用正确的端口您需要在vm配置中使用桥接适配器(可能)。。。然后使用该ip地址…@njzk2我使用的是8000,它打开时的默认地址。对吗?172.0.0.1:8000或0.0.0.0:800@JoranBeasley我试过了。没用!另一个问题是,它不允许我访问虚拟盒内的wi-fi。