ubuntu - 虚拟机中的服务如何从外部访问?
伊谢尔伦
伊谢尔伦 2017-04-21 10:55:35
0
2
445

在virtualbox中安装无图形界面的ubuntu,启动一个rails项目rails s,显示访问url为http://0.0.0.0:3000

使用ifconfig查看其eth0 inet addr为10.0.2.15,在外部系统的浏览器中访问http://10.0.2.15:3000却不能打开网页,如何访问?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
左手右手慢动作

You need to set up the network or port mapping of the virtual machine.
After setting up the network, you can access the virtual machine through IP. You can refer to http://www.douban.com/group/topic/15558388/
If you set up port mapping, you can map a port on the host to a port on the virtual machine, so that you can access the virtual machine's services using localhost: port number. You can refer to http://sjsky.iteye.com/blog/909610 http://hi.baidu.com/quqvgmgbexbdgod/item/91da255f724d9d09e7c4a56d

In addition, it is recommended to use Vagrant. These settings have official documents for reference, which is very convenient.

黄舟

Create a host-only connection for the new virtual machine; then access its IP, such as 192.168.56.101.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template