I have a postinstall script that runs after my preseed install that checks /proc/cpuinfo for vmx or svm flags and if the server has them, it installs kvm packages. The only problem is due to the install running in a chroot /target directory, there is no /proc/cpuinfo to look at. The "lshw" command doesn't have the goods either. Any thoughts on how this can otherwise be accomplished?
The problem with not having access to /proc is that you don't have any script access to the sysfs calls required to do the check. What you need to do is to make sure your chroot has access to proc.
You can do this by mounting /proc before your chroot using the late pressed command like this:
And also a second option: remounting proc inside the chroot like this:
in fact if it's an installed system,
Another option would be to use the kvm-ok script (or parts of it), that comes in the cpu-checker package. This uses the msr-tools package to query the CPU's MSR registers directly via a