title: How to access localhost from on android emulator inside a VM?
body: <p>I know the question sounds a bit confusing but here we go.</p>
  
  <p>I am using an Azure VM to develop a cross platform app (Xamarin) and the app needs to utilise a .net core web API. </p>
  
  <p>I am using a Google Emulator that has access to the internet.</p>
  
  <p><strong>What I have tried -</strong></p>
  
  <p>I have tried google emulators default connection 10.0.2.2:"MY WEB API PORT"/swagger. The result I get is "Bad request - invalid hostname"</p>
  
  <p>I have tried a lot more but with no avail.</p>
  
  <p>Any help is much appreciated. </p>