Linux neon sign
Image: christitzeimaging.com/Shutterstock

Since CentOS kind of went off the rails over a year ago, some admins and companies have been searching for a replacement. Many hopped onto the AlmaLinux train, while others opted to go with Rocky Linux. Both are absolutely outstanding distributions that should be worth your attention and time.

But there are other alternatives, one of which has actually been around for some time. That alternative is Virtuozzo Linux (also known as VzLinux), which is free to download and use. It’s 1:1 binary compatible with Red Hat Enterprise Linux (RHEL), and offers three different versions that are optimized for running containers, virtual environments or bare metal. VzLinux behaves very much like the CentOS you’ve known and loved (only without the GUI).

But VzLinux also includes a handy trick that could possibly make the lives of admins and companies a bit easier. This trick makes VzLinux a sort of chameleon.

Let me explain.

SEE: Checklist: How to manage your backups (TechRepublic Premium)

There are certain tools out there (such as cPanel) that only support specific distributions. When you run into such a piece of software, and you’re using a distribution it won’t install on (such as CentOS Stream), you’re out of luck. That software simply will not install.

That’s where VzLinux has a bit of an advantage. With the help of a built-in command, you can mask VzLinux to present itself as another OS (such as CentOS or RHEL). What that command does is rewrite the /etc/os-release file such that it reads to third-party software as if it’s a completely different OS.

Let me show you how to use this tool.

What you’ll need

In order to work with chameleon mode, you’ll need a running instance of VzLinux (such as VzLinux 8 or VzLinux 9) and access to the root user account (or a user with sudo privileges). That’s it. Let’s get masking.

How to enable chameleon mode

Log into your running instance of VzLinux as either the root user or a user with sudo privileges. Let’s say you want to install a piece of software that will only install on RHEL. By default, VzLinux presents as VzLinux, so the os-release file might read:

NAME=”Virtuozzo Linux”
VERSION=”9″
ID=”virtuozzo”
ID_LIKE=”rhel fedora”
VERSION_ID=”9″
PLATFORM_ID=”platform:el9″
PRETTY_NAME=”Virtuozzo Linux”
ANSI_COLOR=”0;31″
CPE_NAME=”cpe:/o:virtuozzoproject:vzlinux:9″
HOME_URL=”https://www.vzlinux.org”
BUG_REPORT_URL=”https://bugs.openvz.org”

So let’s enable chameleon mode and set it to RHEL. For that, you’d issue the command:

vz-chameleon-distro --enable rhel

The command will complete almost instantly. To check the results, issue the command:

cat /etc/os-release

You should now see the os-release file reads something like this:

VERSION=”9″
ID=”rhel”
ID_LIKE=”fedora”
VERSION_ID=”9.0″
PLATFORM_ID=”platform:el8″
PRETTY_NAME=”Red Hat Enterprise Linux 9.0 (Ootpa)”
ANSI_COLOR=”0;31″
CPE_NAME=”cpe:/o:redhat:enterprise_linux:9.0:GA”
HOME_URL=”https://www.redhat.com/”
BUG_REPORT_URL=”https://bugzilla.redhat.com/”
REDHAT_BUGZILLA_PRODUCT=”Red Hat Enterprise Linux 9″
REDHAT_BUGZILLA_PRODUCT_VERSION=9.0
REDHAT_SUPPORT_PRODUCT=”Red Hat Enterprise Linux”
REDHAT_SUPPORT_PRODUCT_VERSION=”9.0″

You could change that to CentOS with the command:

vz-chameleon-distro --enable centos

Or, you could change it back to VzLinux by disabling chameleon mode with the command:

vz-chameleon-distro --disable

And that’s all there is to masking VzLinux as a different distribution. If you run into a situation where you either need a distribution capable of masking itself as another, this might well be what you’re looking for. Is this an addition that will have you jumping ship from your current Linux server distro? Probably not. But if you’re looking for an alternative that can present itself as alternatives, this is a great place to start.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.

 

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays