Skip to content

Instantly share code, notes, and snippets.

@joshlawton
Last active September 1, 2023 17:44
Show Gist options
  • Save joshlawton/b9863eba28c61ae92be3 to your computer and use it in GitHub Desktop.
Save joshlawton/b9863eba28c61ae92be3 to your computer and use it in GitHub Desktop.
Access Yeoman app from a Win7 guest VM powered by Parallels 10 (Mac host)

Parallels Desktop 10 for Mac

  • Configure > Hardware > Network 1 > Type: Default Adapter
  • Preferences > Advanced > Network: Change Settings > select Shared and click 'Okay'

Grunt Server

In your app's Gruntfile.js or ~/grunt/config/server/connect.js, set connect server's hostname in the options to * to allow access to the server from anywhere. Unless otherwise changed, the default hostname is set to 0.0.0.0. (Based on my understanding, 0.0.0.0 will allow connections from any source on the same network adapter, whereas * will allow connections from any and all other network adapters--such as Parallels.)

var taskConfig = function(grunt) {
  grunt.config.set('connect', {
    options: {
        port: 9010,
        livereload: 35729,
        hostname: '*'
    }
  });
};

Configure host file with IP address

Get IP of host (Mac OS X)

$ ifconfig "vnic0" | grep "inet "
inet 10.211.55.2 netmask 0xffffff00 broadcast 10.211.55.255

vnic0 is the first of two virtual adapters installed by Parallels.

The IP address following inet e.g., 10.211.55.2, is the IP to use inside the Win7 VM to access your Yeoman app on OS X.

So, if on your Mac you use http://127.0.0.1:9010/project/index.html, use http://10.211.55.2:9010/project/index.html in Internet Explorer.

Add IP to host file

For convenience, you can add an alias to the host or guest machine in your system's hosts file.

  • File location on Mac OSX: /etc/hosts
  • File location on Windows: C:\Windows\System32\drivers\etc\hosts

Hat tip: https://gist.github.com/micjamking/18e4e3ad40fa919c7659

Further reading/references:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment