Goals from Vedad Ibisevic and Miroslav Stevanovic gave the visitors, inspired by a terrific performance from Manchester City's Edin Dzeko, a deserved win in Llanelli.
The closest Wales came to a goal was when Joe Allen hit the crossbar in the first half, while Gareth Bale also threatened sporadically, but it was a dispiriting night for the hosts.
Manager Chris Coleman, still searching for a first win in charge, had highlighted this as a key fixture with qualification fixtures looming on the horizon.
But the former Fulham boss will know there is plenty of work to be done before Belgium visit Cardiff in the Group A opener in little over three weeks.
Coleman had been able to field Bale for the first time in his reign, but opted to leave Craig Bellamy on the bench after his recent exertions with Team GB.
Wales should have trailed inside 40 seconds as Ashley Williams stepped on the ball to allow Dzeko in, but Boaz Myhill tipped the striker's rising shot away and Darcy Blake completed the clearance.
After a nervy start Wales found their feet. New Liverpool signing Allen saw his ball across the six-yard box diverted wide by Miralem Pjanic, before his shot from Williams' lay off was brilliantly tipped on to the bar by Stoke's Asmir Begovic.
It was Bosnia's turn to be denied by the woodwork after 16 minutes when defender Boris Pandza thundered a header against the underside of the bar.
But there was no reprieve for Wales four minutes later as Stevanovic punished Neil Taylor's defensive lapse to tee-up Stuttgart's Ibisevic for an easy finish.
Ibisevic should have doubled his tally after 27 minutes when the superb Pjanic dispossessed Aaron Ramsey in midfield and fed the striker.
He skipped past Blake, only to send his shot narrowly wide with Myhill beaten.
Bale, who the home side were struggling to get involved in the game, then threatened with superb control and an attempted volley from a raking Williams pass, but Begovic was equal to it.
Begovic had to be alert to keep out the Tottenham winger's header from Taylor's cross moments later as Wales finally found some attacking thrust.
Wales needed a strong start to the second half, but they continued to struggle with Bosnia's lively movement and fell further behind in the 54th minute.
Chris Gunter gifted Dzeko the ball with a weak header and the visitors swiftly worked the ball right to give Stevanovic the freedom of the Wales penalty area to fire across Myhill.
Dzeko threatened to add a third as he slipped between Gunter and Blake, until the latter got in a timely challenge as he prepared to get his shot away.
Bale gave a reminder of his potency on the hour with a purposeful run down the right that ended with Vokes narrowly failing to get on the end of the cross.
But that was Bale's last contribution as he and Simon Church were withdrawn with Hal Robson-Kanu and Bellamy coming on.
Coleman also sent on Huddersfield's Joel Lynch for his first cap in place of Blake, ending the Cardiff man's difficult night.
Steve Morison, another substitute, narrowly failed to get on the end of a Bellamy cross.
Dzeko then wasted a great chance to grab the goal his performance merited by blazing over shortly after Myhill had saved his fierce piledriver.