Results of studies of the oscillations of pipelines conveying a two-phase slug flow are presented in the paper. A viscoelastic model of the theory of beams and the Winkler base model are used in the study of pipeline oscillations with a gas-containing slug flowing inside. The Boltzmann-Volterra hereditary theory of the viscoelasticity is used to describe the viscoelastic properties of the pipeline material and earth bases. The effect of gas and liquid phases flow rates, influence of tensile forces in the longitudinal direction of the pipeline, parameters of Winkler bases, parameters of singularity in the heredity kernels and geometric parameters of the pipeline on the oscillations of structures with viscoelastic properties are numerically studied. It is revealed that an increase in the length of the gas bubble zone leads to a decrease in the amplitude and oscillation frequency of the pipeline. The critical rates for a two-phase slug flow are determined. It is revealed that an increase in the soil density of the bases leads to an increase in the critical rate of gas flow. It is shown that an account of viscoelastic properties of structure material and earth bases leads to a decrease in the critical flow rate.