The following registry key contains information about the Host server:
HKLM\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters
Some important keys are:
HostNamePhysicalHostNamePhysicalHostNameFullyQualifiedVirtualMachineName
Plus a number of settings about the Host Server’s version
So simplest way to get host server name is to run following DOS command:
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters\" /v "PhysicalHostNameFullyQualified"
As per my info, this works for many guest OS. However not sure for all. Also it needs vmtools to be installed on guest OS.
Alternatively you can issue WMI command:
WMIC /namespace:\\root\virtualization PATH "Msvm_ComputerSystem" Get ElementName, Caption
This should give you "Hosting Computer System".
Please let me know if this helps. And if yes, please don't forget to mark this as answer.