Heterotrophic bacteria play a vital role in carbon cycle in oceans and viruses are an important regulator of bacterial metabolism and community composition. It remained unclear about how bacteria‐virus interactions varied with environmental conditions in oceans. In this study, bacterial metabolic activity and community composition were examined in three treatments with different viral pressure (control, virus‐rich and virus‐reduced) through bioassay experiments at three stations with different environmental conditions in the shelf of the northern South China Sea. Our results showed that bacteria‐virus interactions varied with environmental conditions. Viral lysis mediated bacterial growth rate and production by shaping bacterial community composition. Furthermore, viral lysis to less extent reduced bacterial growth rate and production in the substrate‐rich waters than substrate‐low waters. However, the opposite pattern occurred for viral regulation on bacterial respiration and carbon demand, likely since viral lysis dramatically mitigated the maintenance respiration of bacteria. Consequently, viral lysis to greater extent mitigated bacterial carbon processing in substrate‐rich environments than in substrate‐low environments. Our findings provided new insights into bacteria‐virus interactions, and improved our understanding of the role microbial processes in carbon cycling in oceans.