Using Virtuozzo, the system hostname is changed on boot when not properly configured on the host server. When this happens, the cPanel license check will see a new hostname and potentially flag the license.
With host access
To set the hostname with Virtuozzo, use the vzctl command on the host node.
(host) # vzctl set $ContainerName --hostname "something.example.com" --save
Without host access
If you are unable to make the change via vzctl from the host node, you can alternatively set the hostname in either the /etc/rc.local if your container is using CentOS 6, or, if you are using CentOS 7, the recommendation is to create a systemd unit file.
**Please note this workaround is not advised and is meant to only be used as a last resort if the host cannot or will not set the hostname from the host for the container.**
You can copy the following to your server and modify the hostname to your desired hostname.
Using your favorite editor, add the following script and modify the $hostname section with the desired hostname.
# nano /etc/systemd/system/hostname.service
# A simple service unit file to set the hostname after vz.
# A startup configurations for systemd.
# By Aaron Horsley
# Licensed under GPL V2
Description=Override the hostname set on boot by VZ
ExecStart=/usr/bin/hostnamectl set-hostname $hostname.domain.tld
# systemctl enable /etc/systemd/system/hostname.service
For CentOS 6, or use of the
rc.localsimply add the following to the end of the file and save
# nano /etc/rc.local
/usr/bin/hostnamectl set-hostname $hostname.domain.tld