The effect of viscosity on the longwave Kelvin–Helmholtz instability of two immiscible incompressible fluids under horizontal vibrations is considered. The linear stability boundaries are found analytically using series expansion in terms of small wavenumber. The values of parameters, at which a transition from the longwave to finite-wavelength instability takes place, are determined. It has been shown that for high-frequency vibrations a viscous dissipation has just a weak destabilizing effect. At vibrations of moderate frequencies, destabilization is more significant, especially in the systems with large viscosity contrast. In contrast to that, at low frequencies the viscosity stabilizes the basic flow by suppressing the longwave perturbations.