【问题标题】:Accessing python SimpleHTTPServer from outside Virtual Box从 Virtual Box 外部访问 python SimpleHTTPServer
【发布时间】:2016-11-15 18:01:23
【问题描述】:

我在一个虚拟盒子里运行一个 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。

标签: python networking localhost virtualbox simplehttpserver


【解决方案1】:

虚拟盒子中的端口转发帮助解决了这个问题。

【讨论】:

    猜你喜欢
    • 2015-07-30
    • 2013-05-08
    • 1970-01-01
    • 2017-02-03
    • 2016-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多