Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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:

d-i preseed/late_command string chroot /target; mount proc /proc -t proc;

And also a second option: remounting proc inside the chroot like this:

mount proc /proc -t proc

in fact if it's an installed system, mount /proc alone would work.

share|improve this answer

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 /dev node. So that trades needing /proc for needed /dev. :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.