Is there any way to tell if the host that a script is running on is a VirtualBox guest VM? Ideally I'm looking for a cross-platform way. I would think this is next to impossible unless, maybe, something in the Guest Additions provides this.
|
feedback
|
|
Did some poking around and under Linux,
And the Windows equivalent (thanks to Andrew Koester for the pointer)
There is a Solaris equivalent, but I can't test it because I only have access to Sparc machines. But, for completeness, here it is: | ||||
|
feedback
|
|
In Windows, you can query for the BIOS information with WMI. http://msdn.microsoft.com/en-us/library/aa394077%28VS.85%29.aspx I don't believe you're going to find a cross-platform solution, at least without going all the way down and reading it directly out of low-level memory. (In this case, you might be interested in the source code to dmidecode) | |||
|
feedback
|
