Container running on Virtualbox can't make an XHR request to a resource within workplace network

I am trying to write a WordPress plugin and am developing using Local by Flywheel. This software basically creates a virtual machine for itself with the necessary settings pre-configured for PHP and MySQL. Then, it launches two docker containers within that VM. One for Nginx, and the other is unclear.

When I open up my browser, I am able to develop on my WordPress instance.

I am trying to make a plugin which goes through an OAuth flow. To do this, it needs to be able to do the typical steps OAuth requires, using some endpoints. When I check my PHP logs, I find an error:

[08-May-2019 14:42:42 UTC] Response Code ""
[08-May-2019 14:42:42 UTC] Headers []
[08-May-2019 14:42:42 UTC] Body ""
[08-May-2019 14:42:42 UTC] Response successful: {"errors":{"http_request_failed":["A valid URL was not provided."]},"error_data":[]}

For the following code:

function cm_sso_token_swap(WP_REST_Request $request)
{
    $authCode = $request->get_param('code');
    $tokenSwapResponse = wp_safe_remote_post(CM_SSO_TOKEN_ENDPOINT, array(
        'timeout' => 15,
        'headers' => array('content-type' => 'multipart/form-data'),
        'body' => array(
            'grant_type' => CM_SSO_GRANT_TYPE,
            'code' => $authCode,
            'redirect_uri' => $redirect_uri,
            'client_id' => $client_id,
            'client_secret' => $client_secret,
        ),
    ));

    var_dump($tokenSwapResponse);

    if (is_wp_error($tokenSwapResponse) || !strpos($tokenSwapResponse['body'], "SUCCESS") === 0) {
        error_log($tokenSwapResponse->get_error_message());
        error_log('Response Code ' . json_encode(wp_remote_retrieve_response_code($tokenSwapResponse)));
        error_log('Headers ' . json_encode(wp_remote_retrieve_headers($tokenSwapResponse)));
        error_log('Body ' . json_encode(wp_remote_retrieve_body($tokenSwapResponse)));
    }

    error_log('Response successful: ' . json_encode($tokenSwapResponse));

    return new WP_REST_Response(json_encode($request->get_params()));
}

Regardless for which endpoint I use. I also verified the problem by attempting to POST to our public facing website, which returns fine. But then posting to a completely unrelated internal app returns this same error.

Which leads me to believe that the Docker container / VM is not configured with the appropriate internal DNS that my host machine is configured with.

I’m able to get exec into the shell of the VM as well as the docker container(s) themselves.

Would I be able to run the containers in the VM shell in such a way where they would have the correct nameservers? Is it as simple as a networking setting in the VM menu? I’m not sure about where or what I would need to do here to get my XHR’s to be able to recognize these internal endpoints!