Saturday, November 11, 2017

Guest OS Web Server Access

In the latest project in my new role, I am developing with Angular 4/5 on Windows 10 hosted within Parallels on a Mac. Yes, I have a Mac now. What is the world coming to?
I needed to test some new functionality of the web app in a variety of operating systems and browsers. I figured it shouldn’t be too difficult to access the web server on the Guest OS, since the Apple mantra has always been “it just works”. Unfortunately, it didn’t just work.
There are numerous entries in the search results about trying to access the web server on the Host OS from the Guest OS, but I needed to do the opposite. I need to access the web server on the Guest OS from the Host OS. I eventually pieced together the following steps, in case you run into the same issue.

Bridged Mode Networking

To make it easier to access the Guest OS web server from not just the Host OS, but other machines, I enabled “Bridged Mode” networking for the Windows 10 virtual machine. The Windows box now gets an IP address directly from my LAN instead of being NATed through the macOS Host.

Open Port in Firewall

The application is being served on a non-standard port for HTTP, so I had to open that port in the Windows 10 firewall settings. The port to open will depend on the settings for your project.

Listen on All Interfaces

By default, Angular only listens on the localhost interface (see host option for ng serve). This may be due to the fact that in Windows, localhost is a separate network interface, but this means that, at least in Windows, Angular will not receive requests from other machines – including, but not limited to, the Host OS. I added “--host” to the ng serve command for the app to force Angular to listen on all network interfaces.


I can now access my Windows 10 Guest virtual machine from the macOS Host to test in Safari. More than that, I can also access the Windows 10 VM from other devices on my LAN including my phone for testing in a mobile browser.
If this helps you or if you have additional troubleshooting tips, leave a comment below.

Friday, November 10, 2017

A Recap

First, let me address the elephant in the room…yes, it has been quite some time since the last post. Since this is not primarily a lifestyle blog, I will not go into details, but instead offer a high-level recap. Over the past 5 years I became lead of a support team, went through 2 corporate reorganizations that involved significant team changes, moved to another city, transitioned to full-time telecommuting, and then, most recently, changed jobs.

Which brings me to today. My intent with this blog was to provide a scratch pad of issues I run into with the hope of helping others that may also be having the same or a similar problem.

In my new role, I will be creating new software rather than supporting and maintaining software that someone else wrote and I will be using newer technologies. As such, I will be back to encountering new problems to solve which means that I may be posting on a more frequent (though not necessarily regular) basis.