Linux – Device eth0 does not seem to be present on new kernel with virtualization modules loaded/compiled on kernel 3.15.6

centoscentos6hyper-vlinuxnetworking

cat /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5D:02:14:22", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

and

ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisk noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00: brd 00:00:00:00:00:00

and

cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
HWADDR=00:15:5D:02:14:22
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp

I keep getting this error Device eth0 does not seem to be present.

This is on a Hyper-V machine and I have the latest integration services installed as well. The HWADDR matches what I have setup for the Hyper-V machine.

EDIT:
I compiled and booted into the kernel 3.15.6 and I enabled the KVM/XEN support in the kernel. Could the problem be with enabling these options? I loaded the config from the default CentOs 6.5 kernel so everything boots fine but no network.

If I boot the default 2.6.32 kernel, eth0 comes back.

What do I need to do?

I enabled these options:
Under Processor type and features–>Linux guest support:

--- Linux guest support
[*]   Enable paravirtualization code
[ ]     paravirt-ops debugging (NEW)
[*]     Paravirtualization layer for spinlocks
[*]     Xen guest support (NEW)
[*]   KVM Guest support (including kvmclock) (NEW)
[ ]     Enable debug information for KVM Guests in debugfs (NEW)
[*]   Paravirtual steal time accounting (NEW)

Under Virtualization:

--- Virtualization
<M>   Kernel-based Virtual Machine (KVM) support
<M>     KVM for Intel processors support
<M>     KVM for AMD processors support
[*]     KVM legacy PCI device assignment support
<M>   Host kernel accelerator for virtio net

Best Answer

Your virtual NIC is entirely missing. Since you said you compiled your own kernel, I think it most likely that you forgot to include the Hyper-V paravirtual drivers. You're using Hyper-V, not KVM, so those options for KVM and Xen are irrelevant.

Specifically, you are looking for CONFIG_HYPERV_NET for the Hyper-V virtual network interface. You may also want to include the rest of the Hyper-V drivers for SCSI disks, dynamic memory, etc.

On my own 3.15.6 system I have:

CONFIG_HYPERV_STORAGE=m
CONFIG_HYPERV_NET=m
CONFIG_HYPERV_KEYBOARD=m
CONFIG_FB_HYPERV=m
CONFIG_HID_HYPERV_MOUSE=m
CONFIG_HYPERV=m
CONFIG_HYPERV_UTILS=m
CONFIG_HYPERV_BALLOON=m
Related Topic