Article ID: 118780, created on Nov 20, 2013, last review on May 11, 2014

  • Applies to:
  • Virtuozzo
  • Virtuozzo containers for Linux
  • Virtuozzo hypervisor


By default in the majority of created containers the output of uname -r command matches the output on the host.


Some software checks the output of uname command during installation, which can lead to installation failure if the running kernel does not match the requirements of the software.

The output of uname -r in containers can be defined in the OS template.

It is possible to create a customized template based on the existing one. For example, to change the displayed kernel version in Centos 6 containers, the following steps can be used :

  1. Make a copy of the existing template:

    # mkdir -p /vz/template/centos-customized/6/x86_64/config
    # cp -a /vz/template/centos{,-customized}/6/x86_64/config/os
  2. Create an osrelease file in the template:

    # touch /vz/template/centos-customized/6/x86_64/config/os/default/osrelease
  3. In osrelease file specify the version you want to be displayed in uname -r output of the container:

    # echo "3.2.41" > /vz/template/centos-customized/6/x86_64/config/os/default/osrelease
  4. Create the template cache for the new template:

    # vzpkg create cache centos-customized-6-x86_64
  5. After that in all containers created from the centos-customized-6-x86_64 template the uname output will display the version from osrelease:

    # vzlist -o ctid,ostemplate 104
           104 centos-customized-6-x86_64
    # vzctl exec 104 uname -r

(The stab ending will be added, there is no way to disable it).

Please, note that changing the version to avoid compatibility issues with some application can cause problems with other software.

Search Words


kernel version in containers

uname output in containers

uname -r output in container

d02f9caf3e11b191a38179103495106f 2897d76d56d2010f4e3a28f864d69223 a26b38f94253cdfbf1028d72cf3a498b e8e50b42231236b82df27684e7ec0beb 0dd5b9380c7d4884d77587f3eb0fa8ef

Email subscription for changes to this article
Save as PDF