How can a program detect that Ubuntu is running as a virtual machine?install a minimal 64bit Ubuntu 12.04 server virtual machine to use alongside a 32bit Ubuntu 12.04?problem running virtual machines on ubuntu 12.04 via virtualboxIs it possible to “SSH” into my virtual machine remotely?How to run a client-server application on virtual machines running on different computers?Ubuntu 16.04 hangs immediately every time I start a new machine in VirtualBoxReinstalling Windows in a virtual machineInstall Lubuntu 18.10 on a 4GB Virtual Machine

What kind of electrical connector is this and how do I remove it?

What is a word for "atom or molecule"?

make invisible depending on point of view

How to I represent 5 eighth-notes as one note?

Does 'hacer alguien matar' mean to make somebody kill or to get sb killed?

How to deal with this fundamental problem with the advice: "Don't trust obscure PHP libraries that nobody uses!"?

What does "x employee is no longer employed by XYZ company" mean?

My boss asked what number would keep me happy?

Shp is not valid or recognized data source using QGIS

shadow prices associated with nonnegativity constraints

Pregant spouse slipped abortion pills unknowingly. What would the legal ramifications be?

Why is 1>a.txt 2>&1 different from 1>a.txt 2>a.txt ? (Example shown)

how technically soft landing works without air on moon?

Early computers without screens or sensors

What to do with excess co-ax cable

Do the Jovians in "Victory Unintentional" exist in Isaac Asimov's Foundation series?

Why are bicycle tires incapable of maintaining pressure over time, while car tyres seem to have less of a problem?

Avoid long walking when changing between Tokyo subway lines

Kids traveling with a different passport in theirs parents' country without being previously registered in a consulate

Missing links in crossword

No transit zone at Linate airport. Couldn't get on connecting flight. Whose responsibility is it?

Putting creatures into play in alternative ways to summoning them

Berlin 1923 & 1925 Address Book Abbreviations "I", "E", "Kgst" and "Mb"

What are the disadvantages of using a Zener diode over a linear voltage regulator?



How can a program detect that Ubuntu is running as a virtual machine?


install a minimal 64bit Ubuntu 12.04 server virtual machine to use alongside a 32bit Ubuntu 12.04?problem running virtual machines on ubuntu 12.04 via virtualboxIs it possible to “SSH” into my virtual machine remotely?How to run a client-server application on virtual machines running on different computers?Ubuntu 16.04 hangs immediately every time I start a new machine in VirtualBoxReinstalling Windows in a virtual machineInstall Lubuntu 18.10 on a 4GB Virtual Machine






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









8


















I am trying to run a program via Ubuntu 16.04 as a Virtualbox VM.



The binary of this program checks if it's running on a virtual machine, and does something different on a VM than if it is on a given computer.



How can I know what the binary is querying? Can I use something like strace or ldd for this?



I would like to be able to run the binary as if it was on a real machine, not a VM. I presume there must be a way to change what's reported by the Ubuntu 16.04 when the binary queries it.










share|improve this question



























  • Is this security-related (e.g. reverse engineering malware)?

    – code_dredd
    Oct 1 at 15:57






  • 1





    I found this via Google search: stackoverflow.com/q/12874288/1993909

    – Daniel Cheung
    Oct 2 at 5:23

















8


















I am trying to run a program via Ubuntu 16.04 as a Virtualbox VM.



The binary of this program checks if it's running on a virtual machine, and does something different on a VM than if it is on a given computer.



How can I know what the binary is querying? Can I use something like strace or ldd for this?



I would like to be able to run the binary as if it was on a real machine, not a VM. I presume there must be a way to change what's reported by the Ubuntu 16.04 when the binary queries it.










share|improve this question



























  • Is this security-related (e.g. reverse engineering malware)?

    – code_dredd
    Oct 1 at 15:57






  • 1





    I found this via Google search: stackoverflow.com/q/12874288/1993909

    – Daniel Cheung
    Oct 2 at 5:23













8













8









8


1






I am trying to run a program via Ubuntu 16.04 as a Virtualbox VM.



The binary of this program checks if it's running on a virtual machine, and does something different on a VM than if it is on a given computer.



How can I know what the binary is querying? Can I use something like strace or ldd for this?



I would like to be able to run the binary as if it was on a real machine, not a VM. I presume there must be a way to change what's reported by the Ubuntu 16.04 when the binary queries it.










share|improve this question
















I am trying to run a program via Ubuntu 16.04 as a Virtualbox VM.



The binary of this program checks if it's running on a virtual machine, and does something different on a VM than if it is on a given computer.



How can I know what the binary is querying? Can I use something like strace or ldd for this?



I would like to be able to run the binary as if it was on a real machine, not a VM. I presume there must be a way to change what's reported by the Ubuntu 16.04 when the binary queries it.







virtualbox virtualization






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 1 at 9:42









Melebius

8,0915 gold badges30 silver badges57 bronze badges




8,0915 gold badges30 silver badges57 bronze badges










asked Oct 1 at 9:07









719016719016

4,84525 gold badges70 silver badges113 bronze badges




4,84525 gold badges70 silver badges113 bronze badges















  • Is this security-related (e.g. reverse engineering malware)?

    – code_dredd
    Oct 1 at 15:57






  • 1





    I found this via Google search: stackoverflow.com/q/12874288/1993909

    – Daniel Cheung
    Oct 2 at 5:23

















  • Is this security-related (e.g. reverse engineering malware)?

    – code_dredd
    Oct 1 at 15:57






  • 1





    I found this via Google search: stackoverflow.com/q/12874288/1993909

    – Daniel Cheung
    Oct 2 at 5:23
















Is this security-related (e.g. reverse engineering malware)?

– code_dredd
Oct 1 at 15:57





Is this security-related (e.g. reverse engineering malware)?

– code_dredd
Oct 1 at 15:57




1




1





I found this via Google search: stackoverflow.com/q/12874288/1993909

– Daniel Cheung
Oct 2 at 5:23





I found this via Google search: stackoverflow.com/q/12874288/1993909

– Daniel Cheung
Oct 2 at 5:23










1 Answer
1






active

oldest

votes


















1



















People and apps have started to code dmidecode parsing, special instruction handling (vmware) and other things. But often such code gets outdated no more matching new versions and virtualization technologies.



IMHO by far the most reliable way is to rely on the nowadays ubiquitous systemd and just call systemd-detect-virt



The benefits are clear, many VM and container types are already implemented, you get updates along new systemd versions and have less own code that you have to maintain.






share|improve this answer


























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177856%2fhow-can-a-program-detect-that-ubuntu-is-running-as-a-virtual-machine%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown


























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1



















    People and apps have started to code dmidecode parsing, special instruction handling (vmware) and other things. But often such code gets outdated no more matching new versions and virtualization technologies.



    IMHO by far the most reliable way is to rely on the nowadays ubiquitous systemd and just call systemd-detect-virt



    The benefits are clear, many VM and container types are already implemented, you get updates along new systemd versions and have less own code that you have to maintain.






    share|improve this answer





























      1



















      People and apps have started to code dmidecode parsing, special instruction handling (vmware) and other things. But often such code gets outdated no more matching new versions and virtualization technologies.



      IMHO by far the most reliable way is to rely on the nowadays ubiquitous systemd and just call systemd-detect-virt



      The benefits are clear, many VM and container types are already implemented, you get updates along new systemd versions and have less own code that you have to maintain.






      share|improve this answer



























        1















        1











        1









        People and apps have started to code dmidecode parsing, special instruction handling (vmware) and other things. But often such code gets outdated no more matching new versions and virtualization technologies.



        IMHO by far the most reliable way is to rely on the nowadays ubiquitous systemd and just call systemd-detect-virt



        The benefits are clear, many VM and container types are already implemented, you get updates along new systemd versions and have less own code that you have to maintain.






        share|improve this answer














        People and apps have started to code dmidecode parsing, special instruction handling (vmware) and other things. But often such code gets outdated no more matching new versions and virtualization technologies.



        IMHO by far the most reliable way is to rely on the nowadays ubiquitous systemd and just call systemd-detect-virt



        The benefits are clear, many VM and container types are already implemented, you get updates along new systemd versions and have less own code that you have to maintain.







        share|improve this answer













        share|improve this answer




        share|improve this answer










        answered Oct 8 at 13:31









        Christian EhrhardtChristian Ehrhardt

        8935 silver badges11 bronze badges




        8935 silver badges11 bronze badges































            draft saved

            draft discarded















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177856%2fhow-can-a-program-detect-that-ubuntu-is-running-as-a-virtual-machine%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown









            Popular posts from this blog

            Tamil (spriik) Luke uk diar | Nawigatjuun

            Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

            Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?