XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Tips on installing XO

    Scheduled Pinned Locked Moved Xen Orchestra
    97 Posts 11 Posters 17.3k Views 9 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.
    • DanpD Offline
      Danp Pro Support Team @jasonnix
      last edited by

      @jasonnix Yes, that looks normal to me.

      J 1 Reply Last reply Reply Quote 1
      • J Offline
        jasonnix @Danp
        last edited by jasonnix

        Hello @Danp,
        I installed the XO, but when I use sudo service orchestra start command, then I can't see the web interface and I must use yarn start. Why?
        The service is running:

        $ sudo service orchestra status
        ● orchestra.service - LSB: forever-service startup script for orchestra
             Loaded: loaded (/etc/init.d/orchestra; generated)
             Active: active (exited) since Sat 2024-03-09 05:02:50 EST; 5s ago
               Docs: man:systemd-sysv-generator(8)
            Process: 31543 ExecStart=/etc/init.d/orchestra start (code=exited, status=0/SUCCESS)
                CPU: 24ms
        
        Mar 09 05:02:47 XO systemd[1]: Starting orchestra.service - LSB: forever-service startup script for orchestra...
        Mar 09 05:02:48 XO orchestra[31543]: Starting orchestra
        Mar 09 05:02:50 XO systemd[1]: Started orchestra.service - LSB: forever-service startup script for orchestra.
        

        No systemd?

        1 Reply Last reply Reply Quote 0
        • DanpD Offline
          Danp Pro Support Team
          last edited by

          It could be a rights issue. What user name did you use when you performed the forever-service install?

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jasonnix @Danp
            last edited by

            @Danp, I did the following command:

            jason@XO:$ sudo forever-service install orchestra -r jason -s dist/cli.mjs
            
            1 Reply Last reply Reply Quote 0
            • DanpD Offline
              Danp Pro Support Team
              last edited by

              IDK. The fact that it shows "active (exited)" is problematic because I would have expected to see "active (running)".

              Have you checked the logs for further information?

              J 1 Reply Last reply Reply Quote 0
              • J Offline
                jasonnix @Danp
                last edited by jasonnix

                @Danp,
                Log says:

                $ sudo cat /var/log/orchestra.log 
                2024-03-09T12:17:14.254Z xo:main INFO Configuration loaded.
                2024-03-09T12:17:14.330Z xo:main WARN Web server could not listen on http://localhost:80 {
                  error: Error: listen EACCES: permission denied 0.0.0.0:80
                      at Server.setupListenHandle [as _listen2] (node:net:1794:21)
                      at listenInCluster (node:net:1859:12)
                      at Server.listen (node:net:1947:7)
                      at Server.listen (/usr/local/src/xen-orchestra-master/node_modules/http-server-plus/index.js:171:12)
                      at makeWebServerListen (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:500:37)
                      at Array.<anonymous> (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:524:5)
                      at Function.from (<anonymous>)
                      at asyncMap (/usr/local/src/xen-orchestra-master/@xen-orchestra/async-map/index.js:23:28)
                      at createWebServer (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:523:9)
                      at main (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:792:27) {
                    code: 'EACCES',
                    errno: -13,
                    syscall: 'listen',
                    address: '0.0.0.0',
                    port: 80,
                    niceAddress: 'http://localhost:80'
                  }
                }
                2024-03-09T12:17:14.337Z xo:main WARN   Access denied.
                2024-03-09T12:17:14.337Z xo:main WARN   Ports < 1024 are often reserved to privileges users.
                ✖ EACCES: permission denied, open '/home/xo/.config/xo-server/config.z-auto.json'
                Error: EACCES: permission denied, open '/home/xo/.config/xo-server/config.z-auto.json'
                {"level":"error","message":"Forever detected script exited with code: 1"}
                {"level":"error","message":"Script restart attempt #1501"}
                2024-03-09T12:17:19.970Z xo:main INFO Configuration loaded.
                2024-03-09T12:17:20.075Z xo:main WARN Web server could not listen on http://localhost:80 {
                  error: Error: listen EACCES: permission denied 0.0.0.0:80
                      at Server.setupListenHandle [as _listen2] (node:net:1794:21)
                      at listenInCluster (node:net:1859:12)
                      at Server.listen (node:net:1947:7)
                      at Server.listen (/usr/local/src/xen-orchestra-master/node_modules/http-server-plus/index.js:171:12)
                      at makeWebServerListen (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:500:37)
                      at Array.<anonymous> (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:524:5)
                      at Function.from (<anonymous>)
                      at asyncMap (/usr/local/src/xen-orchestra-master/@xen-orchestra/async-map/index.js:23:28)
                      at createWebServer (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:523:9)
                      at main (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:792:27) {
                    code: 'EACCES',
                    errno: -13,
                    syscall: 'listen',
                    address: '0.0.0.0',
                    port: 80,
                    niceAddress: 'http://localhost:80'
                  }
                }
                2024-03-09T12:17:20.080Z xo:main WARN   Access denied.
                2024-03-09T12:17:20.081Z xo:main WARN   Ports < 1024 are often reserved to privileges users.
                ✖ EACCES: permission denied, open '/home/xo/.config/xo-server/config.z-auto.json'
                Error: EACCES: permission denied, open '/home/xo/.config/xo-server/config.z-auto.json'
                {"level":"error","message":"Forever detected script exited with code: 1"}
                {"level":"error","message":"Script restart attempt #1502"}
                (node:49836) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
                (Use `node --trace-warnings ...` to show where the warning was created)
                2024-03-09T12:17:25.841Z xo:main INFO Configuration loaded.
                2024-03-09T12:17:25.932Z xo:main WARN Web server could not listen on http://localhost:80 {
                  error: Error: listen EACCES: permission denied 0.0.0.0:80
                      at Server.setupListenHandle [as _listen2] (node:net:1794:21)
                      at listenInCluster (node:net:1859:12)
                      at Server.listen (node:net:1947:7)
                      at Server.listen (/usr/local/src/xen-orchestra-master/node_modules/http-server-plus/index.js:171:12)
                      at makeWebServerListen (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:500:37)
                      at Array.<anonymous> (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:524:5)
                      at Function.from (<anonymous>)
                      at asyncMap (/usr/local/src/xen-orchestra-master/@xen-orchestra/async-map/index.js:23:28)
                      at createWebServer (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:523:9)
                      at main (file:///usr/local/src/xen-orchestra-master/packages/xo-server/src/index.mjs:792:27) {
                    code: 'EACCES',
                    errno: -13,
                    syscall: 'listen',
                    address: '0.0.0.0',
                    port: 80,
                    niceAddress: 'http://localhost:80'
                  }
                }
                2024-03-09T12:17:25.938Z xo:main WARN   Access denied.
                2024-03-09T12:17:25.938Z xo:main WARN   Ports < 1024 are often reserved to privileges users.
                ✖ EACCES: permission denied, open '/home/xo/.config/xo-server/config.z-auto.json'
                Error: EACCES: permission denied, open '/home/xo/.config/xo-server/config.z-auto.json'
                {"level":"error","message":"Forever detected script exited with code: 1"}
                {"level":"error","message":"Script restart attempt #1503"}
                

                Also:

                $ sudo cat /home/xo/.config/xo-server/config.z-auto.json
                cat: /home/xo/.config/xo-server/config.z-auto.json: No such file or directory
                
                DanpD 1 Reply Last reply Reply Quote 0
                • DanpD Offline
                  Danp Pro Support Team
                  last edited by

                  Again... seems like a rights issue. What changes did you make to the config.toml file? Also, did you see this statement in the documentation?

                  In this config file, you can change default ports (80 and 443) for xo-server. If you are running the server as a non-root user, you will need to set the port to 1024 or higher.

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    jasonnix @Danp
                    last edited by

                    @Danp, I just did the following:

                    $ cd packages/xo-server
                    $ mkdir -p ~/.config/xo-server
                    $ cp sample.config.toml ~/.config/xo-server/config.toml
                    
                    1 Reply Last reply Reply Quote 0
                    • DanpD Offline
                      Danp Pro Support Team @jasonnix
                      last edited by

                      @jasonnix said in Tips on installing XO:

                      cat: /home/xo/.config/xo-server/config.z-auto.json: No such file or directory

                      It is trying to create the file, but can't due to the rights issue. You may want to start over and try installing as root to avoid these problems.

                      J 1 Reply Last reply Reply Quote 0
                      • J Offline
                        jasonnix @Danp
                        last edited by jasonnix

                        Hi @Danp,
                        I used sudo. The file is located at /root/.config/xo-server/config.z-auto.json.

                        DanpD 1 Reply Last reply Reply Quote 0
                        • DanpD Offline
                          Danp Pro Support Team @jasonnix
                          last edited by

                          @jasonnix There are settings that need to be configured to run correctly under sudo. Did you make that?

                          J 1 Reply Last reply Reply Quote 0
                          • J Offline
                            jasonnix @Danp
                            last edited by

                            @Danp, Not really. Which settings?

                            DanpD 1 Reply Last reply Reply Quote 0
                            • DanpD Offline
                              Danp Pro Support Team @jasonnix
                              last edited by

                              @jasonnix It is in the documentation at the very bottom.

                              J 1 Reply Last reply Reply Quote 0
                              • J Offline
                                jasonnix @Danp
                                last edited by jasonnix

                                Hi @Danp,
                                Do you mean this?
                                I did:

                                # rm -rf node_modules
                                # yarn
                                # yarn build
                                

                                Then:

                                # nano config.toml
                                
                                useSudo = true
                                

                                After it:

                                # nano /etc/sudoers
                                
                                xo ALL=(root)NOPASSWD: /bin/mount, /bin/umount, /bin/findmnt
                                

                                Then, I tried to install XO as a system service:

                                # yarn global add forever
                                yarn global v1.22.21
                                [1/4] Resolving packages...
                                [2/4] Fetching packages...
                                [3/4] Linking dependencies...
                                [4/4] Building fresh packages...
                                success Installed "forever@4.0.3" with binaries:
                                      - forever
                                Done in 6.52s.
                                #
                                # forever start dist/cli.mjs
                                warn:    --minUptime not set. Defaulting to: 1000ms
                                warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
                                info:    Forever processing file: dist/cli.mjs
                                (node:742838) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
                                (Use `node --trace-warnings ...` to show where the warning was created)
                                (node:742838) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
                                (node:742838) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
                                root@XO:/usr/local/src/xen-orchestra-master/packages/xo-server# yarn global add forever
                                yarn global v1.22.21
                                [1/4] Resolving packages...
                                [2/4] Fetching packages...
                                [3/4] Linking dependencies...
                                [4/4] Building fresh packages...
                                success Installed "forever@4.0.3" with binaries:
                                      - forever
                                Done in 5.91s.
                                #
                                # forever-service install orchestra -r xo -s dist/cli.mjs
                                forever-service version 0.5.11
                                
                                Platform - Debian GNU/Linux 12 (bookworm)
                                Could not provision service
                                Service is already present
                                

                                Finally:

                                # /sbin/service orchestra status
                                ● orchestra.service - LSB: forever-service startup script for orchestra
                                     Loaded: loaded (/etc/init.d/orchestra; generated)
                                     Active: active (exited) since Mon 2024-03-11 05:42:09 EDT; 6min ago
                                       Docs: man:systemd-sysv-generator(8)
                                    Process: 743635 ExecStart=/etc/init.d/orchestra start (code=exited, status=0/SUCCESS)
                                        CPU: 19ms
                                
                                Mar 11 05:42:05 XO systemd[1]: Starting orchestra.service - LSB: forever-service startup script for orchestra...
                                Mar 11 05:42:07 XO orchestra[743635]: Starting orchestra
                                Mar 11 05:42:09 XO systemd[1]: Started orchestra.service - LSB: forever-service startup script for orchestra.
                                
                                1 Reply Last reply Reply Quote 0
                                • J Offline
                                  jasonnix
                                  last edited by jasonnix

                                  Hello,
                                  Any idea to solve this? I have to manually start XO with the forever start dist/cli.mjs command and when I reboot the server, the service doesn't start automatically!

                                  J 1 Reply Last reply Reply Quote 0
                                  • J Offline
                                    john.c @jasonnix
                                    last edited by

                                    @jasonnix said in Tips on installing XO:

                                    Hello,
                                    Any idea to solve this? I have to manually start XO with the forever start dist/cli.mjs command and when I reboot the server, the service doesn't start automatically!

                                    Did you enable that service to start at boot with systemctl enable orchestra.service?

                                    This will make the Xen Orchestra service start automatically on each and every boot.

                                    J 1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      jasonnix @john.c
                                      last edited by jasonnix

                                      Hi @john-c,
                                      I did:

                                      # systemctl enable orchestra.service
                                      orchestra.service is not a native service, redirecting to systemd-sysv-install.
                                      Executing: /lib/systemd/systemd-sysv-install enable orchestra
                                      

                                      Then I rebooted the system and checked the service:

                                      # systemctl status orchestra.service
                                      ● orchestra.service - LSB: forever-service startup script for orchestra
                                           Loaded: loaded (/etc/init.d/orchestra; generated)
                                           Active: active (exited) since Wed 2024-03-27 08:10:55 EDT; 1min 11s ago
                                             Docs: man:systemd-sysv-generator(8)
                                          Process: 514 ExecStart=/etc/init.d/orchestra start (code=exited, status=0/SUCCESS)
                                              CPU: 30ms
                                      
                                      Mar 27 08:10:49 XO systemd[1]: Starting orchestra.service - LSB: forever-service startup script for orchestra...
                                      Mar 27 08:10:53 XO orchestra[514]: Starting orchestra
                                      Mar 27 08:10:55 XO systemd[1]: Started orchestra.service - LSB: forever-service startup script for orchestra.
                                      

                                      XO is not running:

                                      # ss -tupln
                                      Netid   State    Recv-Q   Send-Q       Local Address:Port       Peer Address:Port   Process                                                     
                                      udp     UNCONN   0        0                  0.0.0.0:111             0.0.0.0:*       users:(("rpcbind",pid=468,fd=5),("systemd",pid=1,fd=37))   
                                      udp     UNCONN   0        0                     [::]:111                [::]:*       users:(("rpcbind",pid=468,fd=7),("systemd",pid=1,fd=39))   
                                      tcp     LISTEN   0        511              127.0.0.1:6379            0.0.0.0:*       users:(("redis-server",pid=515,fd=6))                      
                                      tcp     LISTEN   0        4096               0.0.0.0:111             0.0.0.0:*       users:(("rpcbind",pid=468,fd=4),("systemd",pid=1,fd=36))   
                                      tcp     LISTEN   0        511                  [::1]:6379               [::]:*       users:(("redis-server",pid=515,fd=7))                      
                                      tcp     LISTEN   0        4096                  [::]:111                [::]:*       users:(("rpcbind",pid=468,fd=6),("systemd",pid=1,fd=38)) 
                                      

                                      Can't login to XO:

                                      This site can’t be reached
                                      
                                      D 1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        DustinB @jasonnix
                                        last edited by

                                        @jasonnix I think it's time you try and use an installation script. You're clearly having issues that are specific to you.

                                        I'd just give up on this "I don't trust scripts" thing you have if you can't figure this process out, which is really straight-forwards.

                                        1 Reply Last reply Reply Quote 0
                                        • DanpD Offline
                                          Danp Pro Support Team
                                          last edited by

                                          You may want to try removing the service and then installing it again.

                                          J 1 Reply Last reply Reply Quote 0
                                          • J Offline
                                            jasonnix @Danp
                                            last edited by

                                            Hi @Danp,
                                            How?

                                            DanpD 1 Reply Last reply Reply Quote -1
                                            • First post
                                              Last post