What am I doing wrong,
I have no idea what you're doing wrong except that you're not providing enough information for anyone to do more than guess and I'm not one for guessing.
and which of these is the best?
Probably none of the above but that largely depends on details you have failed to provide.
First step is to provide at least the following:
- The error(s) being produced which may differ by the methods you're using. if you don't know how to get them start with the troubleshooting advice in Running A Program At Start Up A Beginner's Guide*. While you're there you should probably read all of it or at least the bits specific to what you are currently doing and what you want to happen.
- Model of Pi you are using including how much RAM it has (Yes, this does make a difference).
- Which OS you are using. "Raspberry Pi OS" is not enough. We need to know whether it's 32 or 64 bit and what the release name is.
If you don't know the release name, post the output from the following command:Code:
head -1 /etc/os-release
- Booting to desktop or command line?
- With or without automatic login?
- What you program/script/application needs in order to function (e.g Desktop, network, ...)
- What changes you have made from the default OS settings.
One thing that I can say with certainty is that security settings on a default RPiOS (and most other Linux) will not allow startx to be run unless logged in to an interactive session on the Pi's console (i.e. a directly connected keyboard, mouse, and monitor).
startx will also fail if you try to run it after a desktop has already been started (by another startx comand or by the OS) or if Wayland is running on the console.
*: full disclosure - I'm the author of that guide.
Statistics: Posted by thagrol — Thu Apr 25, 2024 11:41 pm