VirtualBox

Opened 14 years ago

Closed 14 years ago

#6670 closed defect (duplicate)

DNS breaks when moving a laptop from network to network

Reported by: Ian Owned by:
Component: network/NAT Version: VirtualBox 3.1.6
Keywords: Cc:
Guest type: Linux Host type: Windows

Description

My use case: I have a Windows laptop running virtualbox. Periodically I suspend the laptop and move it from one office to another. I have an Ubuntu virtual machine in saved state when this happens.

What happens: the virtual machine, when I use it, can't resolve addresses. Investigation reveals that it has the previous network's DNS server set.

I presume that the VM is never notified of the change of DNS server. I don't know if the machine would receive a DNS server update if it is running. I can see that it doesn't when it's saved.

A proposed solution:

Instead of giving NATted VMs the address of the remote DNS server, have a local DNS proxy running on the NAT gateway. The local DNS proxy - running under the host OS - can forward the DNS requests to the laptop's currently set DNS server. The VMs are isolated from host machine configuration changes.

Change History (6)

comment:1 by Ian, 14 years ago

Someone's given me an answer to this. You can set this but it's not the default and it's not in the UI. It is in the manual under 'advanced topics':

VBoxManage setextradata "Ubuntu server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/DNSProxy" 1 VBoxManage setextradata "Ubuntu server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/UseHostResolver" 1

comment:2 by Klaus Espenlaub, 14 years ago

Suggesting to introduce a DNS proxy sounds very much like the DNS setup we had up to VirtualBox 3.0 IIRC, and it was changed to the current style because so many people complained that the DNS config didn't look like they expected.

I read something totally different out of your use case: VirtualBox needs to detect the suspend state and/or network change, and disconnect the virtual network cable temporarily to convince the guest OS to renew its DHCP lease.

in reply to:  1 comment:3 by vasily Levchenko, 14 years ago

Replying to ij: Actually, only is required:

VBoxManage setextradata "Ubuntu server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/UseHostResolver" 1

that's switch NAT's internal module into mode forwarding dns requests to host's resolver API.

VBoxManage setextradata "Ubuntu server" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/DNSProxy" 1

This mode was introduced for more efective emulation of DNS proxy of VBox prior 2.2.

in reply to:  2 comment:4 by dimitris, 14 years ago

Replying to klaus:

Suggesting to introduce a DNS proxy sounds very much like the DNS setup we had up to VirtualBox 3.0 IIRC, and it was changed to the current style because so many people complained that the DNS config didn't look like they expected.

I read something totally different out of your use case: VirtualBox needs to detect the suspend state and/or network change, and disconnect the virtual network cable temporarily to convince the guest OS to renew its DHCP lease.

"Manually" disconnecting then reconnecting the virtual network cable doesn't help. Ubuntu Lucid host on x86_64, WinXP 32 guest:

After disconnecting the virtual cable:

C:\>ipconfig /all

Windows IP Configuration

        Host Name . . . . . . . . . . . . : winvm
        Primary Dns Suffix  . . . . . . . :
        Node Type . . . . . . . . . . . . : Unknown
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

        Media State . . . . . . . . . . . : Media disconnected
        Description . . . . . . . . . . . : AMD PCNET Family PCI Ethernet Ada
r
        Physical Address. . . . . . . . . : 08-00-27-6D-24-A8

Then, after reconnecting and after the XP guest has renewed its DHCP lease:

C:\>ipconfig /all

Windows IP Configuration

        Host Name . . . . . . . . . . . . : winvm
        Primary Dns Suffix  . . . . . . . :
        Node Type . . . . . . . . . . . . : Unknown
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : AMD PCNET Family PCI Ethernet Adapte
r
        Physical Address. . . . . . . . . : 08-00-27-6D-24-A8
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 10.0.2.15
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 10.0.2.2
        DHCP Server . . . . . . . . . . . : 10.0.2.2
        Lease Obtained. . . . . . . . . . : Thursday, May 13, 2010 12:35:53 PM
        Lease Expires . . . . . . . . . . : Friday, May 14, 2010 12:35:53 PM

C:\>nslookup www.google.com
*** Default servers are not available
Server:  UnKnown
Address:  127.0.0.1

*** UnKnown can't find www.google.com: No response from server

comment:5 by Tom Davidson, 14 years ago

This is a duplicate of issue 3847 (which had incorrectly been marked closed)

comment:6 by vasily Levchenko, 14 years ago

Resolution: duplicate
Status: newclosed

duplicate #3847

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use