Friday, January 20, 2017

VirtualBox on Ubuntu 16.04 DNS Failure From Guest OS

I have a couple of VM's on my system running a variety of operating systems for testing and learning. Recently U upgraded the host system to Ubuntu 16.0.4 when I installed a new SSD. I moved the VMs from the old spinny disk and VM's start fine.
Yay! I can log into the VMs but realise there is a problem with DNS. I can ping outside hosts and all seems fine with the network. Started changing network settings in one of the guest OS and no, nothing is happening

After some investigation, this appears to be due to a change in how Ubuntu is doing DNS and that the Guest OS are unable to handle that natively.

The cure
Enable two parameters as the user you run your VM's under

VBoxManage modifyvm "Centos 7" --natdnsproxy1 on
VBoxManage modifyvm "Centos 7" --natdnshostresolver1 on
VBoxManage -natnetwork list
NAT Networks:

Name:        NatNetwork
Network:     10.0.2.0/24
Gateway:     10.0.2.1
IPv6:        No
Enabled:     Yes

Make sure all VM are stopped and then  run this, it willl crash VirtualBox but makes sure next time you start VirtualBox the new network settings will apply

VBoxManage natnetwork stop --netname "NatNetwork"


No comments: