I'm running VirtualBox 2.1.4 on a Vista host with a Fedora 10 guest. What I'm trying to do is be able to access the Fedora 10 guest using only the hostname. This whole thing is running on my work laptop (Thinkpad T61) so I can't just add the name & IP to the DNS servers at work, but I need a way to tell the Vista machine to connect to the Fedora guest via hostname instead of IP address. I could use the port forwarding commands in VBoxManage to forward individual ports, but I'd much rather just specify the hostname and get connections that way. My thinking was to just setup the guest network as NAT and just make sure I configure the hostname in the DHCP settings in Fedora (since the Vista Host is now acting like a DHCP server, it knows what IP it gave to the guest). But then how do I map the address given to the guest by VirtualBox to something that can be resolved in Vista (I know I can put it in the hosts file on Vista, but the IP of the guest doesn't seem accessible from within Vista...it doesn't respond to pings)?
Am I just asking for the impossible here, or is there a way to get my host to be able to refer to the guest by hostname?
Connect to Linux Guest via hostname
Re: Connect to Linux Guest via hostname
Have a look at
C:\WINDOWS\system32\drivers\etc\hosts
C:\WINDOWS\system32\drivers\etc\hosts
[This space is intentionally left blank]
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
Re: Connect to Linux Guest via hostname
I'm familiar with the hosts file on Vista, but in order for that to work, I either have to have a consistent IP address for my guest, or I need a way to programmatically figure out the IP address each time the guest boots up (some kind of batch file or script that would change the hosts file when the guest boots up and edit the IP address). Short of that, I'd have to look up the guest IP address every time it boots and manually change the hosts file on Vista.
As far as getting a static IP for my guest is concerned, I can't get that if I setup the network adapter to Host Interface since the IP will be different each time I boot up (the lease from DHCP servers at work is only 3 hours...don't ask me why). So the only way to ensure a static IP is to setup the adapter for NAT and setup Fedora to a static IP. But in this case, I can't route packets directly from the Vista box to the guest using only the guest's IP. I'd have to setup port forwarding via the VBoxManage utility for each port I want to forward.
What I'm looking for is a way to be able to either programmatically get the IP of the guest from the Vista machine so that I can create a script to change the hosts file on Vista or a way to route traffic to the IP of the guest directly from Vista (without setting up port forwarding with VBoxManage) while the guest is configured for NAT.
Are either of these possible?
As far as getting a static IP for my guest is concerned, I can't get that if I setup the network adapter to Host Interface since the IP will be different each time I boot up (the lease from DHCP servers at work is only 3 hours...don't ask me why). So the only way to ensure a static IP is to setup the adapter for NAT and setup Fedora to a static IP. But in this case, I can't route packets directly from the Vista box to the guest using only the guest's IP. I'd have to setup port forwarding via the VBoxManage utility for each port I want to forward.
What I'm looking for is a way to be able to either programmatically get the IP of the guest from the Vista machine so that I can create a script to change the hosts file on Vista or a way to route traffic to the IP of the guest directly from Vista (without setting up port forwarding with VBoxManage) while the guest is configured for NAT.
Are either of these possible?
Re: Connect to Linux Guest via hostname
From NAT the IP is always the same, you can reach the Guest by IP_HOST:PortMappedToGuest
From Host networking you are left with scripting, or write a service that launches at Guest start and dumps its IP to a share.
From Host networking you are left with scripting, or write a service that launches at Guest start and dumps its IP to a share.
[This space is intentionally left blank]
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-
If you can read this, you can read the VirtualBox Manual, the Forum FAQ, and the QuickClick FAQ
-=[ Search this forum with Keywords, VirtualBox solutions at you're fingertips]=-