From what I know, Virasana, "Warrior Pose" when done correctly, spreads the synovial fluid in the knee joint. Initially, you may sit up as high as necessary for comfort, gradually taking away blankets until your buttocks are able to touch the floor. Make sure that your toes are pointing straight back behind you. Knees together. Your hips between your ankles. Tops of feet flat on the floor.
This pose looks like it would hurt the knees, but in fact, it is considered the best thing for them (because the synovial fluid lubricates).
Unfortunately, for the hamstring issue, I do not know enough about that to be of any guidance.