The sailing posture of AUV in water will be affected by the density, depth of seawater and so on. The sailing posture of AUV will be changed when crossing the waters of different hydrological environment. For maintaining a good sailing posture of AUV, we designed a variable buoyancy system. The variable buoyancy system can change the buoyancy of AUV by changing the oil of the outer oil sac to ensure that AUV can get a good posture. We can get a series of test data by the AMESim simulation of the no-load operation and loading operation of the hydraulic system and the test on the lake. Finally, the test data are compared with simulation data, and it can provide reliable reference for system optimization. The results showed that the flow of variable buoyancy system is affected by the depth of water and the temperature of environment, and variable buoyancy system can steadily operate and satisfy the engineering needs.