If VA is your "permanent duty station" you are considered a Virginia Resident and can buy handguns and long guns. You'll need your Military ID, a copy of your orders, and driver's license/2nd photo ID.
Otherwise you are considered non-resident and are restricted to long guns only. You'll need two ID's both with the same address in your home state.
Here's the skinny form the State Police website:
--------------------------------
Primary Identification
The primary form of identification shall consist of a valid photo-identification form issued by a governmental agency of the Commonwealth or of the prospective purchaser’s home state that denotes the purchaser’s name, sex, date of birth, and address. Where the primary form of identification is a photo-identification issued by the Department of Motor Vehicles, the date of issuance must exceed sixty (60) days from the date of new issue or duplicate issue unless the prospective purchaser also presents a copy of his/her Department of Motor Vehicles driver's record showing that the original date of issue exceeds sixty (60) days.
A State Department Driver’s License is an acceptable primary form of identification: a photo-identification issued by a [Federal] governmental agency which indicates the individual’s name, address, race, sex, and date of birth.
Social security cards and birth certificates ARE NOT acceptable forms of identification.
Secondary Identification
The secondary form of identification, for Virginia residents and residents of other states, must show an address identical to that shown on the primary form of identification. Some acceptable forms of secondary ID are:
* a current lease
* evidence of currently paid personal property tax or real estate tax
* a current utility or telephone bill
* a current voter registration card
* a current bank check
* a current passport
* a current automobile registration
* a current hunting or fishing license
Military Personnel identification
Active military personnel permanently stationed in Virginia are treated as Virginia residents for the purchase of a handgun. Identification and residency are established by the following:
A military photo-identification card issued by the United States Department of Defense and proof that Virginia is the permanent duty station via "signed and current" military assignment orders is acceptable identification and residency documentation to establish military personnel as residents of Virginia.
A member of the United States Armed Forces, serving on active duty, whose permanent duty station is located within Virginia, but who dwells in another state, is a “resident” of the Commonwealth of Virginia for purposes of purchasing a firearm.
If permanently assigned to a mobile unit in Virginia, and the homeport is listed as Virginia, the transaction may be processed as a Virginia resident the same as any other permanent military assignment to Virginia supported by military assignment orders. The individual is treated as a non-Virginia resident if the homeport is listed as any place other than Virginia.
Individuals retired from military service are subject to the same identification and residency requirements as any other person wishing to purchase a firearm; i.e., a primary and secondary form of ID.
-------------------
Hope this helps,
DJ