Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
    

4 Answers 4

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 dhcp11-167.sfeng.home.com 2.6.32.11sf.p4-4 #1 SMP Fri Sep 17 20:22:25 UTC 2010 i686 GNU/Linux –  kamal Oct 10 '10 at 6:05
    
real: Linux bamboo.sd.home.com 2.6.32.11sf.pentM-4 #1 PREEMPT Fri Sep 17 19:50:44 UTC 2010 i686 GNU/Linux –  kamal Oct 10 '10 at 6:06
4  
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

 
discard

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.