On this page I listed some hotels close to the Palace of Versailles and in the surounding area, or even in Paris. It may help you find a nice place to stay while you visit the Chateaux of Versailles.
This is the closest you can get! Luxury in a historic Palace building, just opposite of the Chateau. With award-winning Guerlain Spa and Michelin-starred dining.
Villa with 5 bedrooms, a garden, a shared lounge, and a terrace, 3 km from the Palace. You can rent a bike at the villa.