SETUP
I have a python3 application that creates a gui using tkinter. It runs on a Raspberry Pi 4 running Ubuntu 21.10. I'm connected using a remote desktop with the 
When I run the application as user, tkinter is able to create the GUI, but now the application does not have permission to interface with root drivers
python3 /home/ubuntu/Robotics/QuadrupedRobot/StanfordQuadruped/calibrate_tool.py
QUESTION
Is there a way to make tkinter work with root permissions on remote desktop, or to write on root files without giving root permission to the full application?
Is there a something I'm doing wrong with the setup?
SOLUTION
CodePudding user response:
This is an X Windows security issue preventing the sudo user accessing the display created by the logged on user. If you're not worried about security on your local network then running the command 'xhost ' will disable all security on the X Windows Display and allow the sudo user to access the display.
pi@pi4desktop:~ $ xhost
access control disabled, clients can connect from any host
Then you should be able to run your tkinter application using sudo.


