That is actually more solved than you think. [1]ARED is basically equivalent to free-weight training under Earth gravity. Many problems with exercise in space is that elastic materials provide different resistance depending on how far they are deformed, meaning muscles that are used more at the beginning of your rep are worked less than those you use near the end. ARED uses a piston under vacuum to provide constant resistance through the entire stroke. There was a video of it in action on the SmarterEveryDay youtube channel but I can't seem to find it, I'm not sure if one has actually made it up to the space station yet either.
[1]https://www.nasa.gov/mission_pages/station/research/experime...