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.

    Failed to Connect to Wayland Display

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    58 Posts 7 Posters 6.8k Views 6 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.
    • S Offline
      sdetweil @hrt13
      last edited by sdetweil

      @hrt13 yes, I fixed it the same way for new installs

      Need some time to fix for existing

      I have fixed upgrade to update mm.sh for start:x11 if wayland is not running

      Sam

      How to add modules

      learning how to use browser developers window for css changes

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

        @sdetweil

        I’m having a similar issue and I’ve been following this post but I still can’t resolve the error.

        [94483:0406/164800.222694:ERROR:ui/ozone/platform/wayland/host/wayland_connection.cc:202] Failed to connect to Wayland display: No such file or directory (2)
        [94483:0406/164800.222815:ERROR:ui/ozone/platform/wayland/ozone_platform_wayland.cc:281] Failed to initialize Wayland platform
        [94483:0406/164800.222849:ERROR:ui/aura/env.cc:246] The platform failed to initialize.  Exiting.
        /home/ferguson/MagicMirror/node_modules/electron/dist/electron exited with signal SIGSEGV
        [94821:0406/164812.960910:ERROR:ui/ozone/platform/wayland/host/wayland_connection.cc:202] Failed to connect to Wayland display: No such file or directory (2)
        [94821:0406/164812.962540:ERROR:ui/ozone/platform/wayland/ozone_platform_wayland.cc:281] Failed to initialize Wayland platform
        [94821:0406/164812.962598:ERROR:ui/aura/env.cc:246] The platform failed to initialize.  Exiting.
        

        I’m currently using the following lines in mm.sh

        #!/bin/bash
        cd ~/MagicMirror
        
        if [ $(ps -ef | grep -v grep | grep -i -e xway -e labwc | wc -l) -ne 0 ]; then
           # if WAYLAND_DISPLAYis set, use it, else set to -0
           export WAYLAND_DISPLAY=${WAYLAND_DISPLAY:=wayland-0}
           npm run start:wayland
        else
           npm run start:x11
        fi
        

        Running the PM2 shows the status is online.

        Any help would be greatly appreciated.

        Cheers!

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

          @Scruffy
          Can you open a terminal window and run this command string

          ps -ef | grep -v grep | grep -i -e xway -e labwc

          Then do

          pm2 stop all
          cd MagicMirror 
          npm run start:x11
          

          Does MagicMirror start now?

          Sam

          How to add modules

          learning how to use browser developers window for css changes

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

            @sdetweil

            I ran the first command and this is the output:

            ~ $ ps -ef | grep -v grep | grep -i -e xway -e labwc
            ferguson   66504       1  0 15:32 ?        00:00:01 /usr/bin/Xwayland -auth /home/ferguson/.Xauthority :0 -rootless -core -terminate 10 -listenfd 28 -listenfd 29 -displayfd 88 -wm 82
            

            When I run the last commands, it’s still not launching. The MM screen flickers up for a second and then goes away. This isn’t unique to the above steps.

            Logs look similar, if not the same:

            [306765:0406/201018.874374:ERROR:ui/ozone/platform/wayland/host/wayland_connection.cc:202] Failed to connect to Wayland display: No such file or directory (2)
            [306765:0406/201018.874626:ERROR:ui/ozone/platform/wayland/ozone_platform_wayland.cc:281] Failed to initialize Wayland platform
            [306765:0406/201018.874711:ERROR:ui/aura/env.cc:246] The platform failed to initialize.  Exiting.
            /home/ferguson/MagicMirror/node_modules/electron/dist/electron exited with signal SIGSEGV
            [307094:0406/201032.033709:ERROR:ui/ozone/platform/wayland/host/wayland_connection.cc:202] Failed to connect to Wayland display: No such file or directory (2)
            [307094:0406/201032.033832:ERROR:ui/ozone/platform/wayland/ozone_platform_wayland.cc:281] Failed to initialize Wayland platform
            [307094:0406/201032.033866:ERROR:ui/aura/env.cc:246] The platform failed to initialize.  Exiting.
            /home/ferguson/MagicMirror/node_modules/electron/dist/electron exited with signal SIGSEGV
            

            Strange indeed.

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

              @Scruffy ok, try

              npm run start:wayland

              Sam

              How to add modules

              learning how to use browser developers window for css changes

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

                @sdetweil said:

                npm run start:wayland

                Unfortunately, still no go.

                The whole system is feeling sluggish… I wounder if it’s an SD issue…?

                I have a new SD card arriving later today. I’ll image and reinstall MM and report back.

                If it’s still not working, I’ll provide the logs again.

                Cannot thank you enough, @sdetweil. You’re incredibly responsive and your support is greatly appreciated.

                Cheers!

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

                  @Scruffy use my backup/restore scripts to save and restore your MagicMirror config and modules list

                  https://github.com/sdetweil/MagicMirror-backup-restore
                  Backup, copy off backup folder, tiny size

                  Install new MagicMirror and copy back folder and restore

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 1
                  • A Offline
                    atwist @Scruffy
                    last edited by

                    @Scruffy I actually never resolved my issue either. But, my system was very sluggish as well.

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

                      @atwist the latest PI OS is larger than the previous versions…

                      leading to more swapping. This can affect performance because of the speed of the SD card.

                      free -m

                      will tell you how much memory and swap space you are using.

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      S 1 Reply Last reply Reply Quote 1
                      • S Offline
                        Scruffy @atwist
                        last edited by

                        @atwist what did you end up doing? Or are you still without MM working?

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

                          @sdetweil I ran the command and this is my output.

                                       total       used      free      shared     buff/cache   available
                          Mem:         3992        2153      210       550        2126         1839
                          Swap:        511         30        481
                          

                          Is the output in MB? Doesn’t seem like it’s to the point where everything is so slow to respond.

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

                            @Scruffy pi4, 4 gig?

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

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

                              @sdetweil Pi 5 4GB

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

                                @sdetweil UPDADE:

                                I have MagicMirror back up and running using a new SD card. I’m guessing the old one died for whatever reason since the whole system was becoming extremely sluggish to the point it would take 10 seconds between input commands triggering.

                                Glad to be back up and running!

                                Thank you again for all your help troubleshooting and support us!

                                Cheers!

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

                                  @Scruffy awesome!!! Thanks for the feedback!

                                  How did you migrate your config ?
                                  Just interested in how people do things

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

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

                                    @sdetweil I’m still very new to Linux/Pi so I was concerned I may have corrupted my original config file(s) with all the changes/modifications I was performing when trying to get the original system back up and running.

                                    I copied over the old config.js which has all my module settings.

                                    I installed MM from scratch along with all the modules. I then brought up both config.js files in Geany and copied and pasted over my configurations.

                                    Not the cleanest of methods but it worked lol.

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

                                      @Scruffy thanks.

                                      Sam

                                      How to add modules

                                      learning how to use browser developers window for css changes

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

                                        @Scruffy I strongly recommend using some backup/restore mechanism,
                                        please see my backup/restore scripts for one approach.

                                        they also support versioning, so you can tell one set of changes from another and can go back or forward…
                                        and move between systems. too…

                                        https://github.com/sdetweil/MagicMirror-backup-restore.git

                                        and I also support the install/upgrade scripts, mentioned in the MM doc, Alternative install section

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

                                        M S 2 Replies Last reply Reply Quote 1
                                        • M Offline
                                          magicmikael @sdetweil
                                          last edited by

                                          @sdetweil, I am running into a similar occurrence but from your initial post I don’t have pm2 installed (as you can see below). Any advice would be appreciated. I have completely reimaged my Pi and retried the steps.

                                          I followed all of the standard manual install steps, have git and node and npm.

                                          This is what I am getting when attempting to run ‘node --run start’

                                          Starting server on port 8080 …
                                          [1877:0409/161415.143762:ERROR:ui/ozone/platform/wayland/host/wayland_connection.cc:202] Failed to connect to Wayland display: No such file or directory (2)
                                          [1877:0409/161415.143988:ERROR:ui/ozone/platform/wayland/ozone_platform_wayland.cc:281] Failed to initialize Wayland platform
                                          [1877:0409/161415.144045:ERROR:ui/aura/env.cc:246] The platform failed to initialize. Exiting.
                                          /home/onthewall/MagicMirror/node_modules/electron/dist/electron exited with signal SIGSEGV

                                          System Information

                                          • SYSTEM: manufacturer: Raspberry Pi Foundation; model: Raspberry Pi 4 Model B Rev 1.2; virtual: false; MM: v2.35.0
                                          • OS: platform: linux; distro: Debian GNU/Linux; release: 13; arch: arm64; kernel: 6.12.75+rpt-rpi-v8
                                          • VERSIONS: electron: 41.1.0; used node: 24.14.1; installed node: 24.14.1; npm: 11.11.0; pm2:
                                          • ENV: XDG_SESSION_TYPE: undefined; MM_CONFIG_FILE: undefined
                                            WAYLAND_DISPLAY: wayland-1; DISPLAY: undefined; ELECTRON_ENABLE_GPU: undefined
                                          • RAM: total: 3796.68 MB; free: 3304.59 MB; used: 492.10 MB
                                          • OTHERS: uptime: 1 minutes; timeZone: America/Los_Angeles
                                          S 1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            sdetweil @magicmikael
                                            last edited by

                                            @magicmikael as we said in the readme notes on the release

                                            We changed
                                            npm start/node —run start

                                            To launch for Wayland compositor

                                            If you are still on x11
                                            You need to use

                                            npm run start:x11
                                            Or
                                            node —run start:x11

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            M 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 3 / 3
                                            • 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