cloudvirtual-machinevirtualizationxenhypervisor

How can I install and compile xen from the source code?


I want to modify live migration code of Xen. I can only install it using Apt package management. However, I want to install it using source code to be able to compile it after modification. Which steps should I follow to do that?


Solution

  • First, you need to clone XEN repository:

    $ git clone git://xenbits.xen.org/xen.git
    

    Go to dir

    $ cd xen
    

    Switch git branch to the latest version:

    $ git checkout stable-4.11
    

    Or choose which one is needed for you:

    $ git branch -av
    

    To build all components (hypervisor, tools, etc) use dist target:

    $ make dist
    

    If you wish to just (re)build a single component you can use the appropriate dist-COMPONENT target:

    $ make dist-xen
    $ make dist-tools
    $ make dist-docs
    .....etc.....
    

    If your host machine and target machine are different you can use cross compiler to build it:

    $ make dist-xen XEN_TARGET_ARCH=<target_arch> CROSS_COMPILE=<path_to_compiler>
    

    If you build for ARM platform you can take one which provided by Linaro:

    https://releases.linaro.org/components/toolchain/binaries/latest/

    A lot of good information exists on XEN wiki:

    https://wiki.xen.org/wiki/Help:Contents