Configuring VirtualBox for SharePoint-Hosted Apps
By Anatoly Mironov
Recently I have switched from VMWare to VirtualBox for my SharePoint Development. So far it really works good. I have prepared this guide for configuring VirtualBox for SharePoint-hosted apps. That means we need a new adapter with a static ip address. All the steps done inside the virtual machine are applicable for VMWare and Hyper-V, too. This guide does not cover the full configuration of the app environment, it covers only the network and dns settings needed for SharePoint-hosted apps on Premises in a Development machine.
In VirtualBox open Preferences:
In Preferences, click on Network, then on Host-only Networks, click on “plus”
After a new host-only Network adapter has been created, click on the screwdriver image to configure the network:
Remember this ip address, you can alter it, of course. Or use this: 192.168.64.1, then you can have the same settings in your environment as I have:
Go on to the settings for your Virtual Machine. Enable Adapter 2, as shown on the picture below.
The rest are the settings in your virtual machine. Open Network Connections in the Control Panel. For the newly added Network Adapter (Ethernet 2), open Properties:
Then open Properties for “Internet Protocol Version 4 (TCP/IPv4)”
Remember the ip address for you VirtualBox host-only Network? I have 192.168.64.1. Increment the last number (192.168.64.2) and use it as the ip address for your adapter. The default gateway is 192.168.64.1 as the the VirtualBox host-only Network. The DNS Server should be the same as the virtual machine, the same adapter: 192.168.64.2:
Open DNS Manager, right-click on Forward Lookup Zones and start the New Zone Wizard by clicking on “New Zone…”:
Follow the steps in the wizard:
Choose “Primary Zone”:
Keep the default setting: “To all DNS Servers running on domain controllers in this domain:
Write your app domain. I use takanaapps.local:
Choose “Do not allow dynamic updates”:
Then finish the New Zone Wizard:
In the new forward lookup zone (takanaapps.local), add a new wildcard cname entry (alias):
Just add an asterisk and point it to your main domain (takana.local in my case):
After that you should be able to ping any subdomains of your app domain (xyz.takanaapps.local, abc.takanaapps.local):
When you start adding apps to your sites, you should add app sites to your local intranet zone (to be automatically signed in in apps webs). This setting in IE will affect Chrome as well. Go to the Options in the Internet Explorer:
In the Security tab -> Local Intranet, click on Sites:
Click on Advanced button:
Add your new app domain with an asterisk in front of it to the “Websites” of the Local Intranet:
Sources
- Keith Beckman: VirtualBox: Configuring Static IPs for VMs
- Technet: Configure an environment for apps for SharePoint (SharePoint 2013)