最好是将虚拟机和本地机的IP区分开来(不要都是127.0.0.1),Ubuntu可以在etc/network/interface里进行配置上的修改,第一块网卡一般名称为eth0,下面这个是本人Ubuntu上的interface内容:
auto eth0
iface eth0 inet static
address 192.168.1.22
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1
auto eth0,意思是让Linux启动的时候能自动加载这个网卡配置
下面的依次为一些配置信息
如果不是拨号上网的(DNS是固定的),那么还得在etc下的resolv.conf里加入
nameserver 192.168.1.1
(DNS服务器的地址)