Access Tomcat localhost:8080 of guest VirtualBox V

2020-07-05 06:26发布

I have an XP laptop on which I am running an Ubuntu distro inside VirtualBox which is running a website via Tomcat. When I am in the VM I can access the site with localhost:8080/

What I really need to do, though, is to access the VM localhost from XP. vm-computer-name:8080/ isn't recognized.

Any help is much appreciated.

4条回答
霸刀☆藐视天下
2楼-- · 2020-07-05 07:07

Type the following command on VM and then try.

sudo iptables -F

查看更多
三岁会撩人
3楼-- · 2020-07-05 07:16

Setup your VM to run a host-only network, then reboot or restart networking to update DHCP. The IP address on the guest will now be accessible from the host.

You can also use bridged network mode, but that won't work when the host is disconnected from the network.

查看更多
我命由我不由天
4楼-- · 2020-07-05 07:20

Get the IP Address of your guest OS and access it via that.

查看更多
老娘就宠你
5楼-- · 2020-07-05 07:25

The following helped me after a new VM and tomcat installation.

Get the IP address of the Guest OS and the port number on which tomcat was started. Then you can access it via:

IP:Port/

In case you are not able to access it still or if you get no response, try

sudo iptables -F

This would flush the tables and would reflect the new mapping. You would need to do this only once though.

查看更多
登录 后发表回答