The inversion and uncertainty quantification of physical parameters are important for many science and engineering problems. For nonlinear parameter inversion problems of flows in hydrocarbon reservoirs, estimating the true posterior probability distribution function for the random parameter is difficult when the dimension of the parameter is relatively high. Inversion methods such as gradient-based or heuristic optimization methods searching for the maximum a posterior are generally point-estimate, while uncertainty quantification using MCMC is computationally expensive. In the current study, a new ensemble variational Bayesian approximation method is developed to estimate the posterior probability density using an ensemble of realizations regarded as a trial sample distribution. The objective is to optimize the trial sample distribution such that the evidence lower bound is maximized indicating that the distance between the trial and true posterior distribution is minimized. A subspace is built using principle component analysis based on finite samples to obtain a diagonal positive-definite covariance matrix, and ensemble-based data assimilation is used to optimize the trial distribution efficiently. Heterogeneous 2D and 3D test cases of transient single- and two-phase Darcy flows are presented for validation.