KVM Network Interface not Detected on VM Clone – Work Around

By | March 19, 2012

So, I had this KVM VM server setup on a Debian machine. When I clone a linux based machine, I didn’t find the network interface on the newly cloned machine as a result I couldn’t connect to the network. On googling for a while I found a work around that should fix the problem. The process mentioned below worked for me, but, I don’t guarentee any success for you. You should follow the instructions on your own risk.

Update: Mar 2013. Quick work around.

mv /etc/udev/rules.d/70-persistent-net.rules /home/

reboot

Now the network should come up.!

1: So, let me talk about the scenario first. When I say, ifconfig, I don’t find any NIC interfaces on my system. Here is a sample output I got on my server.

root@myserver:/etc# ifconfig

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 B) TX bytes:560 (560.0 B)

2: My frist virtual machine has eth0 interface and so I chekec if it was active. Unfortunately, I didn’t find it.

root@myserver:/etc# ifconfig eth0
eth0: error fetching interface information: Device not found

3: So, I just googled the same problem and I found that the interface of a virtual machine can be changed from eth0 to eth1 when it is cloned. So, I just checked if there was eth1. Forunately for me, it was there. Because the mac of the old interface to changed to new mac, the name of the interface got changed too, and that was just my understading.

root@dmyserver:/etc# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:16:36:9f:1a:17
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:11

4: Now, I changed the /etc/network/interfaces. I replaced eth0 with eth1. Rename
the interface from eth1 to eth2 if you clone virtual machine that has
eth1 interface.

5: Now, I brought down the eth1 interface and brought it back.

root@myserver:/etc# ifdown eth1
ifdown: interface eth1 not configured
root@dhcp-172-2-9:/etc# ifup eth1

6: And when I said ifconfig, I have my interface (eth1, this time) back live.

eth1 Link encap:Ethernet HWaddr 00:16:36:9f:1a:17
inet addr:172.16.1.15 Bcast:172.16.1.255 Mask:255.255.255.0
inet6 addr: fe80::216:36ff:fe9f:1a17/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:340 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:28385 (27.7 KiB) TX bytes:1256 (1.2 KiB)
Interrupt:11

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 B) TX bytes:560 (560.0 B)

Do let me know if you still have any problem.

If you like this article, then please consider sharing it. Sharing really inspires us to do things much better!!

Leave a Reply

Your email address will not be published. Required fields are marked *