VirtualBox

Ticket #10864 (closed enhancement: fixed)

Opened 20 months ago

Last modified 18 months ago

VirtualBox NAT-DNS fails if DNS service is listening on 127.0.1.1 -> fixed as of 17 Oct 2012 for 4.1, 4.2 and later

Reported by: rocko Owned by:
Priority: major Component: network/NAT
Version: VirtualBox 4.1.20 Keywords: NAT DNS
Cc: Guest type: all
Host type: Linux

Description

NAT-DNS does not work for guests running in virtualbox 4.2RC2 (I can't see that version in the version dropdown, btw, so I'm reporting against 4.1.20) in an Ubuntu 12.10 host with the default DNS setup, because virtualbox is sending DNS queries to the wrong address.

The host's /etc/resolv.conf contains

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1

The host's /etc/hosts contains:

127.0.0.1	localhost
127.0.1.1	sierra

And "sudo netstat -nl46p | grep :53" shows dnsmasq listening on 127.0.1.1:

tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      1971/dnsmasq    
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           1336/avahi-daemon: 
udp        0      0 0.0.0.0:53071           0.0.0.0:*                           4493/VirtualBox 
udp        0      0 127.0.1.1:53            0.0.0.0:*                           1971/dnsmasq    
udp6       0      0 :::5353                 :::*                                1336/avahi-daemon:

However, wireshark shows that VirtualBox is incorrectly trying to query 127.0.0.1 instead of 127.0.1.1.

A workaround is to manually force every VM to use the host's resolver with "VBoxManage modifyvm "VM name" --natdnshostresolver1 on" or to modify the guest's /etc/resolv.conf file with an external nameserver.

Change History

comment:1 Changed 19 months ago by penalvch

Issue confirmed via downstream bug, which may be found at:  https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1048783

1) HOST:

lsb_release -rd
Description: Ubuntu quantal (development branch)
Release: 12.10

2) HOST:

apt-cache policy virtualbox
virtualbox:
  Installed: 4.1.18-dfsg-1ubuntu1
  Candidate: 4.1.18-dfsg-1ubuntu1
  Version table:
 *** 4.1.18-dfsg-1ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ quantal/universe i386 Packages
        100 /var/lib/dpkg/status

3) What is expected to happen is when one starts VMs that worked in Precise:

+ Microsoft Windows Vista Business 6.0.6002 Service Pack 2 Build 6002

+

lsb_release -rd
Description: Ubuntu quantal (development branch)
Release: 12.10

one may open a browser (IE or Firefox) and it successfully connects to the internet.

4) What happens instead is it does not. This was also tested with brand new virtualbox VMS.

One may still ping ip addresses when connected with a NAT virtual NIC, but not do DNS lookup.

WORKAROUND: Execute at a terminal:

VBoxManage modifyvm VMNAME --natdnshostresolver1 on

comment:2 Changed 19 months ago by Hachiman

  • Type changed from defect to enhancement

NAT wasn't designed to work with 127.0.0.0/8 host network and I don't see any easy way to change this behaviour except explicit adding mapping addresses from 127.0.0.0/8 to NAT's address space, like 127.0.0.1 <-> 10.0.2.2.

comment:3 Changed 19 months ago by TiCPU

This will get even more common with Ubuntu Network Manager. Even if NAT wasn't designed to, DNS was designed to work with 127.0.0.1. Why not enable the workaround option by default? Maybe add it to the interface.

comment:4 Changed 18 months ago by michael

  • Summary changed from VirtualBox NAT-DNS fails if DNS service is listening on 127.0.1.1 to VirtualBox NAT-DNS fails if DNS service is listening on 127.0.1.1 -> fixed as of 17 Oct 2012 for 4.1, 4.2 and later

We have indeed decided to do that. Any future 4.1, 4.2 or later releases should detect this and enable the work-around by default.

comment:5 Changed 18 months ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Fix/workaround is part of 4.2.2.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use