How to recognize a microSD card and automatically attach it to the same VM

My question has two parts:

  1. How to recognize a particular physical microSD card?
  2. How to automatically attach it to a particular VM?

Thanks.