08-26-2019, 07:30 AM
@deanhills
virt-what is just a shell script that puts all the relevant tests/checks at one place. It either purses the output of commands like dmidecode, cpuid, uname -p or tests for the existance of files/directories (usually inside /sys file system) that always exist on certain virtualized systems or the output of cat /proc/cpuinfo. if you want to find out their version, like here we want to know openvz version then i guess there is no other way than finding out the kernel version. so congrats.
Also you need to do it manually as you did.
hostnamectl status,dmesg, lshw, lspci, hwinfo, lscpu etc are commands whose outputs are useful other ways to determine this. But the thing is they are often restricted on such systems, thus not producing the relevant output (which is why i never saw them in virt-what source).
using cat on /some files in /proc (like cpuinfo) or device files under /sys may be other ways to uncover the virtual environment through the manufacturer info for virtual devices.
Knowing multiple ways is beneficial here. You dont know which ones will work.
There are ways to make host report to guest wrong info. Though i doubt any webhost will stoop that far. haha
so to reiterate, for openvz version, our main aids are...
uname -r and uname -v for kernel version and release date.
cat /proc/version will show them too.
rpm -q kernel
or,
dpkg -l | grep kernel
will always show kernel package not installed inside guest, as is expected.
So basically yes. you did it. Thats the way.
virt-what is just a shell script that puts all the relevant tests/checks at one place. It either purses the output of commands like dmidecode, cpuid, uname -p or tests for the existance of files/directories (usually inside /sys file system) that always exist on certain virtualized systems or the output of cat /proc/cpuinfo. if you want to find out their version, like here we want to know openvz version then i guess there is no other way than finding out the kernel version. so congrats.
Also you need to do it manually as you did.
hostnamectl status,dmesg, lshw, lspci, hwinfo, lscpu etc are commands whose outputs are useful other ways to determine this. But the thing is they are often restricted on such systems, thus not producing the relevant output (which is why i never saw them in virt-what source).
using cat on /some files in /proc (like cpuinfo) or device files under /sys may be other ways to uncover the virtual environment through the manufacturer info for virtual devices.
Knowing multiple ways is beneficial here. You dont know which ones will work.
There are ways to make host report to guest wrong info. Though i doubt any webhost will stoop that far. haha
so to reiterate, for openvz version, our main aids are...
uname -r and uname -v for kernel version and release date.
cat /proc/version will show them too.
rpm -q kernel
or,
dpkg -l | grep kernel
will always show kernel package not installed inside guest, as is expected.
So basically yes. you did it. Thats the way.
Sincere Thanks to VirMach for my VPS9. Also many thanks to Shadow Hosting and cubedata for the experiences I had with their VPSs.