§ 18.2-56.2. Allowing access to firearms by children; penalty.
A. It shall be unlawful for any person to recklessly leave a loaded, unsecured firearm in such a manner as to endanger the life or limb of any child under the age of fourteen. Any person violating the provisions of this subsection shall be guilty of a Class 3 misdemeanor.
B. It shall be unlawful for any person knowingly to authorize a child under the age of twelve to use a firearm except when the child is under the supervision of an adult. Any person violating this subsection shall be guilty of a Class 1 misdemeanor. For purposes of this subsection, "adult" shall mean a parent, guardian, person standing in loco parentis to the child or a person twenty-one years or over who has the permission of the parent, guardian, or person standing in loco parentis to supervise the child in the use of a firearm.
(1991, c. 537; 1994, c. 832.)
§ 18.2-308.7. Possession or transportation of certain firearms by persons under the age of 18; penalty.
It shall be unlawful for any person under 18 years of age to knowingly and intentionally possess or transport a handgun or assault firearm anywhere in the Commonwealth. For the purposes of this section, "handgun" means any pistol or revolver or other firearm originally designed, made and intended to fire single or multiple projectiles by means of an explosion of a combustible material from one or more barrels when held in one hand and "assault firearm" means any (i) semi-automatic centerfire rifle or pistol which expels single or multiple projectiles by action of an explosion of a combustible material and is equipped at the time of the offense with a magazine which will hold more than 20 rounds of ammunition or designed by the manufacturer to accommodate a silencer or equipped with a folding stock or (ii) shotgun with a magazine which will hold more than seven rounds of the longest ammunition for which it is chambered. A violation of this section shall be a Class 1 misdemeanor.
This section shall not apply to:
1. Any person (i) while in his home or on his property; (ii) while in the home or on the property of his parent, grandparent, or legal guardian; or (iii) while on the property of another who has provided prior permission, and with the prior permission of his parent or legal guardian if the person has the landowner's written permission on his person while on such property;
2. Any person who, while accompanied by an adult, is at, or going to and from, a lawful shooting range or firearms educational class, provided that the weapons are unloaded while being transported;
3. Any person actually engaged in lawful hunting or going to and from a hunting area or preserve, provided that the weapons are unloaded while being transported; and
4. Any person while carrying out his duties in the Armed Forces of the United States or the National Guard of this Commonwealth or any other state.
(1993, cc. 467, 494; 2003, c. 976; 2004, c. 995.)
§ 18.2-309. Furnishing certain weapons to minors; penalty.
A. If any person sells, barters, gives or furnishes, or causes to be sold, bartered, given or furnished, to any minor a dirk, switchblade knife or bowie knife, having good cause to believe him to be a minor, such person shall be guilty of a Class 1 misdemeanor.
B. If any person sells, barters, gives or furnishes, or causes to be sold, bartered, given or furnished, to any minor a handgun, having good cause to believe him to be a minor, such person shall be guilty of a Class 6 felony. This subsection shall not apply to any transfer made between family members or for the purpose of engaging in a sporting event or activity.
(Code 1950, § 18.1-344; 1960, c. 358; 1975, cc. 14, 15; 1992, c. 487; 1993, c. 855.)
As for federal code, this is what I've found
(b) It shall be unlawful for any licensed importer, licensed manufacturer, licensed dealer, or licensed collector to sell or deliver
— (1) any firearm or ammunition to any individual who the licensee knows or has reasonable cause to believe is less than eighteen years of age, and, if the firearm, or ammunition is other than a shotgun or rifle, or ammunition for a shotgun or rifle, to any individual who the licensee knows or has reasonable cause to believe is less than twenty-one years of age;
==(2) any firearm to any person in any State where the purchase or possession by such person of such firearm would be in violation of any State law or any published ordinance applicable at the place of sale, delivery or other disposition, unless the licensee knows or has reasonable cause to believe that the purchase or possession would not be in violation of such State law or such published ordinance;
(1) It shall be unlawful for a person to sell, deliver, or otherwise transfer to a person who the transferor knows or has reasonable cause to believe is a juvenile—
(A) a handgun; or (B) ammunition that is suitable for use only in a handgun.
(2) It shall be unlawful for any person who is a juvenile to knowingly possess— (A) a handgun; or (B) ammunition that is suitable for use only in a handgun.
(3) This subsection does not apply to— (A) a temporary transfer of a handgun or ammunition to a juvenile or to the possession or use of a handgun or ammunition by a juvenile if the handgun and ammunition are possessed and used by the juvenile—
(i) in the course of employment, in the course of ranching or farming related to activities at the residence of the juvenile (or on property used for ranching or farming at which the juvenile, with the permission of the property owner or lessee, is performing activities related to the operation of the farm or ranch), target practice, hunting, or a course of instruction in the safe and lawful use of a handgun;
(ii) with the prior written consent of the juvenile’s parent or guardian who is not prohibited by Federal, State, or local law from possessing a firearm, except— (I) during transportation by the juvenile of an unloaded handgun in a locked container directly from the place of transfer to a place at which an activity described in clause (i) is to take place and transportation by the juvenile of that handgun, unloaded and in a locked container, directly from the place at which such an activity took place to the transferor; or (II) with respect to ranching or farming activities as described in clause (i), a juvenile may possess and use a handgun or ammunition with the prior written approval of the juvenile’s parent or legal guardian and at the direction of an adult who is not prohibited by Federal, State or local law from possessing a firearm;
(iii) the juvenile has the prior written consent in the juvenile’s possession at all times when a handgun is in the possession of the juvenile; and
(iv) in accordance with State and local law;
(B) a juvenile who is a member of the Armed Forces of the United States or the National Guard who possesses or is armed with a handgun in the line of duty;
(C) a transfer by inheritance of title (but not possession) of a handgun or ammunition to a juvenile; or
(D) the possession of a handgun or ammunition by a juvenile taken in defense of the juvenile or other persons against an intruder into the residence of the juvenile or a residence in which the juvenile is an invited guest.
(4) A handgun or ammunition, the possession of which is transferred to a juvenile in circumstances in which the transferor is not in violation of this subsection shall not be subject to permanent confiscation by the Government if its possession by the juvenile subsequently becomes unlawful because of the conduct of the juvenile, but shall be returned to the lawful owner when such handgun or ammunition is no longer required by the Government for the purposes of investigation or prosecution.
(5) For purposes of this subsection, the term “juvenile” means a person who is less than 18 years of age.
(6) (A) In a prosecution of a violation of this subsection, the court shall require the presence of a juvenile defendant’s parent or legal guardian at all proceedings. (B) The court may use the contempt power to enforce subparagraph (A). (C) The court may excuse attendance of a parent or legal guardian of a juvenile defendant at a proceeding in a prosecution of a violation of this subsection for good cause shown.