Going from 4.6, I would use the existing automated Inactive Agent Cleanup Task & Manage Inactive Agents query to identify inactive agents as templates.
1. Create a new query based off the Manage Inactive Agents query that will ID your 3 hour inactive window but also exclude valid physical agents that meet that same criteria using additional filters. Test to make sure it returns only your VDs.
2. Create a new automated server task, using that new query, to delete the identified agents & schedule it on your desired basis. Reference existing the Inactive Agent Cleanup Task for more info.