From a terminal on your local computer, connect to the VM as root. Make sure to install an SSH key during VM creation and substitute the VM’s IP address.
You can press CTRL+C and continue to SSH. The prompt will open again the next time you log in, and will continue to do so until you finish the whole setup.