DHCP and DNS issues

Discussions about using Linux guests in VirtualBox.
Post Reply
pertinky
Posts: 2
Joined: 24. Sep 2010, 17:45
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

DHCP and DNS issues

Post by pertinky »

Hey guys,

Firstly, I'm not an infrastructure guy, or a network guy, and my knowledge of these facets of computing are relatively limited (I understand the general principles). I am a software developer by trade and I'm wanting to setup a full development environment at home for some projects.

I opted to use VB on a Windows XP host (will be Windows 7 soonish) with a guest OS of Ubuntu Server. Eventually I'd like a number of VM machines (dev, test, db etc.) but for now a single VM should suffice with everything on it (http server/web server/application server/database server). I've gotten to the stage where my VM has been created and configured and my guest OS has been installed. I am able to connect to my server through an SSH client i.e. putty on the IP address that VB's DHCP server has assigned.

I want to be able to setup DNS to work with the DHCP server so I can cast aside the IP addresses and ssh to dev.mydomain.co.uk, but I don't have any idea where to start for all the googling I've done. I know Ubuntu comes with a DHCP and an optional DNS server, but if my understanding is correct I want to be using the ones from the host OS? I came to this conclusion based on VB being the entity that assigns my VM's their IP's dynamically.

Anyways, any pointers or guidance would be much appreciated.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: DHCP and DNS issues

Post by Sasquatch »

From what I understand here, is that you are using the Host-Only network option in the VM. In that case, you can edit the Host's hosts file to reflect the name and IP address. Other options to make this work from the Host is to set up DNS on it and put a static entry in it that points to the VM and make sure that the Host uses it's own DNS service first.

It would at least help if you can describe the network you have build. We can then give you a better reply.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
pertinky
Posts: 2
Joined: 24. Sep 2010, 17:45
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Re: DHCP and DNS issues

Post by pertinky »

Sorry - as I said I'm a network noob.

I think I'm in a position to explain what I'm trying to do better now!

I want to create a VLAN between my host (Windows XP) and 1...n VM's (Ubuntu server). In the first instance I'd just like one VM, and I'd like it to be able to access the internet (I presume through the host via a bridge), but at the same time it should be isolated from the outside world.

I think DHCP in this case is overkill so static ips for my VLAN computers should suffice on subnet 192.168.y.x

I believe I'd need a DNS on the VLAN so that the host and other VM's can resolve the domain names I'd like to create for my computers without having to setup the hosts file on each machine. I think setting up the DNS on the host would be the most practical.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: DHCP and DNS issues

Post by Sasquatch »

You can do a few things, but I advise you to NOT use the VB DHCP setting. The reason for that, is that you can't give it a DNS or gateway address. I suggest you get either a separate VM to act as a gateway and DHCP server (so you disable VB's, which you should anyway), or you put your Host as the gateway and run a separate DHCP on it (or use static addresses). Now all that's needed is to get the clients to register themselves to the DNS server.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
dave843
Posts: 3
Joined: 3. Oct 2010, 01:42
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows XP, Fedora 13

Re: DHCP and DNS issues

Post by dave843 »

You could look into running dnsmasq on your host machine. It should do what you need.
Post Reply