Page 1 of 1
Who's my host?
Posted: 30. Jul 2010, 22:39
by mastercho
I'm using VBox 3.2.6 on an OSX host with CentOS guests.
I want to make an appliance to install on developers' workstations and I want it to register with DDNS differently for each developer.
The hosts and guests all use DHCP to acquire their addresses.
I presumed I would use the developer's workstation hostname to construct the appropriate hostname to update in DDNS for the guest.
Can a Linux guest find the hostname of its host?
Is there some other solution I should consider?
Thank you
Re: Who's my host?
Posted: 30. Jul 2010, 23:02
by Sasquatch
As long as hostnames are registered with the DNS server, then it should be discoverable by the Linux Guest systems.
Re: Who's my host?
Posted: 1. Aug 2010, 19:35
by mastercho
I don't understand.
Here's the scenario:
I have two hosts - HostA, HostB
I deploy the same appliance to each of them, and they have other guests.
I end up with - HostA (ApplA, ...), HostB (ApplA, ...)
Is there a way the appliance can detect its host's hostname at import, or run, time?
Re: Who's my host?
Posted: 1. Aug 2010, 21:01
by Sasquatch
Sorry, I don't understand you this time. Are you saying that you want to deploy the same VM to multiple systems and when the deployment is done, the OS inside the VM will change it's hostname to a unique one? If so, that's up to the OS itself to do, VB only provides a way to run these things. It can't alter files or settings inside the OS itself.
Re: Who's my host?
Posted: 1. Aug 2010, 21:53
by mastercho
I'm not asking VB to do the name setting/changing. You're right, I'll have the OS do that.
I just want to know if I can get the hostname of my host from within the guest.
Re: Who's my host?
Posted: 1. Aug 2010, 22:25
by Sasquatch
No idea, maybe you can if you use NAT and query a whoareyou at 10.0.2.2.
Re: Who's my host?
Posted: 2. Aug 2010, 01:53
by mastercho
Thank you for responding.
Re: Who's my host?
Posted: 6. Aug 2010, 08:21
by maxsmith
I know the IP of my shared host, and I'm wondering who my neighbours might be so that I can see what risks I'm taking being on a shared host. Any easy way to find out my neighbours from the IP?
__________________________________________________________________________________________________________
Want to get-on Google's first page and loads of traffic to your website? Hire a SEO Specialist from OceanĀ GroupsĀ
seo pecialist
Re: Who's my host?
Posted: 7. Aug 2010, 10:02
by TerryE
If you want to define host-specific properties for a guest then there is this wonderful standard feature called guestproperty which allows you to do this.
Re: Who's my host?
Posted: 12. Aug 2010, 12:42
by jsilence
You can define a shared folder for the VM and place a simple text file there that is different on both hosts. Then use that textfile to detect which host you are on fom within the guest.
-jsl
Re: Who's my host?
Posted: 12. Aug 2010, 15:26
by TerryE
jsilence wrote:You can define a shared folder for the VM and place a simple text file there that is different on both hosts. Then use that textfile to detect which host you are on from within the guest.
If you have access to shared folders then you have guest additions loaded, and if you have guest additions loaded then you can always do on the host
- VBoxManage guestproperty set <vmname> /VirtualBox/HostInfo/Hostname <whateverthe name is>
and on the guest you can access this by doing a
- hostname=$(sudo VBoxControl -nologo guestproperty get /VirtualBox/HostInfo/Hostname | cut -b 8- )
if you are running Linux and assuming that you've set up sudoers correctly -- or the equivalent Command line expression on Windows.