Chinmay
Chinmay

Reputation: 4882

Virtual Machine or Host?

Is there a way to find out if the (linux) system that I'm logging into is a host or a VM? Any symptoms that I can look at via the shell or any other utility (of a VM)?

Upvotes: 1

Views: 163

Answers (3)

vpillai
vpillai

Reputation: 473

you can use the perl module Sys::Detect::Virtualization here

use Sys::Detect::Virtualization;

my $detector = eval { Sys::Detect::Virtualization->new() };
if( $@ ) {
    print "Detector may not be supported for your platform.  Error was: $@\n";
}

my @found = $detector->detect();
if( @found ) {
    print "Possible virtualized system.  May be running under:\n";
    print "\t$_\n" for @found;
}

Upvotes: 0

umläute
umläute

Reputation: 31274

there's a number if scripts available, that try to detect the presence of virtualisation. e.g. virt-what, but i guess there is no generic solution for your problem.

Upvotes: 1

Saddam Abu Ghaida
Saddam Abu Ghaida

Reputation: 6729

You can check the Drivers which has been loaded incase of full Virtualization environemnt such as VMware. using lspci,lsmod, ... etc. or you can use dmesg to get this kind of information.

Upvotes: 1

Related Questions