记录日常工作关于系统运维,虚拟化云计算,数据库,网络安全等各方面问题。

Compiling the Realtek RTL8111 driver on XenServer

I have been using Citrix XenServer for a short while now and it has become my virtual(is/iz)ation solution of choice.
Things were going great until I started to have problems after upgrading… It seems my onboard Realtek network interface (Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)) was not officially supported in XenServers HCL and became subjected to known driver problems.

RX packets:97840 errors:0 dropped:1203654335 overruns:0 frame:0

Although the network interface is still usable, as you can imagine – things are incredibly slow… especially if you rely on Remote Desktops/VNC/Terminal Services etc…
The solution was to use the Citrix XenServer Driver Development Kit (DDK) to compile the kernel module for the network interface card.

First we need to download the DDK VM, burn it to disk and then import it using XenCenter (this may seem an odd way of deploying a virtual machine – and although you could equally add the ISO to a CIFS or NFS ISO Storage Repository, It is always handy to have this ISO on a CD just in case).

Using XenCenter, you then need to import the DDK VM (Templates > Import Template… > Import type: Exported VM). When you browse the DDK CD, you need to select ‘XenServer Virtual Appliance Version 1 (ova.xml)’ and then you can set up a network interface, CPU(s) and memory for the Virtual Machine.

Once the DDK VM is up and running, you can use XenCenter to access its Console.

NOTE: Check the Realtek Drivers page for the latest version before proceeding.

wget ftp://WebUser:2mG8dBW@202.134.71.22/cn/nic/r8168-8.016.00.tar.bz2
tar vjxf r8168-8.016.00.tar.bz2
cd r8168-8.016.00
./autorun.sh

Using the autorun.sh script makes the compiling of the driver nice and easy but it does install the driver into the DDK VM root, so now we simply copy the driver for use in our XenServer installation.

NOTE: The following assumes that the kernel release is the same on both the XenServer and the DDK VM. Please replace ’192.168.1.1′ with your own XenServer IP address.

scp /lib/modules/$(uname -r)/kernel/drivers/net/r8168.ko 192.168.1.1:/lib/modules/$(uname -r)/kernel/drivers/net/

Next we can use XenCenter to access the XenServer Console and prepare the system to use the new driver.

cd /lib/modules/$(uname -r)/kernel/drivers/net/
mv r8169.ko r8169.ko.bak
insmod r8168.ko
depmod -a

Next we can edit /etc/modprobe.conf and change any reference of r8169 to r8168.

alias eth0 r8168

Everything is now ready to go, you need to reboot your XenServer for changes to take effect.




转载请标明出处【Compiling the Realtek RTL8111 driver on XenServer】。

《www.micoder.cc》 虚拟化云计算,系统运维,安全技术服务.

网站已经关闭评论