Source: https://www.hurricanefenceinc.com/blog/bid/205929/Va-Fence-Law-Who-s-Actually-Responsible-for-the-Cost-of-My-Fence
Timestamp: 2019-04-20 13:06:13+00:00

Document:
The info in this article is coming straight from the Virginia Legislative Branch's website http://leg1.state.va.us/. Most of what is covered is state level laws but each locality has its own set of governing laws that tend to vary greatly—and lean specific to that geographic location and the prevailing uses for fence installation in that area.
Like most laws, fence regulations can be somewhat convoluted. That's why it's of the utmost importance to pick a fence contractor that understands Virginia's fence laws at the state level. Laws are set by each locality. Most statutes that accompany Virginia fence installation are in reference to livestock(1); fence and its use for pools(2) and railroads(3) are also mentioned in some codes.
For example, if you live in an area that has ordinances that excersizes the maximum punitive actions allowed by § 15.2-921 and you violate said ordinances by not having a fence around a pool, or the fence takes more than 24 days to complete, a person could face as much as $7200 in fines plus court costs or 2 years in jail. The last part of § 15.2-921 simply states "Any such ordinance may be made applicable to swimming pools constructed before, as well as those constructed after, the adoption thereof. No such ordinance shall take effect less than ninety days from the adoption thereof, nor shall any such ordinance apply to any swimming pool operated by or in conjunction with any hotel located on a government reservation." In short ordincances are not required to include a grandfather clause, take atleast 90 day before becoming active and do not apply to swimming pools operated by or in conjunction with any hotel on a government reservation.
Since the Virginia legal guideline for pool fences is the most strait forward we can cover that first.
Virginia code § 15.2-921 defines the word "fence" as a close type vertical barrier not less than four feet in height above ground surface.
A woven steel wire, chain link, picket or solid board type fence, or a fence of similar construction which will prevent the smallest of children from getting through.(2) Keep in mind, that this definition is only in reference to residential property."Ordinances may require professional fence construction for new or existing swimming pools." This means that if a fence is less that 4 feet doesnt count for the perpose of fencing a pool.A pool or more specifically a swimming pool is defined as "any outdoor man-made structure constructed from material other than natural earth or soil designed or used to hold water for the purpose of providing a swimming or bathing place for any person or any such structure for the purpose of impounding water therein to a depth of more than two feet."(2) this definition is prefeced with the word "includes" in § 15.2-921 meaning that broader definitions may also apply.The code of virginia § 15.2-921 grants any locality the ability to "adopt ordinances making it unlawful for any person to construct, maintain, use, possess or control any pool on any property in such locality, without having a fence completely around such swimming pool. Such ordinances also may provide that every gate in such fence shall be capable of being securely fastened at a height of not less than four feet above ground level; that it shall be unlawful for any such pool gate to be allowed to remain unfastened while the pool is not in use; and that such fence shall be constructed so as to come within two inches of the ground at the bottom and shall be at least five feet from the edge of the pool at any point." the code the restricts the the punative actions of a loacality tofine of not more than $300 or confinement in jail for not more than thirty days, either or both. Each day's violation may be construed as a separate offense." but with each day being a seperate offince it can add up.
Virginia law as it pertains to fence in agricultrial applications is somewhat contradictory. When it comes to fencing used for livestock, there are two main schools of thought.
"Fence In" where the live stock are to be contrained on a given property via dating back to 17th century english common law.(1) The other common philosophy is referred to as "Fence Out" in which it is the responsibility of a land owner who whishes to keep livestock off their property had to build their own fence. The type of fence law that applies changes from county to county. Here are a list of Virginia Counties who participate.
“Fence In” Counties: Albemarle, Arlington, Augusta, Bedford, Botetourt, Buckingham, Campbell, Charles City, Chesterfield, Clarke, Culpeper, Cumberland, Dickenson, Fauquier, Floyd, Fluvanna, Gloucester, Goochland, Greene, Halifax, Hanover, Isle of Wight, King George, Loudoun, Louisa, Madison, New Kent, Orange, Page, Patrick, Pittsylvania, Pulaski, Rappahannock, Roanoke, Rockingham, Russell, Scott, Southampton, Spotsylvania, Smyth, Sussex, Washington, Wise, Wythe, York.
“Fence Out” Counties are Accomack, Alleghany, Amelia, Amherst, Appomattox, Bath, Bland, Brunswick, Buchanan, Caroline, Carroll, Charlotte, Chesapeake, Craig, Dinwiddie, Essex, Fairfax, Franklin, Frederick, Giles, Grayson, Greensville, Hampton, Henrico, Henry, Highland, James City, King & Queen, King William, Lancaster, Lee, Lunenburg, Mathews, Mecklenburg, Middlesex, Montgomery, Nelson, Newport News, Northumberland, Northampton, Nottoway, Orange, Powhatan, Prince Edward, Prince George, Prince William, Richmond, Rockbridge, Shenandoah, Stafford, Suffolk, Surry, Tazewell, Virginia Beach, Warren, Westmoreland.
While wordy, provided below is the exact wording of "§ 55-299. Definition of lawful fence." taken from https://leg1.state.va.us/cgi-bin/legp504.exe?000+cod+55-299.
§ 55-299. Definition of lawful fence.
There are other statues that allow for some bodies of water in certain circumstances to also be considered "Lawful Fences" to include 55-300, 55-302, and 55-303. more information can be found at https://leg1.state.va.us/.
Reguardless of whether a property is in a "Fence In" or Fence Out" county there are Virginia statutes that provide a means by which one land owner may compel a neighbor to aide in the construction or maintenance of a given boundry fence. The law also makes a dinstinction between existing and none existng boundry fence.
In summary the law surrounding fence is convoluted and often contradictory thus it is a good idea to get legal advice on these matters. Keep in mind that if the situation arises that a fence is to be mandated, there may be legal recourse for the construction and, or financing of a mandated fence when it lies between two properties.

References: § 15
in fine
 § 15
 § 15
 § 15
 § 15

§ 55