Objective: In the complex domain of metro tunnel construction, shield-machine station traversal represents a critical operational phase. Within these confined subterranean spaces, the sheer volume and mass of the shield machine pose substantial safety risks, particularly the risk of collisions with the main tunnel structure or peripheral temporary facilities. The clearance between the machinery and the tunnel walls is often minimal, rendering the operation extremely hazardous. As physical rehearsals for such large-scale operations are cost-prohibitive, logistically complex, and difficult to replicate under varying conditions, conventional risk management strategies have typically relied on limited sensor data and manual measurements. However, these methods are inherently labor-intensive and lack adequate real-time perception capabilities, providing only discrete data points rather than a continuous, holistic view of spatial relationships within the tunnel. Furthermore, purely virtual simulations often fail to accurately capture the complex, dynamic, and unscripted characteristics of the actual construction environment. To address these significant limitations, this paper reports a novel simulation method based on in situ virtual-real interaction, designed to provide real-time, high-precision risk early warning and decision support specifically during shield-machine station traversal. Method: First, multisource design data of the shield machine were fused with on-site sensing information to construct high-fidelity, drivable virtual models of the shield machine and the construction environment using lightweight processing techniques and multilevel-of-detail modeling. These models were subsequently optimized for real-time rendering. Second, a robust markerless three-dimensional registration algorithm based on mixed reality technology was applied. This enabled high-precision spatial alignment of the virtual models with the physical environment without requiring intrusive physical markers, thereby ensuring dynamic synchronization of virtual and real scenes. To further enhance accuracy, the system integrated multisource data, including inertial measurements, inclination sensing, and guidance system inputs. By incorporating these inputs into an extended Kalman filter, the system obtained a stable, real-time solution for the six-degrees-of-freedom pose and motion simulation of the shield machine, effectively mitigating sensor drift. Simultaneously, a comprehensive collision-detection mechanism was established using the Unity physics engine. By implementing a mixed configuration of rigid bodies and triggers, the system achieved real-time interference identification for static and dynamic obstacles, facilitating multimodal warning feedback and forming a closed-loop system encompassing perception, simulation, and early warning. Result: The proposed system was subjected to rigorous field validation in an actual engineering project at the Beijing Pinggu metro station. The results demonstrated that the system achieved a virtual-real spatial registration accuracy of ±4.5 mm within a 30 m test section. The core collision-detection latency was < 6 ms, and the rendering frame rate remained stable at 45 fps, ensuring a smooth visual experience for operators and excellent real-time stability. In diverse complex scenarios, including static obstacles, unpredictable dynamic personnel intrusions, and cluttered temporary facilities, the system consistently triggered real-time highlighting warnings for collision zones. Conclusion: Compared with conventional manual measurement methods, this approach significantly improved inspection efficiency, effectively enhancing risk-identification accuracy and real-time responsiveness. Furthermore, it substantially mitigated personnel safety risks and potential economic losses associated with equipment collisions and project delays. The simulation method based on in situ virtual-real interaction proposed in this paper overcomes the real-time and precision limitations of conventional techniques. By enabling proactive identification and immediate warning of potential collision risks, it transforms risk management from a lagging, passive mode into a proactive one characterized by risk anticipation and intervention. Ultimately, this approach significantly enhances construction safety and economic efficiency while providing a reliable technical pathway and decision-making basis for advancing intelligent risk management and digital twin applications in complex underground engineering projects.