I'm running a VNC Server on a VPS.
I'm trying to automate some workflows, as I'd essentially need to (I don't even know if it is possible yet, but I'm doing a step by step) check if my VNC server is accessible, shut it down if not, open the browser on xfce, and then restore a firefox session.
As said, I still don't know how to manage this, but there is a recurrent problem I'm having when restarting my VNC Server.
I followed this setup to install VNC, and this command one time sudo apt install xdg-utils.
For running Firefox, I also had to run the following commands:
export DISPLAY=:1
xhost +local:
And, well, every time I restart my TightVNC server, I have to run those commands manually in order for everything to work.
I tried in many ways running them on services, but, it doesn't seem to work, while doing it manually after starting the VNC session and accessing does.
Is there any help or recommendation on this last thing you can help me try out? Making Firefox available to be open just by clicking xfce Web Browser without running those commands manually?