By default, xinit and startx start an X display server on display :0[clarify] and then start an xterm on it. When the xterm terminates, xinit and startx kill the X display server. In general, xinit and startx can start an arbitrary server and run an arbitrary script. Typically, this script runs a number of programs and a window manager.
Two alternative methods for starting an X display server are by using a display manager and by starting the X server and then manually starting one or more clients. On desktop Linux systems, using a display manager is the most commonly used method.