出现这个问题有两种原因:
- 虚拟机设置中没有添加对应的网卡
- 更改了虚拟机中网卡的MAC,但是Debian 的缓存中将eth0与上次的MAC对应
解决方法:
这里仅就第二种问题提出解决方案:
删除/etc/udev/rules.d/70-persistent-net.rules,然后重新启动虚拟机。
参考:
http://askubuntu.com/questions/9375/new-mac-address-now-i-have-no-network-access
https://forums.virtualbox.org/viewtopic.php?f=7&t=43090
Since your mac address have changed you no longer have an interface called eth0, this name is reserved for an interface with the "old" mac-address. The "new" interface should have the next free name (eg. ethN).
each time you give a new MAC address (in VBox guest settings) Debian and Ubuntu guests udev assigns a new eth number
edit /etc/udev/rules.d/70-persistent-net.rules or delete the file: it will be recreated @ next boot