Virginia Gov. Terry McAuliffe (D) gestures during a news conference at the Capitol in Richmond on Jan. 19. A new poll shows his job approval ratings are at an all-time high. (Steve Helber/Associated Press)

Republican political strategist Ed Gillespie and Democratic Lt. Gov. Ralph Northam are leading in the early days of their primary contests for Virginia governor, according to a new survey released Thursday.

But most Democrats and Republicans are undecided, which means the June primaries are wide open, according to the first gubernatorial polling by the Wason Center for Public Policy at Christopher Newport University.

Northam drew support of 26 percent of Democratic-leaning voters, while 15 percent backed former congressman Tom Perriello (D), who jumped into the race a month ago. Nearly 6 in 10 voters were undecided.

Gillespie was far ahead of the four-man GOP pack with support from one-third of Republican-leaning voters in head-to-head matchups. State Sen. Frank W. Wagner (Virginia Beach) drew 9 percent; Prince William Board of County Supervisors Chairman Corey A. Stewart had 7 percent; and distillery owner Denver Riggleman had 1 percent. About half of those voters were undecided.

Stewart is trying to ride the same populist wave that thrust President Trump into the White House, voicing similar views about immigration and attacking Gillespie as “Establishment Ed.” But he was the only candidate for governor with a net negative approval rating — of the 15 percent of voters who knew him, 8 percent disapproved of him while 7 percent approved.

Quentin Kidd, director of the Wason Center, said the results show Gillespie in a comfortable position but that Northam has not locked up Democratic support two years after he announced his candidacy.

“Perriello clearly feels like he’s tapped into something among Democrats which is why he got into the race, and the poll demonstrates to a certain extent he is right,” Kidd said. “Northam has the lead, you can’t deny that, but if those 58 percent [of undecided voters] don’t break in Northam’s favor, this primary race could really be the one to watch. It could really be a nail-biter.”

Virginia has no party registration, and voters can cast ballots in either major party’s primary.

The poll had some good news for Democrats.

Fifty-five percent of those surveyed approved of the job that Gov. Terry McAuliffe (D) is doing, the highest it has been in Wason Center polling since McAuliffe’s term began in January 2014. More than half of respondents also said they thought Virginia was headed in the right direction.

Attorney General Mark R. Herring (D), who is running for reelection, got a 36 percent approval rating while 18 percent disapproved. That’s a better performance than a year ago, when just 33 percent approved of his performance and 27 disapproved.

But the survey showed the current Democratic candidates for governor are largely unknown.

Even after Northam enters his fourth year in statewide office, almost two-thirds of voters have no opinion of him. They are similarly unsure of Perriello, a one-term congressman who has been out of office since 2011.

Northam had $2.5 million in campaign accounts heading into 2017 and endorsements from nearly every Democrat elected to statewide or federal office.

Voters were also largely unfamiliar with the Republican field.

Gillespie, who nearly unseated U.S. Sen. Mark R. Warner in 2014, was the best known and most favored of the four GOP candidates. Three in 10 voters had an opinion of him, and 20 percent approved.

Survey respondent had mixed feelings about President Trump, with half of voters saying they are optimistic about his term and 45 percent saying they are pessimistic. Nearly 9 in 10 Republicans said they were optimistic. Polling spanned from Jan. 15 to 28 — before and after the inauguration.

The poll surveyed 1,002 Virginia voters, with a margin of error of plus or minus 3.2 percentage points.

Other findings:

— More than half of voters opposed a bill pending in the General Assembly that would prohibit abortion after 20 weeks, with no exceptions for rape and incest. About 40 percent of men and women supported the proposal, while two-thirds of independents opposed it.

— While Virginians overwhelmingly supported McAuliffe’s order protecting gay and transgender employees of state contractors from discrimination, they also supported by a slimmer margin a “bathroom bill” that would require people to use the facility corresponding with their sex at birth. A bill to do that died in committee in the current legislative session.

— A majority of those polled said they support expanded solar and wind energy and oppose fracking. More Virginians oppose than support expanded nuclear energy or coal mining.

— As the state grapples with a $1 billion budget shortfall, 57 percent of voters supported raising taxes to avoid budget cuts. Majorities of independents and Republicans opposed tax increases. Poll respondents prioritized cuts to transportation over public safety, health care, education and social services.

— A majority of voters also backed repealing the federal health care law only if a replacement plan is ready, and 58 percent said the state should step in to help those who lose insurance if Congress does not. The poll also found broad support for key provisions of the law, including requiring insurance companies to cover people with preexisting conditions.

— Three-quarters of Virginians support decriminalizing possession of small amounts of marijuana, penalizing offenders with fines instead of jail.