2

How would know at command line that the Linux host i logged in to is real machine, with linux installed, or is a virtual machine Thanks, -Kamal.

EEAA
  • 109,363
  • 18
  • 175
  • 245
kamal
  • 509
  • 4
  • 10
  • 21
  • possible duplicate of [VMware Linux Server -- how can you tell if you are a vm or real hardware?](http://serverfault.com/questions/65718/vmware-linux-server-how-can-you-tell-if-you-are-a-vm-or-real-hardware) – EEAA Oct 10 '10 at 14:52

4 Answers4

7

Try the 'lspci' command; on a virtual machine you'll typically see a bunch of devices that are obviously virtual (e.g. vendor is VMWare or such).

janneb
  • 3,841
  • 19
  • 22
3

imvirt, virt-what or facter

ptman
  • 28,394
  • 2
  • 30
  • 45
3

I usually use

dmidecode --type 1

For scripting you might try

dmidecode -s system-manufacturer
Cakemox
  • 25,209
  • 6
  • 44
  • 67
0

Often uname -a will display information that gives you a hint - references to Xen will tell you that you are in that type of virtual machine.

Paul McMillan
  • 1,219
  • 1
  • 8
  • 17