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.
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?
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.