Access the VM of D365FO on the local home network
If you develop on D365FO and work from home, you may have a virtual development machine on your computer (“host”). In this case, when you want to try something, you have to do it from the same host computer.
If for some reason you need to test, or even develop, from another “client” computer (for example: you have the VM hosted on a relatively old computer but you move around at home with your laptop, or the VM is hosted on a professional computer but you have your personal laptop), you can access the VM from your “client” computer as if you were on the “host”.
To do this, you will need
Access to the virtualization manager of the host computer (in this example, it is Hyper-V)
Access to the home router (administration user and password)
Your “client” computer
It may also be that the MV you work with is not in your home, but is, for example, on your company network, to which you connect by VPN. In that case, you will only need to know the IP address of your VM and make adjustments to your client machine.
With a few adjustments, you’ll have it.
Settings on the “host” computer
Assigning a static MAC to the WV
With these settings we will set a physical address to the virtual machine and make its network traffic be managed by the router just as if it were a “physical” machine. They are oriented to the Hyper-V virtualization platform, but any other platform should have an equivalent.
- Create a new Virtual Switch in Hyper-V. This step is optional and we can use the one we already have, but it will allow us to control it separately in the “host” machine and go back easily in case of “disaster”:
From the Hyper-V administrator, create a new external virtual switch, selecting as “physical” network interface the one we usually use (in this case, the Wi-Fi network). Once created, we should see this in the virtual switch manager:
We go back to the VM configuration and in “Network adapter”, we change the virtual switch to use the one we just created. We leave “Enable virtual LAN identification” and “Enable bandwidth management” blank:
- Under “Network Adapter > Advanced Features”, we assign a static MAC (physical address) to the VM, and leave “Enable MAC Address Impersonation” blank. It can be a random one, or any other as long as it does not conflict with an existing one. In my case, I have chosen a simple one to remember (AA:00:BB:11:CC:22):
At this point, if we have done it right, the VM will behave, from the outside, exactly like a physical machine, and will use the same gateway as its physical host machine (usually the home router).
Assigning a fixed IP to the VM
The next step is to make sure that when the VM boots it always has the same IP address assigned within our local network, and to be able to reference it from any device connected to our LAN, and not just from the “host” machine. To do this:
- Assign fixed IP within the LAN of the home router for the VM MAC. You may have done this before. If not, you have to:
- Find out the IP of the router. It is the gateway of any device connected to it. To do this, open a command window (exe), launch the ipconfig command, and look up the IP address of the gateway (in IPv4 format):
Or, even simpler, launch a traceroute(tracert.exe) somewhere well known. The address of the first jump should be your router:
- Access the router configuration. There are some models that allow to do it by Telnet or SSH, but the normal thing is that they have a web interface. If this is the case, we open a browser to the address http://RR.RR.RR.RR, where RR.RR.RR is the gateway address we have obtained above. Once we enter the configuration, we must look for the option “DHCP assignment”, “static DHCP” or equivalent of the router (this already depends on the router model) and activate it:
and choose an IP address that is not already occupied within the router’s address range. We will assign this IP address to the MAC address we have assigned in step 2.
Normally, routers are configured for the address range 192.168. In my case, I have assigned it to the range 172.16.X.X, and I have chosen the address 172.16.1.15 for the physical address of the VM:
Save the settings you just made. You may have to reboot your router to make them effective. Good time for a little break…
Settings on the “client” computer
The aim of these settings is that from the “client” computer you can reference the VM with its DNS name (usnconeboxax1aos.cloud.onebox.dynamics.com).
Modify Windows host file
- Modify DNS entries on the client computer. This will allow us to connect directly to the VM without having to be physically at the host machine that hosts it when we try to access the D365FO web client by its URL (https://usnconeboxax1aos.cloud.onebox.dynamics.com/).
To do this, we open with a text editor (in administrator mode, if not, it will not let save it later) the Windows hosts file (usually located in C:\Windows\System32\drivers\etc\hosts), and add the following entries:
# VM 365FO
XX.XX.XX.XX is the IP address that we have assigned to the VM in step 3, or that we have been given to access if the “host” computer is not at home.
After this, we should already be able to access, from our client computer, to D365FO from the browser, with the same credentials that we use from the physical host machine:
Additionally, you will be able to work “remotely” (from your “client” computer) by making Terminal server against the development VM, just as you would do from the host computer when connecting to the VM: