[vbox-dev] vm detection

Frank Mehnert Frank.Mehnert at Sun.COM
Sat Jan 2 18:15:46 GMT 2010


Stéphane,

On Wednesday 30 December 2009, Stéphane Charette wrote:
> On Wed, Dec 30, 2009 at 12:09, Larry Finger <Larry.Finger at lwfinger.net> 
wrote:
> > For my edification, why does it matter?
>
> Some extra installation steps we have to run when our appliance is
> deployed in a virtual environment.  I was hoping to have a single
> easy-to-run check which can help determine between native and
> virtualized environments.
>
> Unless someone has an easier solution, I've decided to run
> /usr/sbin/dmidecode and grep for certain keywords to tell the
> difference.  There are two problems I know about with doing it this
> way:
>
> 1) greping for text strings isn't as "deterministic" as I'd like it to
> be; running some instructions or calling some sort of API (if such a
> solution existed) would make me feel a bit better
>
> 2) vboxmanage can be used to customize the dmi strings, meaning that
> "innotek GmgH" and "VirtualBox" may not even appear in the dmidecode
> output; in my opinion, this solution is about on-par with checking the
> organizational unique identifier in the MAC address

Correct, dmidecode isn't the ideal solution, the information can
be faked. Why not using 'lspci -d  80ee:beef'? That PCI is always
present if the VM is running under VirtualBox. Of course this ID
will eventually change but I don't have a better idea at the moment.

Kind regards,

Frank
-- 
Dr.-Ing. Frank Mehnert

Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, 85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100102/870750cd/attachment.sig>


More information about the vbox-dev mailing list