VirtualBox 新建虚拟机,挂载以前的虚拟磁盘

以前在windows下搞的虚拟机装的ubuntu server,今天进去突然打不开了,原来的配置文件怎么也找不到了,一直起不来,还好原有的虚拟磁盘还在,新建了一个虚拟机,挂载原来的磁盘,结果网络一直有问题,最终查到原因是新建的虚拟机网络配置和以前不一致
ifconfig 
只有lo网卡
ifconfig -a
显示有网卡lo eth5, eth6
当新建一个虚拟机之后,新的网卡是eth5和eth6,所以导致原有的网络配置eth0,eth1失效 更改配置文件/etc/network/interfaces原有内容
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
#hostonly interface
auto eth1
iface eth1 inet dhcp

改为

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth5
iface eth5 inet dhcp
#hostonly interface
auto eth6
iface eth6 inet dhcp
重启正常。

Published: May 19 2012