Hi RamyaMeruva, please see the attachments.
Also, I use glassfish 4.12, and the example VM scripts to build appserver(some changes for glassfish 4.12). And I use the domain.xml generated, not the one contained in the examples package.
I noticed that there is a field named "Host name=local host", should I replace localhost to "appserver", since I deleted localhost in the /etc/hosts file.