Reading:
VirtualBox on MacOS Catalina: But it works on my machine!

Image

VirtualBox on MacOS Catalina: But it works on my machine!

VirtualBox network is not working?

“It Works on My Machine”: A mystery behind an inaccessible VirtualBox VM on MacOS Catalina.

In one of our recent migration projects, we came across one of those unfortunate incidents when you hear an application “works fine on my machine” and no amount of pleading or crying can provide a clue as to why it will not do so anywhere else… 🙄.

It works on my machine Illustration

The project in question made use of Vagrant + VirtualBox for local environment deployment and testing. One of the developers had his own customised version of a VagrantBox, and for him everything worked like a charm. Let’s call him Developer 1. His workstation ran VirtualBox v6.1.34 + Vagrant 2.2.x + Ubuntu.

His teammate, on the other hand — Developer 2 needed to update his local environment. His own workstation was a combination of MacOS + VirtualBox v6.1.24 + Vagrant 2.1.x.

Consequently, at least on paper, Developer 2’s plan looked fairly simple:

  • Step 1: Upgrade his versions of VirtualBox + Vagrant (it was essential to use unified versions)
  • Step 2: Install all other elements of the project.

Both steps were completed without any errors, and yet the results were far from expected — now the website, which was deployed within VirtualBox, was somehow inaccessible. What the –?

This was yet another mystery, so the team put on their thinking caps and as a result took the following measures:

Within the VirtualBox instance itself, everything seemed to be working well, without any apparent issues.

The team then decided to switch gears and check the VirtualBox host accessibility from the outside — using a simple ping command — which unexpectedly revealed that 100% of the packets were lost. While this was somewhat disheartening, it was a possible culprit for the entire conundrum.

They then followed this trail of breadcrumbs, and after a thorough investigation discovered that since the VirtualBox v6.1.30 update (a patch update, irony of ironies) HostOnly adapters have had to receive a different range of IP addresses:

192.168.55.х before the update

192.168.56.х after the update.

There it was hidden in plain sight in VirtualBox’s updated user manual:

 “On Linux, Mac OS X and Solaris, Oracle VM VirtualBox will only allow IP addresses in 192.168.56.0/21 range to be assigned to host-only adapters.”

User Manual

This was definitely an aha moment for everyone. After creating a new HostOnly adapter and replacing the one in the VirtualBox instance, the problem magically disappeared, the required web portion of the solution became suddenly accessible again and Developer 2 was finally content.

*Phew*. So that was finally dealt with, but the entire ordeal reminded us of the memetastically iconic Phyllis:

Phyllis "Works on My Machine" Meme

May she live forever.

Related Stories

image-02-2
March 31, 2017

Coloured Envelopes

sp_project_dealster_shadow_1
July 9, 2018

Our Stories: The Boy Who Coded