The stand you put your bike on for the sake of exercising and/or working out, indoors, is called a trainer and that's the way I would go. There are several types, but even the simplest will get you the closest to working those same muscles you will be using when you take your bike out on the road. Nothing duplicates, exactly, the real thing as far as biking, but some of these trainers come very close. In some ways, a trainer is even a better than the real thing for a workout because you have no option to coast - you have to keep pedaling to rack up your miles. Also a great way to work on your cadence and pedaling technique and you can even switch gears.
Spin bikes and cross trainers put you in a different posture than what you use when on your bicycle. Always good to exercise, so better than not exercising, but you need to be very careful on those things with your knees. A trainer for your bike is money well spent. With our long cold winters, I use mine a lot.