Embedded software testing is a hot topic in software testing field. It is a challenge to enhance the generalization, portability, and maintainability of embedded software testing environment (ESTE). In this paper, by applying virtual machine technology into embedded software simulation testing, a custom-build embedded software simulation testing virtual machine (ESSTVM) which is composed of data type, memory management, task management, communication, testing instruction set and testing files is presented firstly. And then, ESSTVM was applied in design of avionics software testing environment (ASTE). Based on the description of architecture of ASTE, the design and implementation of the testing development system and testing execution system are put forward. Practical application of ASTE in engineering shows that the method can improve the generalization, portability, and maintainability of ESSTE effectively. Next research steps are put forward to improve the real-time capacity and efficiency of testing execution system and extend it to be distributed.