Page 1 of 1
Get Hostname from the Host in a Windows Guest Machine?
Posted: 16. Jan 2015, 17:59
by Volkan
Hi
I'm searching a way to get the hostname from the host in a windows guest machine?
Is there a way to Archive this?
Is there any enviroment vairables or something else to do that?
Thank you for any help

Volkan
Re: Get Hostname from the Host in a Windows Guest Machine?
Posted: 16. Jan 2015, 19:40
by scottgus1
by "hostname", are you speaking of the name the computer goes by on the network? Such as, to access the shared folders on a Windows PC you'd type \\computername?
I don't think I have ever heard of anything built into Virtualbox that can do this, from guest to host. If you think of your problem as, how would I do this if I had two physical PCs networked to each other? Then apply the solution to your host and guest, and you're up and running.
Re: Get Hostname from the Host in a Windows Guest Machine?
Posted: 16. Jan 2015, 22:02
by Volkan
Yes, i mean the host with Windows where virtualbox ist installed. The vm where is running in it should get the hostname of ist, i hope ist clear now
In VMWare Workstation i can make a Change in the configuration file and after that i can read this line from the virtual guest, is it possible to write some Information in the vm vbox fine and i read it from inside the vm?
Thx
Volkan
Re: Get Hostname from the Host in a Windows Guest Machine?
Posted: 19. Jan 2015, 14:57
by scottgus1
There is the "Vboxmanage guestproperty set/get" commands which can pass text between host and guest, if the Guest Additions are installed. You'd have to write a script to set a custom guestproperty with the name of the host, then write another script in the guest to read that custom guestproperty to find the host's name within the guest.
Or, if you can't have Guest Additions, you could use normal Windows Shared Folders and save the host name in a text file in a shared folder, and read that text file from a script in the guest.