I've followed these instructions to start my python script and rebooted. The script is running on start up (I can see this from GPIO and some flashing LED's) but the Raspbian desktop is no longer loading.

I have installed tightvncserver, but cannot get remote access to that either.

How can I get my desktop back?

1 Answer 1


Your script almost certainly doesn't terminate (does it have an endless loop?), and since you've included it in your startup process, than never completes either. Since the desktop depends on startup (for e.g. graphical drivers), it will wait indefinitely for your script to finish.

You'll have to temporarily remove your script from boot sequence and modify it so that it forks a new process and terminates. In shell, that would be accomplished by writing python stuff.py & instead of python stuff.py. In python, you could use os.fork() to achieve the same result. When you get your modified script running, include it back into your startup.

  • Yep, that will be it. How can I edit the script without getting into the desktop? I've tried SSH without success Oct 10, 2016 at 9:23
  • The easiest would be to edit the script using another computer. If you have Linux, just plug the SD card in the computer and it should open. Otherwise, check out this answer. Oct 10, 2016 at 9:28
  • Also, if you have a backup of your script, you can just reflash the OS and then put your script back. Oct 10, 2016 at 9:30
  • You could always flash another card, then mount the broken card partition using a USB card reader and fix your script.
    – bobstro
    Sep 30, 2017 at 2:52

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.