Visual cortical neurons fire at higher rates to visual stimuli during locomotion than during immobility, while maintaining orientation selectivity. The mechanisms underlying this change in gain are not understood. We performed whole-cell recordings from layer 2/3 and layer 4 visual cortical excitatory neurons and from parvalbumin-positive and somatostatin-positive inhibitory neurons in mice that were free to rest or run on a spherical treadmill. We found that the membrane potential of all cell types became more depolarized and (with the exception of somatostatin-positive interneurons) less variable during locomotion. Cholinergic input was essential for maintaining the unimodal membrane potential distribution during immobility, whereas noradrenergic input was necessary for the tonic depolarization associated with locomotion. Our results provide a mechanism for how neuromodulation controls the gain and signal-to-noise ratio of visual cortical neurons during changes in the state of vigilance.