A head to head comparison of the Virginia 2012 General Election gives us an idea of the break down of the voters.    

Barack Obama received 1,905,530 (51%) votes, beating Mitt Romney who gained 1,789,620 (48%) by 115,910 votes in Virginia.

Mitt Romney won 88 counties whereas Barack Obama won 46 counties in the total of the 134 counties in the State of Virginia.

Presidential General Elections

During the 2012 General elections, over 122M total number of votes were cast. Barack Obama got 62,614,654 (62.6 Million) over Mitt Romney's 59,141,654 (59.1 Million). He won the popular vote by 3,472,979 (3.4 Million). His victory in the State of Virginia (with 1,905,530 votes) represents 3.0% of his popular vote victory. The remaining 49 states contributed to the remaining 97.0% popular votes victory.

Top 15 Counties in Primary Elections vs General Elections

All Candidates (General Elections)

These 15 counties play an important role in these Primary elections. If a candidate, can get a sizable majority in the larger counties (Fairfax, Virginia Beach, Prince William, Chesterfield, Henrico), it becomes very difficult to win majorities in the smaller counties without voter outreach and increased voter participation in them.

Top 15 Counties Comparison in Primary Elections vs General Elections

General Elections
Barack Obama

General Elections
Mitt Romney

Fairfax, Prince William and Henrico, three of the larger counties, voted in favor of Barack Obama giving him a 134k vote advantage. Virginia Beach and Chesterfield, some other larger counties, voted in favor of Mitt Romney giving him a 17k vote advantage out of those counties. However, steady marginal wins for Mitt Romney in the less popular counties were not enough to overcome that deficit, making Barack Obama gain an upper hand in the State of Virginia.

Related References: 2016 Virginia Primary Election Story, 2016 Virginia General Election Story, 2020 Virginia Primary Election Story, 2020 Virginia General Election Story