Runtime identification of virtualized environment

Discussion in 'General Linux' started by velusamyg, Jan 5, 2012.

  1. velusamyg

    velusamyg New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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,
  2. ehansen

    ehansen New Member Staff Writer

    Messages:
    115
    Likes Received:
    11
    Trophy Points:
    0
    velusamyg,

    This isn't something you find a lot online, but I have some code that works for VMware, I'm sure you can port it over to Virtual Box with some tweaking.

    I'll upload it to GitHub later tonight and post the link here for you.
  3. ehansen

    ehansen New Member Staff Writer

    Messages:
    115
    Likes Received:
    11
    Trophy Points:
    0

Share This Page