The story begins something like this:
During Northern Song Dynasty, the 30th Heavenly Master just completed his meditation and suddenly he heard loud thunder roaring followed by lightning strokes across the sky. The sky immediately covered by thick black cloud. Looks like it is going to rain.
The master walked out of his meditation room and he raised his head and look at the sky. He felt that something was abnormal that day. So he made a hand calculation and concluded that there must be some demonic entities at work.
Just as he was in a deep thought, a young beautiful girl in yellow shirt suddenly knelled down in front of the master while panting. She took a bow and said in tears: "Heavenly master, please help me."
"Who are you? Speak with honesty!" The master said with grim face.
The pretty yellow shirt lady said with trembling: "I am a fox spirit who has practised for 2000 years nearing attain accomplishment. This is the reason that the Heavenly Court ordered the thunder god couples to kill me. Please be compassionate and save my life." She kowtowed while spoke out the master.
"All demons must be killed. If I save you I would be leaving troubles to the temple." The master scolded.
"Heavenly Master, I am not afraid to die. I am pregnant and will give birth soon. If the Heavenly Court chopped my head; my innocent baby will be killed too..." The fox spirit continued to weep and cry.
At this juncture, the master started to feel pity and thought: "Although fox spirits are disgusting, the fox baby should not be involved. If the fox spirit can repent and be good, it will also be a good deed too."
So, the master said to the fox spirit: "If and only if you promise me 3 things."
"What 3 things may I asked?" She asked.
"First, eat only vegetables and refrain from killing. Secondly, stay secluded from human beings. Thirdly, engage in dharma practices for the benefit of people." The master said.
The fox spirit immediately took her vow and promised that if she has breached any of the items, she shall be killed.
The master saw that the fox spirit has repentant heart, so immediately ordered she to accept precepts. After that he went to the Grand Master's Hall to pray to the Heavenly Court.
When the Jade Emperor heard the Heavenly Master's prayer, He ordered the thunder gods not to look for the fox spirit further.
Soon, the sky became clear again.
The fox spirit thanked the Heavenly Master and secluded herself in the Yuntai Mountain (云台山). It consume only wild fruits and continued her dharma practices as promised. Soon, the fox spirit gave birth to a fair and chubby baby girl named 'little white fairy' (小白仙).