How to configure X server to work headless as well with any monitor connected?

will it work for Jetson NX?
Any alternatives?