I have not tried it yet but I have tried something that was similar. I got off the couch and started running on an elliptical trainer while I watched TV. After a while I was running 12 km on my elliptical trainer. That is the distance to the closest beach from my house. However it is not the same as running on a treadmill or outside.
Currently I am trying to conquer the 60k on my bike. There is a provincial park with 3 great beaches that are among the best in Canada. My tip is to take it easy at first and try increase the distance or speed every time. If you can't do better than the last time you probably need more rest.
You need to believe in yourself and work up to it. You also need to really want it. I like provincial parks and beaches. So I use them to motivate me. When starting a new routine I don't try my best the first week and I pace myself. I am increasing the duration of my weekly bike ride by about 12 minutes every week. Google maps helps me plan my route.