怎样链接 NAT 网络的 ubuntu 虚拟机

Kvm、VMware、Virtualbox、Xen、Qemu 等
回复
hurry07
帖子: 6
注册时间: 2010-04-01 23:20

怎样链接 NAT 网络的 ubuntu 虚拟机

#1

帖子 hurry07 » 2010-04-01 23:28

大家好, 新安装了ubuntu 9.10 版本的虚拟机, VMware® Workstation 7.0.1 build-227600,
由于本人是 ADSL 上网, 为了让虚拟机可以上网于是使用了 NAT 方式, 现在情形是 虚拟机可以上网, 但是我从外部使用 ultravnc 联机不上去.

Ethernet adapter VMware Network Adapter VMnet8:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet8
Physical Address. . . . . . . . . : 00-50-56-C0-00-08
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.10.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet1:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for VMnet1
Physical Address. . . . . . . . . : 00-50-56-C0-00-01
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.223.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Ethernet adapter 本地连接:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek RTL8102E/RTL8103E Family PCI-E Fast Ethernet NIC
Physical Address. . . . . . . . . : 00-E0-4C-05-79-06
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.0.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

PPP adapter LT:

在这之前我在ubuntu 上安装了 vnc4server 然后执行了命令 vncserver 按照提示建立了编号为 1 的链接
然后还关系了防火强 sodu ufw disable
我可以ping通 192.168.10.1 和 192.168.223.1, 然后我在 ultravnc 中输入 192.168.10.1: 1 提示链接不上

希望能得到大家帮助.
hurry07
帖子: 6
注册时间: 2010-04-01 23:20

Re: 怎样链接 NAT 网络的 ubuntu 虚拟机

#2

帖子 hurry07 » 2010-04-03 11:51

自己回一个吧 问题搞定了
首先进入虚拟机 然后在终端输入 ifconfig -a 找到它当前的网址,然后回到宿主机器 使用这个地址就可以连接上 就是这么简单
tusheng
帖子: 741
注册时间: 2007-09-18 8:45

Re: 怎样链接 NAT 网络的 ubuntu 虚拟机

#3

帖子 tusheng » 2010-04-04 8:01

呵呵,看来楼主还不明白,vmnet8网卡的ip是主机的,ubuntu用的应该是192.168.10.128之类的ip
hurry07
帖子: 6
注册时间: 2010-04-01 23:20

Re: 怎样链接 NAT 网络的 ubuntu 虚拟机

#4

帖子 hurry07 » 2010-04-05 16:46

这个倒是 知道的 不过我以为它ip分配就是 192.168.10.1 这个样子 于是老是去连接这个 直到有个高手告诉我。。。
回复