A habeas corpus petition attacking a criminal conviction or sentence shall be filed within two years from the date of final judgment in the trial court. Under Virginia law, habeas corpus is a civil proceeding used to challenge and remedy due process violations.An authoritative and practical 2-volume treatise with practical advice and expert analysis from practitioners and subject matter experts. Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. The writ of habeas corpus is an extraordinary remedy designed to test the validity and legality of detention or incarceration.