An unreasonable design of the pipe support between a utility tunnel and the pipe can result in a large deformation of internal pipes under seismic action. In this study, aiming at the seismic response problem of pipes inside a utility tunnel passing through nonhomogeneous soil, a shaking table test and a finite element simulation were conducted. First, the boundary effect caused by the laminated shear box was studied, and the influences of the pipe acceleration, longitudinal and transverse relative slippages, the form of the pipe support, and the pipe material on the pipe deformation were analyzed. Finally, the attenuation effect of the acceleration peak response of the internal pipes and the attenuation law of the energy transmitted to the pipes were obtained. The results showed that the attenuation degree of the energy transmitted to the pipes was more than 80%; the longitudinal relative slippage of the pipes caused by the high-amplitude segment of the input acceleration was generally significant; the vibration isolation effect of the side-wall angle steel support on the pipeline was stronger than those of other supports. This paper provides a basis for the seismic design of pipelines inside a utility tunnel.