2016-11-15 105 views
0

我在虛擬框中運行python SimpleHTTPServer。可以從主機訪問它嗎? 在我的主機上運行ipconfig給了我下面的地址。我試圖在我的主機瀏覽器中使用它,但似乎沒有工作。 我應該看看不同的IP地址嗎?從外部訪問python SimpleHTTPServer虛擬框

$> 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 . . . . . . . . . : 
+0

確保你使用正確的端口 – njzk2

+0

你需要在虛擬機配置中使用橋接adaper(可能)...然後使用該ip地址... –

+0

@ njzk2我正在使用8000,默認打開它。那是對的嗎? –

回答

0

虛擬盒子中的端口轉發幫助解決了這個問題。