Hello all,
Does the virtualbox's DHCP server to name translation like my router does, or do I need to run a DNS server as well? If another DNS is required, how would I set one up? Or maybe there is a much simpler way of doing this that I'm not aware of?
What I am attempting to accomplish is to use an IP name to access the virtualbox's services but in the case of the service being located on the local computer I want it to use the host only adapter as opposed to the bridged adapter.
Is there a way of doing this? I would also like this to be portable across any host system if possible, or if different methods are required on different hosts, a description of how to do it on as many hosts as possible.
Thanks,
A
Using the DHCP to access the guest faster then externally
-
BillG
- Volunteer
- Posts: 5106
- Joined: 19. Sep 2009, 04:44
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 10,7 and earlier
- Location: Sydney, Australia
Re: Using the DHCP to access the guest faster then externall
Sorry to disappoint you but DHCP does not do name resolution. It only hands out the network configuration. Without DNS, Windows uses network broadcasts to resolve names.
If you want a particular name to resolve to a particular IP address you could use a hosts file (DNS format) or an lmhosts file (Netbios format).
If you want a particular name to resolve to a particular IP address you could use a hosts file (DNS format) or an lmhosts file (Netbios format).
Bill
-
adrianh
- Posts: 46
- Joined: 26. Aug 2009, 21:42
- Primary OS: Other
- VBox Version: OSE other
- Guest OSses: Win7
Re: Using the DHCP to access the guest faster then externall
Ok, so how does my router do this? It must pickup the broadcast that says "I'm host 'xyz' on 123.123.123.123, the ip that you (the router) gave me" allowing the DNS part of the router to keep that IP associated with the name xyz.
I guess I could make the host network use a static IP, using the lmhosts file (or equivalent) to point at it, however, I'm a little reluctant because I'm trying to make an appliance that needs no configuration if possible. Plug & Play as it were. There must be some way of linking vbox's DHCP with some programme acting as a DNS, so I don't need to do hard linking.
Anybody? Thanks.
A
I guess I could make the host network use a static IP, using the lmhosts file (or equivalent) to point at it, however, I'm a little reluctant because I'm trying to make an appliance that needs no configuration if possible. Plug & Play as it were. There must be some way of linking vbox's DHCP with some programme acting as a DNS, so I don't need to do hard linking.
Anybody? Thanks.
A
-
martyscholes
- Posts: 202
- Joined: 11. Sep 2011, 00:24
- Primary OS: Solaris
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Win 7, Ubuntu, Win XP, Vista, Win 8, Mint, Pear, Several Linux Virtual Appliances
Re: Using the DHCP to access the guest faster then externall
I just watched the network as both Windows 7 and Ubuntu booted. In both cases, the guests supplied their host name in the DHCPREQUEST packet to the DHCP server. BillG is right in that DHCP gives out IP addresses but does not resolve names. On the other hand, it seems that many home routers, including mine, tie together the DNS service and the DHCP service such that a client name given to the DHCP server will magically appear in the DNS server's list. I would guess that since VirtualBox's DHCP server for NAT does not provide DNS, it probably does not tie the services together to accomplish what you want.adrianh wrote:Ok, so how does my router do this? It must pickup the broadcast that says "I'm host 'xyz' on 123.123.123.123, the ip that you (the router) gave me" allowing the DNS part of the router to keep that IP associated with the name xyz.
You original question seems to be related to performance:
You don't say which host OS you have but your profile suggests XP. While I am unfamiliar with XP's network stack, I believe that Solaris (my host OS) doesn't use the wire if the destination host is local, suggesting that there is no performance gain by putting together a host-only network. Are you seeing a performance decrease by running on a bridged adapter? I suspect that a host-only network is not for performance reasons, but to allow for a private LAN which stays on a particular host. Again in Solaris, this can easily be accomplished outside of VirtualBox anyway.adrianh wrote:What I am attempting to accomplish is to use an IP name to access the virtualbox's services but in the case of the service being located on the local computer I want it to use the host only adapter as opposed to the bridged adapter.
One option might be to allocate a host only network and put a virtual machine on there which only runs DHCP and DNS services, which should accomplish what you want.
-
adrianh
- Posts: 46
- Joined: 26. Aug 2009, 21:42
- Primary OS: Other
- VBox Version: OSE other
- Guest OSses: Win7
Re: Using the DHCP to access the guest faster then externall
Actually, the target host is to be as generic as possible, but probably the Windows line is what I'm looking at right now. Performance is only part of the issue. Say the router or network went down and I wanted to access the VM? I wouldn't be able to. A host only network would be ok, but I'd like to not have to nail it down to an ip if I can help it. A DNS is much more preferable, but I'm not sure about my options as yet, or how I'd set one up to do what I need it to do.You don't say which host OS you have but your profile suggests XP. While I am unfamiliar with XP's network stack, I believe that Solaris (my host OS) doesn't use the wire if the destination host is local, suggesting that there is no performance gain by putting together a host-only network. Are you seeing a performance decrease by running on a bridged adapter? I suspect that a host-only network is not for performance reasons, but to allow for a private LAN which stays on a particular host. Again in Solaris, this can easily be accomplished outside of VirtualBox anyway.
One option might be to allocate a host only network and put a virtual machine on there which only runs DHCP and DNS services, which should accomplish what you want.
A
-
BillG
- Volunteer
- Posts: 5106
- Joined: 19. Sep 2009, 04:44
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 10,7 and earlier
- Location: Sydney, Australia
Re: Using the DHCP to access the guest faster then externall
You do not need a DNS server in a simple case like that. All you need is an entry in the "hosts" file. That translates the name you select into the IP address of the vm. Or in Windows you can use the lmhosts file to achieve the same result.
Bill
-
adrianh
- Posts: 46
- Joined: 26. Aug 2009, 21:42
- Primary OS: Other
- VBox Version: OSE other
- Guest OSses: Win7
Re: Using the DHCP to access the guest faster then externall
Yes, but how do I know which IP is connected to my VM? My router has the ability to know the name of the machine and it's IP. How would I do that? And then of course I would have to lock it down since these files are static. Though I guess I could write a programme that can scan for my server periodicity as there are only a max of 255 IPs it would have to go through, and update the hosts file. But then, is there a simple way of distinguishing one server on the host-only network from another without actually logging in to the box?
A
A