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

I have Linux, AIX, SunOs & HP-UX machines, I want to detect if the machine is virtual or not. So far I found this article which helped me get this information on Linux:

dmesg | grep -i virtual    //On Linux Machines

But I also need commands for AIX, HP-UX & SunOs. Any help?

share|improve this question
That dmesg Linux trick only works if the kernel buffer that holds dmesg messages hasn't been overwritten by more recent messages. If you do any kind of iptables logging, those log messages will wipe out your dmesg boot messages fairly quickly. Some systems save the initial dmesg output under /var/log/ and you might find it there. – Ian D. Allen Aug 4 '15 at 14:14

Try Correct me if I'm mistaken, but I think Red Hat uses this in their Satellite to detect and group virtualized systems.

share|improve this answer
Only since RHEL 5.7, just a side-note. – mveroone Jan 9 '14 at 9:17

The definition of 'virtual' is too loose. If we assume that for AIX you mean any AIX image which is an LPAR (or a micro-partition, or any other terminology IBM chooses) then you can use uname -L, for example,

nonlpar# umame -L

lparhost# uname -L
5 lparhost

If you mean WPAR, you can use uname -W and a result of 0 means you're not in a WPAR, a result of anything higher than 0 is a WPAR.

If you mean, does the AIX instance rely on a VIO server, then there's no solid reliable mechanism for knowing that other than looking at the devices and working out if they're presented via VIO servers.

It's worth remembering that for pSeries hardware running AIX, just about everything these days is an LPAR, and so essentially virtual, even if it's the only OS instance using the hardware.

share|improve this answer

In HP-UX there are different level of virtualization and different command to know if your system is virtualized.

  1. Integrity Virtual Machine Guest

    If you execute the following command in a IVM Guest you obtain:

     # hpvminfo 
     hpvminfo: Running inside an HPVM guest.

    If you execute the following command in a NO "IVM Guest" you obtain:

     # hpvminfo 
     hpvminfo: Running inside an HPVM host.

    or # hpvminfo sh: hpvminfo: not found.

  2. HP Virtual Partition

    If you execute the following command in a vpar you obtain:

     # hpvminfo 
     hpvminfo: Running inside an HPVM guest.
     # vparstatus -w
     The current virtual partition is <VPAR NAME>.

    If you execute the following command in a NO vpar you obtain:

     # vparstatus 
     sh: vparstatus:  not found.
share|improve this answer

Is it possible that virtual machines produce "fishy" cpu info?

In Aix try using lscfg on a known virtual machine and you may be able to find that the CPU information hints that the computer is virtual. This will largely contingent on the virtualizer, but its worth a go.

share|improve this answer

For an x86 virtual machine, simply run a program that invokes the official mechanisms for detecting x86 virtual machines. I'd provide examples, but I don't know any off the top of my head. I use my own tools. Thomas Liske's imvirt shows promise according to its doco, but I haven't used it or seen the source code.

Whether this also applies to your SunOS machines depends from whether that is x86 Solaris or truly SunOS. ☺ Detecting the existence of a virtual machine involves stuff that is specific to the processor instruction set architecture, not to the operating system. So "I have AIX and HP/UX machines." is less useful than, say, "I have PowerPC and Itanium machines.".

share|improve this answer
Any examples, i dont know much about virtualization – Abhishek Simon Nov 21 '11 at 9:03

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.