Welcome to the Linux Foundation Forum!

Runtime identification of virtualized environment

I am a new to Linux/ Virtual Box. I am writing an application which is supposed be run on Virtualized env and also on standalone linux machines and the app is supposed to do different task based on the environment .

I would like to identify on runtime, if my app is running on virtualized env (Virtual Box with guest OS as ubuntu and host OS as windows) OR if the app is running on standalone Linux (ubuntu) machine.

Is there any env / config file within the ubuntu OS which will tell me the details required.

Initially i considered, differentiation based on VBoxGuestAddition installable can help, but guestAddition installation is not mandatory on all VBox machine.

Is there any alternate way for this identification.

I am looking for some command or some unique file which will tell that my application is running in virtual box or not.

Any help in this regard will be very helpful.

Thanks,

Categories

Upcoming Training