WebReinvent Internal Docs
System Admin

Xen Orchestra Installation Guide on Ubuntu

1. Update System Packages

Ensure your system's software repositories are up-to-date:

sudo apt update
sudo apt upgrade
  • sudo apt update: Refreshes the list of available packages from the repositories.
  • sudo apt upgrade: Upgrades the installed packages to their latest versions.

2. Install Prerequisite Packages

Install essential software required by Xen Orchestra:

sudo apt install curl nfs-common neofetch build-essential redis-server libpng-dev git python3-minimal libvhdi-utils lvm2 cifs-utils ntfs-3g
  • Package Descriptions:
    • curl: Command-line tool for transferring data with URLs.
    • nfs-common: Package for NFS (Network File System) support.
    • neofetch: Command-line system information tool displaying system details.
    • build-essential: Essential package for building software on Debian-based systems.
    • redis-server: Key-value database used for caching and message broker.
    • libpng-dev: Development files for the PNG image format library.
    • git: Version control system used to track changes in source code.
    • python3-minimal: Minimal Python interpreter (version 3).
    • libvhdi-utils: Utilities to access Volume Hard Disk Image files.
    • lvm2: Tools for LVM (Logical Volume Manager) administration.
    • cifs-utils: Utilities for managing CIFS (Common Internet File System) shares.
    • ntfs-3g: NTFS file system driver with read-write support.

3. Install Node.js and Yarn

Install Node.js and Yarn, necessary for Xen Orchestra:

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

Note: Xen Orchestra requires Node.js version 18 or higher to run successfully.If your system does not have Node.js 18 installed, it is recommended to install Node Version Manager (NVM) to manage Node.js versions on your machine.

Install Node Version Manager (nvm):

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.bashrc
nvm install v18
nvm use v18

Verify Node.js Version:

node -v

Install yarn

sudo npm install --global yarn
  • Node.js: JavaScript runtime for executing JavaScript code on the server.
  • Yarn: Dependency manager for Node.js packages, ensuring efficient and secure package installations.

4. Obtain Xen Orchestra Source Code

Clone the Xen Orchestra repository from GitHub:

git clone -b master https://github.com/vatesfr/xen-orchestra
cd xen-orchestra/
  • git clone ...: Downloads the Xen Orchestra source code repository from the specified branch (master) on GitHub.
  • cd xen-orchestra/: Navigates into the Xen Orchestra directory.

5. Build Xen Orchestra

Prepare Xen Orchestra for execution:

yarn     # Install project dependencies
yarn build   # Build Xen Orchestra
  • yarn: Installs the necessary project dependencies specified in the project's package.json file.
  • yarn build: Executes the build process to prepare Xen Orchestra for running.

6. Configure XO Server

Set up Xen Orchestra server configurations:

cd packages/xo-server
sudo mkdir -p ~/.config/xo-server
cp sample.config.toml ~/.config/xo-server/config.toml
  • sudo mkdir -p /etc/xo-server: Creates a directory (/etc/xo-server) for Xen Orchestra server configurations if it doesn't exist.
  • sudo cp sample.config.toml /etc/xo-server/config.toml: Copies the sample configuration file to the newly created directory for Xen Orchestra server configurations.
yarn start
http://your_server_ip_address

That’s it! Use your browser to visit the xo-server IP address, and it works! 😃

Default user: "admin@admin.net" with password "admin"

interface

7. Install Forever and Set up Service

Installing forever allows for persistent running of applications, ensuring Xen Orchestra continues to operate even after the terminal session is closed. forever-service facilitates the setup of Xen Orchestra as a service, enabling convenient management, automatic restarts, and better system integration.

cd /xen-orchestra/packages/xo-server
sudo mkdir -p /etc/xo-server
cp sample.config.toml /etc/xo-server/config.toml
yarn global add forever
sudo yarn global add forever forever-service
  • sudo yarn global add ...: Installs forever and forever-service globally to enable their usage from any directory.

Install Xen Orchestra as a service using forever-service:

sudo forever-service install orchestra -r root -s dist/cli.mjs
  • sudo forever-service install ...: Installs Xen Orchestra (orchestra) as a service named orchestra using forever-service. The -r root flag specifies the service to run with root permissions, and -s dist/cli.mjs specifies the entry point for the Xen Orchestra service.

service

8. Start Xen Orchestra Service

Initiate the Xen Orchestra service:

sudo service orchestra start
sudo service orchestra status
  • sudo service orchestra start: Starts the Xen Orchestra service.
  • sudo service orchestra status: Checks the status of the Xen Orchestra service to verify if it's running properly.

status

That’s it! Use your browser to visit the server IP address, and it works without yarn start

Reference:

https://youtu.be/B6qX_nvd8Ac?feature=shared

Additional Notes:

  • Permissions: Ensure appropriate permissions are used (with sudo where needed) to execute commands that require administrative privileges.
  • Configuration: Verify paths and configurations based on your system environment to ensure accuracy.
  • Troubleshooting: Consult Xen Orchestra's documentation or community forums for assistance with any issues encountered during the installation process.

This in-depth guide explains each step thoroughly, allowing for a detailed installation of Xen Orchestra. Adjust commands or paths as per your specific system's requirements


Copyright © 2024