What constitutes virtue and how to train myself in virtue?
Virtue or sila at the very minimum is the five precepts. Further practice of virtue is by the eight precepts, ten precepts, Right Livelihood, Right Speech and Right Action.

Further information can be found in AccessToInsight's virtue (sila) page, including sutta verses.

To practice virtue (sila), the first step is to vow to undertake the training of the five precepts, and then practice them with heedfulness (appamada).

The second step is to adopt this thinking from AN 5.57: 


  “And for the sake of what benefit should a woman or a man, a
  householder or one gone forth, often reflect thus: ‘I am the owner of
  my kamma, the heir of my kamma; I have kamma as my origin, kamma as my
  relative, kamma as my resort; I will be the heir of whatever kamma,
  good or bad, that I do’? People engage in misconduct by body, speech,
  and mind. But when one often reflects upon this theme, such misconduct
  is either completely abandoned or diminished. It is for the sake of
  this benefit that a woman or a man, a householder or one gone forth,
  should often reflect thus: ‘I am the owner of my kamma, the heir of my
  kamma; I have kamma as my origin, kamma as my relative, kamma as my
  resort; I will be the heir of whatever kamma, good or bad, that I do.’


The third step is to understand more deeply from the Dhamma on Right Livelihood, Right Speech and Right Action, and practise them with heedfulness (appamada).