virtualbox instances dedicated-server with custom dnsmasq

Posted by ovanes on Server Fault See other posts from Server Fault or by ovanes
Published on 2012-10-06T13:58:52Z Indexed on 2012/10/06 15:39 UTC
Read the original article Hit count: 252

I have dedicated server where I planned to run virtualbox virtual machines. Since the VMs are managed with vagrant/chef I may end up with many different ones. I thought it would be a great idea to deploy a dnsmasq on the server, which is going to dynamically assign the ip addresses to the VMs. Since each Vagrant/Chef recipe is configured to set the VM's host name I can find/reference the appropriate VM by the host name.

Finally, the entire infrastructure is not directly accessible via internet, so the dedicated Server is the OpenVPN host. So the entire infrastructure may be seen as:

+-------------------------------------+         
|         Dedicated Server            |     
|                                     |     
|  +-------------+    +------------+  |         +------------------+
|  |   DNSMasq   |    |   OpenVPN  |<==========>|      Client      |
|  +-------------+    +------------+  |         |                  |
|    ^   ^                            |         +------------------+
|    |   |                            |
| +--+   |                            |
| |   +-------+                       |
| |   |  VM1  |                       |
| |   +-------+                       | 
| |     ...                           |
| | +-------+                         |
| +-|  VM2  |                         |          
|   +-------+                         |
+-------------------------------------+

Now some questions which I am struggling with:

  1. Are there any other suggestions to access private infrastructure, because I don't want to reinvent the wheel.
  2. On the Dedicated Server I don't see the vboxnet0 interface but VirtualBox is installed without GUI. Accessing of virtual boxes via ssh works fine. Did I miss smth?
  3. DNSMasq must serve the local VMs only, otherwise there is a chance that local DNSMasq start to serve other server's on the network, what I don't want. Because I don't see vboxnet0 I tend to use no-dhcp-interface=eth0 config option. Are there any thoughts on that despite, the fact that a second NW-card (which is not the case), might start serving DHCP-Requests?
  4. How should I config the VM's network interface that I am able to access it via OpenVPN and resolve the hostnames using the DNSMasq. I think it should be the host-only network card.
  5. Should I do bridging in the OpenVPN config or is it sufficient to use routing.

© Server Fault or respective owner

Related posts about openvpn

Related posts about virtualbox