The variational formulation for a fluid plasma including the parallel and gyroviscosities is developed using the basic approach of Berk et al. [Phys. Fluids 24, 2245 (1981)]. The equivalence of the variational problem to the original viscous fluid equations of motion is shown. The theory is developed for an axisymmetric plasma with no magnetic field in the azimuthal direction and therefore applies to field-reversed configurations and axisymmetric mirrors. This theory offers the advantage of describing both parallel and transverse ion kinetic effects within the simplicity afforded by a variational fluid model.