My ex lives in New York and I live in Virginia. Can I serve him with a subpoena for court in Virginia while he is in New York, or does he have to be physically present in Virginia to be served?

You have inadvertently asked a question that is on some Bar Examinations to become a lawyer. Your question concerns minimum contacts and in personam jurisdiction requirements and rules.

The United State Supreme Court has defined the parameters of the states’ power to compel nonresidents to defend suits brought against them in state court. The general rule is that the forum state may not exercise jurisdiction over a nonresident unless his or her relationship to the state is such as to make the exercise of such jurisdiction reasonable.

The test of due process holds that before a nonresident may be subjected to the personal jurisdiction of a state other than his or her residence, the forum state must establish "minimum contacts" of the nonresident with the state and show that the maintenance of the suit in the forum state does not offend "traditional notions of fair play and substantial justice." These minimum contacts must have a basis in some act by which the defendant purposefully avails himself or herself of the privilege of conducting activities within the forum state, thus invoking the benefits and protection of its laws. Jurisdiction is proper where the contacts proximately result from actions by the defendant that create a substantial connection with the forum state. Once it has been decided that a defendant purposefully established minimum contacts within the forum state, these contacts may be considered in light of other factors to determine whether the assertion of jurisdiction would comport with fair play and substantial justice. This depends on a balancing of the inconvenience to the defendant in having to defend himself or herself in the forum state against both the interest of the plaintiff in suing locally and the interrelated interest of the state in assuming jurisdiction.

In short, unless your ex owns property in, or does regular business within, Virginia you cannot force him to come to Virginia to defend.

Now, if you know that he's flying, or driving, into your State you can serve him with Process as soon as he crosses into your States' borders. Until then, he does not have to attend your State court hearing.