Thursday, September 11, 2014

Optimize AX 2013 R3 Virtual Machine Solution Demo On Laptop

Table of Contents
Chapter
1

Preface

Who need to read this tutorial.
This tutorial  is for all Dynamics AX professional, Technical – Functional – Project manager – Sales manager, who wants to have Dynamics AX 2013 R3 Solution Demo application in a laptop.
P
rogrammer time to time would like to check how is the standard application class to compare customer’s instance with standard AX before any modification. Consultant need to test some of the standard functionality without using customer data or exploring some functions directly from laptop without remote to office. Or sales manager who want to do preparation for a demo to customer. These are most common example why Dynamics AX professional need this VM in his/her laptop.
Most professional  usually download the demo virtual machine from microsoft partner source, and use Vmware, Virtual Box or Hyper-V in their main laptop. Mount the vhd to the virtual machine application and spend three hours to configure the setting before the virtual machine can be used.
The moment virtual machine is ready then everyone realize his 8 GB RAM can’t run it fast enough. The virtual machine is too slow to do anything. Upgrading to 16 GB RAM is not helping either,  the laptop is forced to run two OS at same time. The main OS windows 7/8 and a hungry-resource-virtual-machine Windows server 2012 complete with AOS server, Sharepoint server, SQL server, SQL Server Reporting Service, SQL Server Analytal Service and you name it. Some of these applications are I/O hungry application which is known not running well in virtual environment.

What is the solution?

If you have budget the easier is to upgrade your RAM to 24GB/32GB but I know very limited laptop model in current market can support such upgrade. This RAM upgrade will cost you around 300-500 USD.
Let say most common laptop people have doesn’t support 24GB/32GB, the next option is to buy a super laptop with 32 GB RAM and be prepared to have around 3,000 USD in your pocket.

What is cheaper solution?

Well this is my usually I do to maximize 8GB/16GB hardware to run virtual machine, fast enough to satisfy me. My solution is to setup Dual Boot OS, one for my main OS (Windows 7/8) and another one for Windows Server 2012 to host Dynamics AX 2012 virtual machine.

30 minutes setup time

Yes you read it correctly. It is about 30 minutes to setup. It is how easy this method and why I call it cool trick.

Is it too technical for me?

Fortunately it is easy enough to follow and you don’t have to be a very technical person to do it as long as you follow it step by step.


Chapter
2


Tutorial content

This is the content of tutorial. If you have a question please don’t hesitate to email me at cws@ax-excellence.com

Step 1 Download the material to your harddisk

Download and extract the virtual machine file from partner source, link below:


Step 2 Extraction

You will have 26 files from the download page. Extract this into a folder.


After extraction you should have 2 VHD like below:

Step 3. Attach your VHD to windows 7 from Disk Management

Click Windows>Computer>Right click Manage.
Right click Disk Management>Attach VHD
Locate Dynamics AX vhd from previous extraction (AX2012R3A_OS.vhd)
System then will assign new drive letter to the VHD. For my case it is H: drive.


Step 4 Create multiple boot

Open command prompt. Click windows>type command on search box>choose command prompt>right click>Open as Administrator.
Following command prompt will appear:
Back up your bootfile with following command (type it and press enter)
bcdedit /export bcdbackup.bak
C:\Users\indra\AppData\Local\Temp\SNAGHTML360a8b.PNG
Then now the important part creating the dual boot, enter following command (the H drive depends on the driver letter assigned on previouse step)
Bcdboot H:/windows
When you restart computer you should see boot for Windows 7 and Windows Server 2012
Choose the Windows Server 2012 to start and login with Microsoft demo account:
Username: contoso\administrator
Password: pass@word1

Step 5 Adding Contoso\Administrator to perform volume management

Once you login to Dynamics AX 2012 R3 VM environment, you need to add the admin to perform volume management
This is a bit technical to explain and to simplify my tutorial I don’t want to explain too much on this. but you got to do this.
Go to administrative tools>Open Group policy management

Look for below node, right click edit
On this page find for below node and add Contoso\administrator to it.


Step 6 Change the Windows 7 OS Drive letter

By default the vhd file become your C: drive and the main disk (C: drive of your windows 7 become E: drive). We need to change this E: drive to something else because we need E: drive for the data for VM.
Download a tool and extract to your local drive.


Run it and change your E: drive to P Drive like below:


Step 7 Attach the data (2nd Vhd to E: \Drive)

Still remember the 2nd Vhd file AX2012R3A_Data.vhd. Well we need that file now.
Open your notepad, type below (according to your file location) then save it as “attachvhd.txt” and save to your C:\ drive.
select vdisk file='P:\VM\AX2012R3_2\AX2012R3A\Virtual Hard Disks\AX2012R3A_Data.vhd'
attach vdisk
assign letter=E
Create another file and save it as “attachvhd.bat”. Type following inside the file.
diskpart /s "c:\attachvhd.txt"
Open your task scheduler and create new task to run AttachVHD.bat after restart:
Restart your computer and you are ready to go.


Step 8 Change host file

Dynamics AX enterprise portal won’t work at the moment. To make it work simply add following two lines into your host file:
127.0.0.1 dynamicsax.contoso.com
127.0.0.1 sharepoint


Credit

Chandra Setiawan / Dynamics AX Consultant 
Company / AX Excellence Pte. Ltd.    
Email   / cws@ax-excellence.com

Skype / Chandra.wijaya.setiawan

16 comments:

  1. After following the above steps i had problem with starting AX services. Then i mailed CHandra Setiawan.
    Below is my Mail :
    -------------------------------------------------------------------------------------------------------------------------------------------
    Greetings,

    First of all thank you very much in helping me to install demo AX 2012R3 in very optimal way. I have followed your instruction step by step. everything was working fine. But when am trying to start services for AX am getting the following error.

    Error 1068: the dependency service or group failed to start.

    when I clicked AOS properties in services I found the dependency services are RPC(remote procedure call) and MSSQLSEVER.

    So what I understood is the dependency services did not start.

    If am correct can you please help me out how to resolve the issue ??

    Thanks in advance,
    Samanth.
    -------------------------------------------------------------------------------------------------------------------------------------
    Response from Chandra:

    You can start manually the sql service and the rpc service then.
    (it maybe the sql service can’t start because you haven’t attached the second vhd to “E” Drive?)

    Before you can start the aos service.

    And I recommend in service to turn the “VM Profile” to manual start. By default it is automatic.
    --------------------------------------------------------------------------------------------------------------------------------------------

    Then i followed his guidance and found the VM profile in Task Scheduler which we set up as start when computer starts is not runnning. We have to manually start the task. this helped resolving my problem. Thought sharing so may usefull for someone .

    Thanks,
    Samanth

    ReplyDelete
  2. Hi Samanth,
    I would like to add the task scheduler not working during restart of server due security options on the task scheduler.
    You must select "Run whether user is logged on or not"
    The reason is during the restart of PC, no body is logged on into the Server.
    Then the attach vhd will fail.

    By selection the option then it should run during restart regardless someone logged on or not into the server.

    I hope it can prevent you to run the scheduler manually everytime you restart the server.

    Cheers,

    Chandra

    ReplyDelete
  3. Hi Chandra.

    In my system Enterprise Portal is not working though i followed the last step you mentioned. Could you please help me with this. Is there any connection i missed ?

    Thanks,
    Samanth

    ReplyDelete
  4. Have you modify your Host file?
    and check also your sharepoint services. Make sure all of them are running.

    The last you may try to run command prompt and do iisreset

    ReplyDelete
  5. Hi Chandra,
    I am getting below message.
    C:\Windows\system32>bcdboot J:/windows
    Failure when attempting to copy boot files.


    below help me to resolve.

    ReplyDelete
    Replies
    1. hi ,
      i solved the problem .

      C:\Windows\system32>bcdboot c:\windows /s j:
      Boot files successfully created.

      Delete
  6. This comment has been removed by the author.

    ReplyDelete
  7. When booting windows server 2012 r2 I get an error message windows failed to start

    ReplyDelete
  8. Asking for a installation disc -required file is missing

    File: windows\system32\winload.exe

    Status: 0xc000000f

    ReplyDelete
  9. Chandra,
    I have followed your instructions. I am running a Dell 71347 laptop with an Intel i5 chip. 4 cores. and 8gb of Ram.

    Everything boots up fine and SQL Server is runningand so is RPC. When I try to start the AOS server through services i get the following error:
    Error 1053: The service did not respond to the start or control request in a timely fashion.
    or it hangs in the starting state.
    I looked through the error logs and it appears that DCOM cannot connect to the subnets of Contoso.com. When I start Dynamics AX it says the server is not available.

    Any thoughts?

    Chuck

    ReplyDelete
  10. This comment has been removed by a blog administrator.

    ReplyDelete
  11. Hi Chandra,
    May I ask how you extracted the 26 files downloaded from the MS PartnerSource? I've tried extracting them with winrar & 7zip without success. Thanks so much in advance!
    Br, Serena

    ReplyDelete
  12. Hi Serena, of the 26files there is one file which is of type application, it is a self extracting exe. Double click that file and it unzips the hard disks using the part files. -Sohena

    ReplyDelete
  13. Hi Chandra,
    Does this steps works on Windows 8 (or 10) ?
    I tried on Windows 8, after attachVHD for the OS ( lets say it give me drive k: ) and change bootfile, when I restart, no options for boot and after log in again to my Windows 8, I noticed the new drive for the OS is gone.

    Kindly help,

    Regards,
    Zhong

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. Hi Chandra,
      Problem with the 1st AttachVHD (for the OS) is solved.
      It give me a nightmare for days until I realize it was a simple typo error --> Bcdboot H:/windows, it supposed to be "backslash" ("\"). It is correct in your capture picture but not in the text above it.
      Thanks

      Delete