A variational framework is developed to examine the equilibrium states of a semiflexible polymer that is constrained to lie on a fixed surface. As an application the confinement of a closed polymer loop of fixed length 2πR within a spherical cavity of smaller radius, R 0 , is considered. It is shown that an infinite number of distinct periodic completely attached equilibrium states exist, labeled by two integers: n = 2, 3, 4, . . . and p = 1, 2, 3, · · · , the number of periods of the polar and azimuthal angles respectively. Small loops oscillate about a geodesic circle: n = 2, p = 1 is the stable ground state; states with higher n exhibit instabilities. If R ≥ 2R 0 new states appear as oscillations about a doubly covered geodesic circle; the state n = 3, p = 2 replaces the two-fold as the ground state in a finite band of values of R. With increasing R, loop states make a transition from oscillatory and orbital behavior on crossing the poles, returning to oscillation upon collapse to a multiple cover of a geodesic circle (signaled, respectively, by an increase in p and an increase in n). The force transmitted to the surface does not increase monotonically with loop size, but does asymptotically. It behaves discontinuously where n changes. The contribution to energy from geodesic curvature is bounded. In large loops, the energy becomes dominated by a state independent contribution proportional to the loop size; the energy gap between the ground state and excited states disappears.