从主机中的客户端连接到VM中的Web Service [英] Connecting to Web Service in VM from client in host

查看:193
本文介绍了从主机中的客户端连接到VM中的Web Service的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows 7作为主机的VirtualBox中运行Ubuntu 10.10.我有一个Java Web Service,已将其部署到Ubuntu中的Glassfish3服务器上,并且希望能够从主机访问它,根据VBox文档,我应该端口转发端口8080,这是我的客户端应用程序连接到的端口.我的主人.为此,我在Windows VBoxManage modifyvm Ubuntu --natpf1 glassfish,tcp,,8080,,8080中执行以下命令,该命令应将主机8080端口转发到我的VM的8080端口,但是当我尝试访问它时似乎不起作用.有什么想法吗?

I'm running Ubuntu 10.10 in VirtualBox with Windows 7 as host. I have a java Web Service which I deploy onto a Glassfish3 server in Ubuntu and I want to be able to reach it from the host, according to the VBox documentation I should port forward port 8080 which is the port that my client application connects to on my host. To do this I do the following command in Windows VBoxManage modifyvm Ubuntu --natpf1 glassfish,tcp,,8080,,8080 which should forward my hosts 8080 port to my VM's 8080 port, but it doesn't seem to work when I try to reach it. Any ideas?

推荐答案

确保Windows中的某些其他进程尚未使用8080.从Ubuntu内的ISO安装来宾添加.确保您使用NAT作为网络选项.确保Ubuntu中的防火墙不会阻止传入的请求.

Ensure 8080 is not already used by some other process in Windows. Install Guest Additions from the ISO inside Ubuntu. Ensure you are using NAT as the option for networking. Ensure the firewall in Ubuntu does not block incoming requests.

这篇关于从主机中的客户端连接到VM中的Web Service的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆