qubes.StartApp vs a plain `qvm-run`

Launching a process through qubes-app-menu does this:

qvm-run -q --autostart --service -- VM qubes.StartApp+debian-xterm

In what ways is this different from launching the process like this:

qvm-run -q VM xterm

Should I generally prefer the former? Is the latter in some way inappropriate for persistent VM processes?

It depends. There are obvious differences. If you read the source of qubes.StartApp service, you realize that it iterates through all $XDG_DATA_DIRS/applications/*.desktop files and executes the proper .desktop file via a service. There are benefits to that (maybe icon thumbnail only specified in the .desktop file). But if what you want to execute is not available via a .desktop file, your only solution would be the former. The former solution would return to your command terminal without waiting xterm to exit. The latter waits for xterm to exit.

If someone wants to get deep into this, they should read XDG specifications and qubesagent.xdg code.

p.s.: Better clarification: .desktop files are used for AppMenu entries.