How To Build Xen Orchestra From Sources 2024

Load Debian 12 in a VM on XCP-NG (or where ever you prefer) and as of January 2024 it is recommended that the allocate at least 4GB of ram to that machine and as many CPU resources as you find reasonable. The source code compiling process speed will vary greatly based on what you have allocated.
Here is the script used GitHub - ronivay/XenOrchestraInstallerUpdater: Xen Orchestra install/update script

Here are the commands used in the video:

git clone https://github.com/ronivay/XenOrchestraInstallerUpdater.git

cd XenOrchestraInstallerUpdater

cp sample.xo-install.cfg xo-install.cfg

vim xo-install.cfg

sudo apt-get install openssl

sudo mkdir /opt/xo

sudo openssl req -newkey rsa:4096 \
            -x509 \
            -sha256 \
            -days 3650 \
            -nodes \
            -out /opt/xo/xo.crt  \
            -keyout /opt/xo/xo.key

Then run the xo-install.sh and choose option 1 to kick off the install process

Once complete you will be able to log into the system using the following credentials

user: admin@admin.net
pass: admin

If you are wanting to use this in production here is the latest blog post covering their new bundled pricing you can go to https://xen-orchestra.com or read their updated bundled pricing here Introducing Vates Virtualization Management Stack

2 Likes

If you don’t want to bother building from source you can use the docker container from the same guy that made this script.

https://hub.docker.com/r/ronivay/xen-orchestra

1 Like

Or download the VM image from one of the XCP-NG hosts (code near the container info) which is the quickest way to get a fresh system up and running (besides using an external computer to run XO-CE).

Only issue i find is that the plugins are “missing”.
Theres no way to get them loaded so…

How are you building the Orchestra, what method

The method Tom shown in the video and outlined here.

By default, from the script as shown in the video, it loads all the plugins.

If you skip the “copy example config” step, it might self generate the config and not load the plugins. Just a guess though.

Hi Tom,

Have you tried to run this install recently ?
I am running into a problem with installing one of the dependencies → yarn .
This is the end of my log:
"

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
gpg: no valid OpenPGP data found.
"

I tried installing by hand with
sudo apt install yarn
but that did not work either.
Please if you have time try to install on clean Debian12 and see if you are getting the same error.

Thank you,
Paul

I am running Debian 12 and I do get the warning that Key is stored in legacy trusted.gpg keyring but it still works fine which means I have not taken the time to fix the issue. Here is a write up on the problem:

[Fixed] apt-key is deprecated. Manage keyring files in trusted.gpg.d

just move trusted.gpg into dir trusted.gpg.d/ and apt update will be clean.

A few additional remarks :

The whole certificate affair is now integrated in the script. This means the only thing you have to do to get a working secure connection is to modify the following lines in the xo-install.cfg file :

PORT="80"
#PATH_TO_HTTPS_CERT=$INSTALLDIR/xo.crt
#PATH_TO_HTTPS_KEY=$INSTALLDIR/xo.key
#AUTOCERT="false"

They should be as such :

PORT="443"
PATH_TO_HTTPS_CERT=$INSTALLDIR/xo.crt
PATH_TO_HTTPS_KEY=$INSTALLDIR/xo.key
AUTOCERT="true"

Also, it is possible to run Xen Orchestra from the Windows Subsystem for Linux. The only constraint is that the WSL Distro has to use Systemd. This is the case by default for Ubuntu. It can be activated for other distros by creating an /etc/wsl.conf file with the following content :

[boot]
systemd=true

I’ve only tested this with Debian, so if you have experience with another distro, feel free to comment.

Just a note for anyone finding this… Linux Mint Debian Edition is detected as not supported by the script all the way at the top. It didn’t really give more details after the fail - not supported error.

Going to try building for the XCP-NG pages from sources, which will probably work. If not then I’ll just install another OS, LMDE was just an experiment to see how I liked it, and it’s OK enough to keep using it.

And all that said, why not just use the image or docker as mentioned above? Backup, lots of backup. After a hardware failure on the primary physical machine that I use, it was nice to be able to continue my work with one of my backup installs.

It will be nice when XO-Lite is working, that will be enough to get you started and to get you out of a jam.

It will be nice when XO-Lite is working, that will be enough to get you started and to get you out of a jam.

You can change line 702 in xo-install.sh …
from this:
runcmd “cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} build”

to this:
runcmd “cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} build –filter @xen-orchestra/web”

then run xo-install.sh on your current XO installation and choose option 2. Upgrade
When the upgrade is finished, login at XO webgui. After that you can browse to /v6.

Thanks, I’ll have to give that a try and see how it is working.

Self-signed keys and Ansible
There might be problems using the the TLS keys generated with openssl the way described if you are to use Ansible to pull inventory from Xen Orchestra.
I succeeded generating new keys, signing these with self-generated Root CA keys and specifying the complete XO hostname in CN (CN=xo.yy.zz) and SAN (as DNS.n=xo.yy.zz) fields, making Ansible pull from XO using plugin community.general.xen_orchestra flawlessly (xo public certs updated/ validated on the Ansible host first).

Hi All

I am running XO on a VM as I am experiencing the same issue on one of my servers.

Clean Install Debian 12
Clean install XO from Sources as per Tom’s instructions

git clone https://github.com/ronivay/XenOrchestraInstallerUpdater.git

cd XenOrchestraInstallerUpdater

cp sample.xo-install.cfg xo-install.cfg

vim xo-install.cfg

sudo apt-get install openssl

sudo mkdir /opt/xo

sudo openssl req -newkey rsa:4096 \
            -x509 \
            -sha256 \
            -days 3650 \
            -nodes \
            -out /opt/xo/xo.crt  \
            -keyout /opt/xo/xo.key

Add server and I get red triangle net to the newly added server XO and the added server is a single host living on the VM as stated 192.168.1.249
Unknown Error
unexpect statusCode 302

server.enable
{
“id”: "1030cf52-10a4-48b7-b3e7-0875f438a32e

"
}
{
“call”: {
“duration”: 12,
“method”: “session.login_with_password”,
“params”: “* obfuscated *”
},
“message”: “unexpect statusCode 302”,
“name”: “Error”,
“stack”: “Error: unexpect statusCode 302
at file:///opt/xo/xo-builds/xen-orchestra-202412211301/packages/xen-api/transports/json-rpc.mjs:24:13
at runNextTicks (node:internal/process/task_queues:60:5)
at processImmediate (node:internal/timers:454:9)
at process.callbackTrampoline (node:internal/async_hooks:130:17)”
}

I would purge and rebuild from sources, also don’t create the cert manually, let the XenOrchestraInstallerUpdater do it for you.