First attested in Pei Songzhi's commentary on the 《
三国志·
管辂传》(Sānguózhì·Guǎn Lù zhuàn, Records of the Three Kingdoms, biography of the diviner Guan Lu):
魂不守宅 ('the soul does not guard its dwelling'). The diviner reads this in another official's face as a sign of imminent death. From there it broadened to its modern sense of distraction or extreme fright.