I have a shell script that i run with a systemd service file. The shell script executes a python script. The service file works and the script is executed, but i cannot see a GUI terminal, in order to debug. I tried to use

xterm -hold -e /path/to/script

but no luck.

Can you give me any advise on how to open a terminal with a GUI?

  • 1
    Service jobs are designed to run silently with errors etc being logged to one or more files. Why do you need the GUI?
    – user115418
    Commented Jul 9, 2020 at 13:33
  • I need it because i use some sockets and i have prints that help me to debug. I can run it manually and run the end script automatically. Commented Jul 9, 2020 at 15:42
  • You could output to a log using the Python logging module or just redirect the output to a file and tail -f the log / file to see the messages.
    – user115418
    Commented Jul 9, 2020 at 16:11
  • 1
    The question is something like "I want my car to swim". It's possible but no one takes the effort. As already said, a service isn't made for interactive I/O.
    – Ingo
    Commented Jul 12, 2020 at 13:34

1 Answer 1


Navigate to home/pi/.config/lxsession/LXDE-pi/

Using this

cd home/pi/.config/lxsession/LXDE-pi/

nano autostart

Add a @lxterminal in the last line. Press CTRL+X then Y and press ENTER.

Restart raspberry pi OR Type reboot and press ENTER

After booting terminal pops up.

You can use this to make raspberry pi to execute programs at booting. For executing that a program, like a python program that requests an API for information by reading an input.

Add that program in .bashrc file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.