In this paper, we present a virtual oscillator control (VOC) strategy for power inverters to operate in either grid-connected or islanded settings. The proposed controller is based on the dynamics of the nonlinear Andronov-Hopf oscillator and it provides voltage regulation, frequency support in islanded mode. It also features the potential to respond to real- and reactive-power setpoints for dispatchability in grid-connected mode. In contrast to early VOC incarnations which exhibit undesirable harmonics, the proposed controller offers a sinusoidal ac limit cycle as well as improved dynamic performance. Moreover, the proposed controller intrinsically generates orthogonal signals which facilitate implementation in three-phase systems. We study the controller dynamical model and outline a systematic design procedure such that the inverter satisfies standard ac performance specifications. Numerical simulations validate the analytical developments.