Citrix allows one to build any custom kernel module or hardware driver for XenServer, by offering Driver Development Kit (DDK). A DDK is essentially a virtual machine with all the kernel headers and development tools needed to extend the XenServer kernel. The following guide is on how to use DDK to compile a custom kernel module or hardware driver for XenServer.
In this example, I am going to use the DDK downloadable from Citrix for XenServer 6.0 with Hotfix XS60E003. So you will need to have a XenServer host of the same version. If you just have installed fresh XenServer 6.0, you first need to apply Hotfix XS60E003 to your XenServer in order to use the DDK. Note that the Hotfix XE60E003 has two Hotfix dependencies: XS60E001 and XS60E001. Therefore, apply three Hotfixes one by one in sequence to fresh XenServer 6.0: XS60E001, XS60E002 and XS60E003. Here are the steps.
Download the Hotfixes from the following URLs, and apply these Hotfixes to your XenServer.
$ wget https://support.citrix.com/servlet/KbServlet/download/29185-102-680311/XS60E002.zip
$ wget https://support.citrix.com/servlet/KbServlet/download/29609-102-680420/XS60E003.zip
After applying all three Hotfixes, reboot your XenServer host. Finally, confirm that you are running the following kernel on your updated XenServer:
Now, download DDK for XenServer 6.0 with Hotfix XS60E003:
Upload the DDK iso image to your XenServer host, and then import the uploaded DDK VM as follows.
$ mount <path_to_DDK_ISO>/ddk.iso /mnt/tmp –o loop
$ xe vm-import filename=/mnt/tmp/ddk/ova.xml
The xe vm-import command will print out the UUID of your DDK VM. Make a note of the UUID (noted as <DDK-VM-UUID>).
Now follow the rest of steps below to launch the imported DDK VM.
Find the UUID of the network associated with pool-wide eth0 network by obtaining a list of networks as follows, and make a note of the UUID (noted as <network-UUID>).
Now, create a virtual interface of DDK VM.
Disable VNC of DDK VM:
Start DDK VM:
Retrieve domain ID of the DDK VM:
In this example, the domain ID of the DDK VM is 1. So connect to the VM text console as follows:
Once logging in to DDK VM, you will find the kernel source for your XenServer in /usr/src/kernels/18.104.22.168-0.7.1.xs22.214.171.1241.170662xen-i686/. You can build your own custom kernel module or hardware driver using this kernel source inside DDK VM.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!
Latest posts by Dan Nanni (see all)
- How to install Suricata intrusion detection system on Linux - September 3, 2015
- How to switch from NetworkManager to systemd-networkd on Linux - August 31, 2015
- How to set up a system status page of your infrastructure - August 25, 2015