chiark / gitweb /
detect-virt: detect User-Mode Linux
authorRamkumar Ramachandra <artagnon@gmail.com>
Tue, 16 Jul 2013 11:14:40 +0000 (16:44 +0530)
committerLennart Poettering <lennart@poettering.net>
Tue, 16 Jul 2013 12:27:53 +0000 (14:27 +0200)
commit7080ea16b5a0bfd71bfcdffc998e91f5273d47f9
tree33c7f57db6479096bd0971308422ef902a526c92
parent36c0868b67a9387d39c97983d3d22cfce0fedc62
detect-virt: detect User-Mode Linux

In a User-Mode Linux session:

  $ systemd-detect-virt
  none

Although it is possible to reliably detect virtualization:

  $ cat /proc/cpuinfo
  processor       : 0
  vendor_id       : User Mode Linux
  model name      : UML
  mode            : skas
  host            : Linux kytes 3.11.0-rc1-00009-ge5fd680 (...)
  bogomips        : 7007.43

So, grep for the string "\nvendor_id\t: User Mode Linux\n" in
/proc/cpuinfo, and say "uml" when asked.
man/systemd-detect-virt.xml
man/systemd.unit.xml
src/shared/virt.c