MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MM won't launch at startup, but will launch manually

    Scheduled Pinned Locked Moved Solved Troubleshooting
    13 Posts 3 Posters 2.0k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      ajgonzales
      last edited by

      I installed MM via sdetweil’s script on Ubuntu 24.04. Everything seems to work fine after installation, but after a reboot MM doesn’t start up. Checking the pm2 logs shows these errors, and then it just keeps looping.

      [35781:0511/163537.061675:ERROR:ozone_platform_x11.cc(244)] Missing X server or $DISPLAY
      [35781:0511/163537.061869:ERROR:env.cc(257)] The platform failed to initialize.  Exiting.
      Authorization required, but no authorization protocol specified
      

      I can run MM successfully using

      npm start
      

      from the MagicMirror folder. Any ideas on how I can get it to run at startup?

      S 2 Replies Last reply Reply Quote 0
      • M Offline
        majsoft
        last edited by

        Hi, this is how I’m running it for now, maybe it will help someone.

        I will install PM2 according to the instructions

        I will skip the command “pm2 startup”

        After installation i proceed like this

        i will create another boot file

        cd ~
        nano mm_start.sh
        

        Add the following lines:

        echo Start PM2......
        pm2 start mm.sh
        read;
        

        set permissions

        chmod +x mm_start.sh
        

        we will set up the script after booting Ubuntu

        Screenshot_5.jpg

        now i can start and stop services at will.

        S 1 Reply Last reply Reply Quote 2
        • S Offline
          sdetweil @ajgonzales
          last edited by

          @ajgonzales what user were you logged on as when you can my script?

          can u try to run the fixuppm2 script? last one on the list of my scripts…

          as a user, not root

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @ajgonzales
            last edited by

            @ajgonzales said in MM won't launch at startup, but will launch manually:

            [35781:0511/163537.061675:ERROR:ozone_platform_x11.cc(244)] Missing X server or $DISPLAY

            is 24.04 using wayland instead of x11??
            do

            ps -ef | grep -i way
            

            is a terminal window

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            S A 2 Replies Last reply Reply Quote 0
            • S Offline
              sdetweil @sdetweil
              last edited by

              @ajgonzales I am downloading 24.04 now to test in vm…

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • A Offline
                ajgonzales @sdetweil
                last edited by

                @sdetweil
                was logged in as a user, not root. got the same errors after running the fixuppm2 script and rebooting. here are the results from the other command. looks like it does use wayland:

                aj          2524    2226  0 16:06 tty2     00:00:00 /usr/libexec/gdm-wayland-session env GNOME_SHELL_SESSION_MODE=ubuntu /usr/bin/gnome-session --session=ubuntu
                aj          2938    2674  0 16:06 ?        00:00:03 /usr/bin/Xwayland :0 -rootless -noreset -accessx -core -auth /run/user/1000/.mutter-Xwaylandauth.QXB9M2 -listenfd 4 -listenfd 5 -displayfd 6 -initfd 7 -byteswappedclients
                aj        393102  390657  0 19:44 pts/0    00:00:00 grep --color=auto -i way
                
                
                S 2 Replies Last reply Reply Quote 0
                • S Offline
                  sdetweil @ajgonzales
                  last edited by

                  @ajgonzales ok thanks.

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @ajgonzales
                    last edited by sdetweil

                    @ajgonzales yep, I can recreate this… so far no hack fix has helped…

                    I now have my system where it won’t finish booting… pm2 is uninstalled…

                    so something is different between UBUNTU and RASPI OS
                    cause we don’t see this problem on raspi

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      ajgonzales
                      last edited by

                      In case anyone else has this issue, I was able to able to get it to run via pm2 by running this command first:

                      xhost +si:localuser:[username]
                      

                      Next steps are to figure out how to automatically run that command at startup prior to MM.

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        sdetweil @ajgonzales
                        last edited by

                        @ajgonzales add that to the launch script

                        you can find that by doing
                        pm2 status
                        then use the name or number of the row of the app

                        pm2 info x
                        where x is the name or number

                        can you give more info on the system?

                        lsb_release -a
                        uname -a

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

                        A 1 Reply Last reply Reply Quote 0
                        • A Offline
                          ajgonzales @sdetweil
                          last edited by

                          @sdetweil
                          I did try adding the command to the first line of the mm.sh script in the installers folder but that didn’t work. Here’s the sequence I run after rebooting, after which I have no issues.

                          pm2 stop 0
                          xhost +si:localuser:[username]
                          pm2 start 0
                          

                          Here’s the output from those other two commands:

                          lsb_release -a
                          No LSB modules are available.
                          Distributor ID: Ubuntu
                          Description:    Ubuntu 24.04 LTS
                          Release:        24.04
                          Codename:       noble
                          
                          uname -a
                          Linux [computername] 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
                          
                          S 1 Reply Last reply Reply Quote 0
                          • 1
                          • 2
                          • 1 / 2
                          • First post
                            Last post
                          Enjoying MagicMirror? Please consider a donation!
                          MagicMirror created by Michael Teeuw.
                          Forum managed by Sam, technical setup by Karsten.
                          This forum is using NodeBB as its core | Contributors
                          Contact | Privacy Policy