Bipedal walking is a complex phenomenon that is not fully understood. Simplified models make it easier to highlight the important features. Here, the variable length inverted pendulum (VLIP) model is used, which has the particularity of taking into account the vertical oscillations of the center of mass (CoM). When the desired walking gait is defined as virtual constraints, i.e., as functions of a phasing variable and not on time, for the evolution of the swing foot and the vertical oscillation of the CoM, the walk will asymptotically converge to the periodic motion under disturbance with proper choice of the virtual constraints, thus a self-stabilization is obtained. It is shown that the vertical CoM oscillation, positions of the swing foot and the choice of the switching condition play crucial roles in stability. Moreover, a PI controller of the CoM velocity along the sagittal axis is also proposed such that the walking speed of the robot can converge to another periodic motion with a different walking speed. In this way, a natural walking gait is illustrated as well as the possibility of velocity adaptation as observed in human walking.