Link-local (APIPA) VM with physical link-local network

This is for discussing general topics about how to use VirtualBox.
Post Reply
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Link-local (APIPA) VM with physical link-local network

Post by socratis »

Project requirements
Fast local connection from a VM (via the Host) to a Server that is on the same physical network with the Host, in order to apply the WSUS Offline updates.

Setup
VM: Windows 7 x64.
  • NIC 1: 192.168.100.110, HostOnly to connect to the Host. DHCP.
  • NIC 2: 192.168.50.110, Internal, reserved for when other VMs are running. DHCP.
  • NIC 3: 10.0.0.111, Bridged to Host's WiFi for Internet. DHCP.
  • NIC 4: 10.0.5.15, NAT for Internet, when Bridged doesn't work [1]. DHCP.
Host: MacBoocPro, OSX 10.9.5, VirtualBox 5.1.6.
  • NIC 1: 10.0.0.101, WiFi to router for Internet. 54 Mbps. DHCP.
  • NIC 2: 169.254.38.231, wired directly to Server, 1 Gbps. Link-local (APIPA).
Server: ASUS, Windows 7 x86.
  • NIC 1: 10.0.0.110, wired to router for Internet. DHCP.
  • NIC 2: 169.254.69.41, wired directly to the Host, 1 Gbps. Link-local (APIPA).
Link-local addressing, or APIPA, for those of you that haven't heard it, stands for Automatic Private IP Addressing, means that if you computer doesn't get a hold of a DHCP server, it assigns itself an IP address in the range of 169.254.#.# (169.254.0.0/16). This way you can create peer-to-peer networks on the fly. For more information see: https://en.wikipedia.org/wiki/Link-local_address#IPv4

And for those of you who are fond of ASCII art, here's what it looks like [2]:
  • 
         -   -  Missing direct link  -   -
     ___|___         ________         ____|___
    |       |___1___|____.   |       |        |
    |  VM   |___2___|  Host  |_______| Server |
    |       |___4___|____    | Wired |        |
    |_______|       |____|___| APIPA |________|
        |                |                |
        |_______3________|WiFi            |Wired
                       __|________________|__
                      |                      |
                      |        Router        |
                      |______________________|
                                 _|__
                            .~-(`    `)~.
                           (  Internet  `)
                            ~-. ___ .-~~`
    
    1: Host-only, 2: Internal, 3: Bridged, 4: NAT

Problem 1: I wanted to connect the VM to the Server, in order to apply the WSUS Offline updates (more on that on a later how-to). If I used the Host's Bridged option, I would get slow speeds, because the adapter was bridged to the WiFi, therefore limiting it's speeds to a maximum of 54 Mbps.
Solution 1: I realized that instead of bridging the VM to my WiFi, I could (probably) bridge it to the wired local-link one. And it worked! I got a local-link address on my VM, and I was able to ping the Server, the Host and the VM from anywhere to anywhere. Just for completion, the self-assigned local-link addresses were:
  • 169.254.115.194 : VM
  • 169.254.38.231 : Host
  • 169.254.69.41 : Server
Problem 2: I could see my Server just fine on the Network of the VM, but I couldn't browse anonymously. This unfortunately is required for the Automated Update installation of the WSUSO. This is a Windows networking problem, not a VirtualBox one. I'm just including it here for completion.
Solution 2: The network was set as "Unidentified network", both on the Server and on the VM, due to the lack of a dedicated Gateway (I could definitely say something here about Microsoft, but it wouldn't be nice). There had to be some changes in the "Network and Sharing Center" for "Public" networks:
  1. Turn on network discovery (Server and VM).
  2. Turn on file and printer sharing (Server).
  3. Turn on sharing in the Public folders (Server).
  4. Turn off password protected sharing (Server).
  5. When asked for Username/Password, simply enter "Guest" as the Username, no password (VM).
Final thoughts: I wasn't sure if this method would work when I started working on it. In retrospect, I don't see any reason why it wouldn't. Just documenting it in case that someone finds it interesting. If I made any mistakes or you can suggest better/more efficient ways, please feel free to comment/correct me.

[1] When I go to the office, bridging through that specific WiFi Router does not work with my MBP. At home my WiFi Router works with VirtualBox's bridge mode with no problems.
[2] Yes, I had some free time to kill with my morning coffee ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply