I would like to open image from rc.local. I am sure rc.local is getting called during boot as it execute/run test c++ code. I tried with various image viewer like gpicview , mirage. I can try with imagemagic but i don't think, image viewer is the problem. Something I am missing fundamental.

rc.local code:

cd /home/pi/test 
gpicview test.jpg
#mirage test.jpg #doesnt work so commented
exit (0)

How can resolve this issue? Any suggestion for further debugging?

  • Note : exit (0) is on next line some reason, copy past code didn't dispaly properly.
    – NoWorries
    Aug 17, 2018 at 22:33
  • GPicView - A Simple and Fast Image Viewer for X - two things to ask. Is X running yet? would rc.local have access to it? If you want to run something when X starts, you need to use a different method (I'm sure there's plenty of information about how to start a program when X starts if you search) Aug 18, 2018 at 1:13
  • thanks for comment, Let me have a read about 'X' starts sequence. How would i know , is X running?
    – NoWorries
    Aug 18, 2018 at 16:32
  • 1
    You cannot start GUI stuff from rc.local, as explained here. Consider using LXDE autostart. Aug 20, 2018 at 12:06
  • Thanks Dmitry, Looks like i found the answer. Let me try with LXDE autostart. I will update you tomorrow. Thanks a lot!
    – NoWorries
    Aug 20, 2018 at 20:05

1 Answer 1


I hope this may be useful to someone: Finally mange to get image open from LXDE autostart. I wrote script call test.sh :

cd /home/pi/test
gpicview test.jpg

Next Step :This script to be executable with chmod +x test.sh

Then modified LXDE autostart script:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash

Reboot device.

  • 1
    Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Feb 19, 2020 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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