Details of the XenServer kernel module compilation process

  • 2020-06-03 09:00:04
  • OfStack

Citrix provides DDK(Driver Development Kit) to support building custom kernel modules or hardware drivers in XenServer. DDK is a virtual machine image in OVA format that contains kernel header files and compiler development tools.

Here are the steps for building a kernel module using DDK.

First of all, from the official download version DDK accordingly, here to choose 6.5: http: / / downloadns citrix. com. edgesuite. net / 10106 / XenServer - 6.5.0 - DDK. iso

Upload the downloaded ISO file to the XenServer host

Mount ISO

mkdir /mnt/tmp
mount <path_to_DDK>/ddk.iso /mnt/tmp -o loop

Create the virtual machine using the DDK image

xe vm-import filename=/mnt/tmp/ova.xml
xe vm-import  The command is created with the image 1 A virtual machine, and will output the virtual machine UUID , such as :

[root@xenserver-iryatlxz ~]# xe vm-import filename=/mnt/tmp/ddk/ova.xml

Next, find the network UUID associated with eth0. First list all the networks:

xe network-list

The output is as follows:

uuid ( RO)        : e0f9ba3d-f27b-7380-413a-0491db9e0ec4
     name-label ( RW): Pool-wide network associated with eth1
  name-description ( RW):
       bridge ( RO): xenbr1

uuid ( RO)        : 46fb28dd-4c35-5755-160b-f6389e09c54a
     name-label ( RW): Pool-wide network associated with eth0
  name-description ( RW):
       bridge ( RO): xenbr0

uuid ( RO)        : 0ecf8369-5469-1327-2195-f3cc28a1b3bd
     name-label ( RW): Host internal management network
  name-description ( RW): Network on which guests will be assigned a private link-local IP address which can be used to talk XenAPI
       bridge ( RO): xenapi

The network UUID associated with eth0 can be found from it, as follows:


Create a virtual interface using the network UUID and virtual machine UUID obtained above:

xe vif-create network-uuid=46fb28dd-4c35-5755-160b-f6389e09c54a vm-uuid=69a2356e-5f7f-0fd8-a609-234a28b59fc5 device=0

Start virtual machine

xe vm-start uuid=69a2356e-5f7f-0fd8-a609-234a28b59fc5

The DDK virtual machine can be accessed using XenCenter's console or directly from the command line using xenconsole.

The steps for using xenconsole access are as follows:

Get domain ID

[root@xenserver-iryatlxz ~]# xe vm-list params=dom-id uuid=69a2356e-5f7f-0fd8-a609-234a28b59fc5 --minimal
Connect the virtual machine from console usr/lib64 / xen/bin/xenconsole 14

Once logged in to DDK VM, you can build custom kernel modules or hardware drivers in that virtual machine. The kernel development kit in the/usr src/kernels / 3.10.0 + 2 - x86_64 /.

To exit, press CTRL-].

Related articles: