Under Virginia law, habeas corpus is a civil proceeding used to challenge and remedy due process violations. Habeas corpus is perhaps the most critical writ available to prisoners for challenging criminal convictions and sentences in state and federal courts.The Habeas Corpus petition claims the arrest, sentence, or trial violated constitutional law, making imprisonment unlawful. Corpus. Habeas corpus is available to prisoners challenging their convictions and sentences. 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. In United States law, habeas corpus is a recourse challenging the reasons or conditions of a person's confinement under color of law. The writ of habeas corpus is a legal order requiring a person holding another person to produce that individual before a court or judge. Generally, anyone detained or imprisoned can file a petition for a writ of habeas corpus in the United States. Habeas petitions generally are filed in the district court with jurisdiction over the filer's place of custody. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment.