Server Fault is a question and answer site for system and network administrators. 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

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.

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
virtual:Linux #1 SMP Fri Sep 17 20:22:25 UTC 2010 i686 GNU/Linux – kamal Oct 10 '10 at 6:05
real: Linux #1 PREEMPT Fri Sep 17 19:50:44 UTC 2010 i686 GNU/Linux – kamal Oct 10 '10 at 6:06
uname -a certainly won't give you any help if it's running on a VMware server. – EEAA Oct 10 '10 at 14:54
the clue with a vmsserver , is that it will be down ;-) – The Unix Janitor Oct 14 '10 at 8:37

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).

share|improve this answer

I usually use

dmidecode --type 1

For scripting you might try

dmidecode -s system-manufacturer
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.