The Catalans struggled to overcome a poor pitch and a stubborn defence, while also surviving two scares as the home team were denied by the woodwork.
However, the second-half introduction of Neymar opened things up before Lionel Messi finally set up the 82nd-minute winner for 19-year-old debutant Sandro to poke home.
"I've been satisfied with everything since I arrived at Barca and I'm pleased with the players' attitude," Luis Enrique told reporters. "We have a lot to improve but their willingness is staggering."
The victory means that Barcelona will go into the international break with six points from two matches in La Liga, while several of their World Cup stars are returning to full fitness.
"It was a passionate game to watch, with possession changing hands all the time and both sides having chances," the coach added, "but the condition of the pitch didn't help either team when it came to shooting.
"However, both teams wanted to go out to play good football. Villarreal knew how to wait at the back but also caused some shocks in attack.
"This result will do us a lot of good, though, especially considering the way it came about. It has set us up nicely for the next few weeks."
With 18-year-old forward Munir having scored in a 3-0 win over Elche last week, and now Sandro breaking his duck, the future looks bright for Barcelona.
"I'm pleased to see that the youngsters are helping us so much," Luis Enrique continued. "We are happy for Sandro and with all the hard work that the young players are doing."