I would like to be able to determine which Hyper-V host a particular CentOS 7 VM is running on. In a Windows VM this is stored in HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters. Is anyone aware of a methodology for getting this from inside a CentOS guest?

  • 1
    It was noticed in far 2011 on TechNet as "preparing feature", but it looks like that Microsoft didn't add the support of this under Linux. However, if the Integration Services is installed probably the hostname of Hyper-V host can be found there.
    – A.Newgate
    May 21 '19 at 3:08

% strings /var/lib/hyperv/.kvp_pool_3 |head -2

  • That seems like an extremely fragile approach.
    – womble
    Jan 9 '20 at 22:57
  • This points to the correct location of the file. Thanks Feb 3 '21 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.