Texas has a law which allows you to travel with a firearm as long as it is not in plain view. In Virginia, if you do not travel with the firearm in plain view you must have a concealed carry permit. Without such a permit you are violating the concealed weapons statute. In cases I have handled this has included pistols in the glove compartment, in a closed box under the seat (unloaded), and in bag in a mesh holder at the back of an extended cab truck. You are basically required to have the firearm sitting on the passenger seat, in plain sight, at all times. Personally, I think the only place you can have a firearm out of sight in your car and not get convicted is if it is in the trunk (and even then the back seat had best not fold down so that the trunk actually connects to the cab).
The way I've usually seen this handled is that the defendant has his charge dropped if he agrees to give up his firearm.