This paper investigates capability and efficiency of utilizing the inverse dynamics in the virtual domain (IDVD) method to provide the real-time updates of feasible trajectory for an autonomous underwater vehicle (AUV) during underwater docking operations. The applicability of the IDVD method is examined for two scenarios. For the first scenario, referred to as an offline scenario, a nominal trajectory may be generated ahead of time based on a priori knowledge about the docking station (DS) pose (position and orientation). The second scenario, referred to as an online scenario, assumes some uncertainty in the DS pose; hence, the reference trajectory needs to be constantly recomputed in real time based on the updates about the DS pose. The offline scenario solution serves as a benchmark solution to check feasibility and optimality of generated trajectory subject to constraints on the states and controls. In particular, the offline solution can assist in making informed trade-off decisions between optimality of solution and computational efficiency. For the relatively simple offline scenario, the IDVD-method solution is compared with the Legendre–Gauss–Lobatto pseudo-spectral (LGLPS) method solution. The software-in-the-loop simulations and Monte Carlo trials are run for robustness assessment. Finally, the potential for the IDVD method to work online, in a closed-loop guidance system, is explored using a realistic cluttered operational simulation environment. Simulation results show that the IDVD-method based guidance system guarantees a reliable and efficient docking process by generating computationally efficient, feasible and ready to be tracked trajectories.