-
-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for Virtual Machine #648
Comments
Well the majority of the device names would be having some sort of names that relate to your virtual machine , e.g in my vm currently right now it shows :
This is from |
@BilalAM Thanks, So basically this means identifying all the possible VM Technologies which I can expect. VirtualBox, VMWare, vSphere. Thanks. |
Maybe it would be an idea to add this kind of method to the library ?
|
Umm..I don't know If it can identify the other VM technologies like VMWare and so on , you have to check that out but in my opinion it would be the same as virtualBox. |
Checking You can also try to look for MAC addresses that are used with VMs, but these can be spoofed. I'm not sure there's a foolproof method, at best OSHI could do an |
There are a couple of projects on Github that can do this by analyzing processes, device names, directories, etc... All of them require an amount of guesswork and can be inconclusive. I like this feature, but I think it's too complex of a task to do as well as the already existing projects. A library on top of OSHI would be the best place for this feature, especially since it would need to be constantly updated as new versions of virtualization systems are released. |
Looks like there's a |
Here's a perl module that tries to guess, but it looks like mostly text-matching output against a list. Bottom line.... it looks like nothing is foolproof, there are already many other packages/programs that attempt to do it, and OSHI already provides enough output (Firmware/Baseboard model/manufacturer, System serial number, Network interface MAC addresses, etc.) that let the user likely be able to guess. I wouldn't be opposed to adding methods to the |
Sorry for having missed that issue... I'll add an other use case: All that for saying that also if the VM method implemented was not 100% reliable it will still be useful and more easy to use. That was my two cents. |
An other CPUID/DMI BIOS project used for VMs detection (C++) |
I just threw together this method, and it works. Not sure we need this in OSHI because people will complain when it doesn't work. :)
|
Look good to me :) I could be wrong, but i dont think we should really consider the case of users obfuscating their VM MAC address as they probably worry much more to avoid ransomware attacks IMO. |
Well, I'll just leave this here in case someone wants to toss it into a Util class and clean it up a little bit. Other things we could do:
Or just leave this for users to do :) |
I'm marking this issue for first-timers-only. That means that I will only accept a PR for this one from someone who's never contributed to open source before. This one is easy (but don't make that statement make you feel bad if you have a hard time with it, there's more to contributing to open source than changing lines of code, especially if it's your first time). I'll hold your hand through this if you need me to. :-) Here are the steps to get a PR merged here.
|
Nice code, added it to my project: http://tinybrain.de/1019748 |
Hi @dbwiddis I'd like to work on this issue. |
Excellent @haidong! Holler if you need help! |
Thanks @dbwiddis I got it working on my local branch. Should be able to check in and send a pull request over the weekend. |
Fixed in #704 |
Is there an easy way regardless OS, to check if the machine in question is a virtual machine ?
Something like an
IsVirtualMachine()
method ?Anyone any thought how to accomplish this ?
Use case:
OS can either be Windows or RHEL, and I need to know it the machine is physical or virtual.
Hope someone can give some idea's.
The text was updated successfully, but these errors were encountered: