方法:
- 在VMWare中的Setting中,将Network Adapter选择NAT。
- 在Windows中,右击我的电脑,选择“管理”,打开服务“VMWare DHCP”和“VMWare NAT”两个服务。
- 重启系统,重新开机后就能够上网了。如果重启,可以在Timinal中输入命令>>sudo dhclient (重新获取IP地址)
另外,如果每次都需要输命令获取IP的话,可以做一下修改:
将 /etc/network/interfaces /etc/network/interfaces文件修改为如下:# The loopback network interfaceauto loiface lo inet loopback# The primary network interfaceauto eth0iface eth0 inet dhcp修改后重启系统即可,为了避免错误,请在修改前备份interface文件。