XenServer is a powerful Hypervisor developed by Citrix Systems, Inc as a reliable, and secure open source virtualization platform for server, desktop, and cloud virtualization infrastructures. There exist XCP-ng; an open source alternative to XenServer developed collaboratively for unrestricted features and free of use for everyone.
The standard way of administering XenServer is from CLI and by using GUI XenCenter application. If if you need a web based administration then Xen Orchestra (XO) is the right tool for your Xen and XCP-ng server management. It enables you to visualize and administer the complete Virtualization stack from anywhere. The Xen Orchestra doesn’t require an agent installed on the Desktop machine for it work. All operations are performed from a web console.
If you need to use XOA, refer to the following article:
The hardware requirements for running Xen Orchestra on CentOS / Rocky / AlmaLinux:
- 2 vCPUs
- 2GiB of RAM
- 20GiB of free SR space (2GiB on thin pro SR)
We’re performing this installation on a fresh install of Rocky Linux 8 system. The process should be similar for any other RHEL based systems.
Step 1: Update System
Ensure the system is up-to-date by running the following commands:
sudo dnf -y update
Once the system is updated perform a reboot.
sudo systemctl reboot
After a reboot proceed to the next step.
Step 2: Install Node.js & Yarn
Add Node.JS repository to the system.
curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -
Install Node.js using dnf
command:
sudo dnf install -y nodejs
To install the Yarn package manager, run:
sudo yum install gcc-c++ make -y
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo yum install yarn -y
Confirm installation of Node.js and Yarn
$ node -v
v16.20.0
$ yarn -v
1.22.19
Step 3: Install Xen Orchestra on Rocky / CentOS / Alma
Install Python3 on the system.
sudo dnf install python3 -y
Install dependency packages for building Xen Orchestra on Rocky / CentOS / Alma Linux system.
sudo dnf -y install epel-release
sudo dnf -y install git redis libpng-devel git lvm2 cifs-utils make automake gcc gcc-c++ rpm-build fuse-devel python3-devel
sudo dnf -y install git autoconf automake gettext-devel libtool pkg-config libvhdi-tools
Then build libvhdi
package. We’ll download it from openSUSE libvhdi page.
wget https://download.opensuse.org/repositories/openSUSE:/Factory/standard/src/libvhdi-20221124-3.7.src.rpm
sudo rpm -Uvh libvhdi-20221124-3.7.src.rpm
Step 4: Fetch and Build Xen Orchestra
Download Xen Orchestra source code from github:
git clone -b master https://github.com/vatesfr/xen-orchestra
Navigate to xen-orchestra
directory.
cd xen-orchestra
Install dependencies and build Xen Orchestra from sources.
$ yarn
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
$ yarn build
yarn run v1.22.19
$ turbo run build --scope xo-server --scope xo-server-'*' --scope xo-web
• Packages in scope: xo-server, xo-server-audit, xo-server-auth-github, xo-server-auth-google, xo-server-auth-ldap, xo-server-auth-oidc, xo-server-auth-saml, xo-server-backup-reports, xo-server-load-balancer, xo-server-netbox, xo-server-perf-alert, xo-server-sdn-controller, xo-server-test, xo-server-test-plugin, xo-server-transport-email, xo-server-transport-icinga2, xo-server-transport-nagios, xo-server-transport-slack, xo-server-transport-xmpp, xo-server-usage-report, xo-server-web-hooks, xo-web
• Running build in 22 packages
• Remote caching disabled
Tasks: 26 successful, 26 total
Cached: 0 cached, 26 total
Time: 2m28.707s
Done in 149.37s.
Now you have to create a config file for xo-server:
cd packages/xo-server
sudo mkdir /etc/xo-server
sudo cp sample.config.toml /etc/xo-server/config.toml
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.
Start and enable redis service.
sudo systemctl enable --now redis
You can try to start xo-server to see if it works. You should have something like this:
$ sudo yarn start
yarn run v1.22.19
Press CTRL+C to close the application.
Configuring forever service
Use forever-service to install XO as a system service:
# yarn global add forever
yarn global v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "for[email protected]" with binaries:
- forever
Done in 6.06s.
# yarn global add forever-service
yarn global v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- forever-service
- get-forever-config
Done in 4.28s.
# yarn global add pm2
yarn global v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- pm2
- pm2-dev
- pm2-docker
- pm2-runtime
Done in 6.54s.
# cd ~/xen-orchestra/packages/xo-server/
# forever-service install orchestra -r root -s dist/cli.mjs
forever-service version 0.5.11
Platform - Ubuntu 22.04.2 LTS
orchestra provisioned successfully
Commands to interact with service orchestra
Start - "sudo service orchestra start"
Stop - "sudo service orchestra stop"
Status - "sudo service orchestra status"
Restart - "sudo service orchestra restart"
Start
# pm2 start dist/cli.mjs
-------------
__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
_\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
_\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
_\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
_\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
_\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
_\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
_\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
_\///______________\///______________\///__\///////////////__
Runtime Edition
PM2 is a Production Process Manager for Node.js applications
with a built-in Load Balancer.
Start and Daemonize any application:
$ pm2 start app.js
Load Balance 4 instances of api.js:
$ pm2 start api.js -i 4
Monitor in production:
$ pm2 monitor
Make pm2 auto-boot at server restart:
$ pm2 startup
To go further checkout:
http://pm2.io/
-------------
[PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] PM2 Successfully daemonized
[PM2] Starting /root/xen-orchestra/packages/xo-server/dist/cli.mjs in fork_mode (1 instance)
[PM2] Done.
┌────┬────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├────┼────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ cli │ default │ 5.114.2 │ fork │ 12495 │ 0s │ 0 │ online │ 0% │ 33.6mb │ root │ disabled │
└────┴────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
STat
# pm2 status
┌────┬────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├────┼────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ cli │ default │ 5.114.2 │ fork │ 12495 │ 17s │ 0 │ online │ 0% │ 172.0mb │ root │ disabled │
└────┴────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
Run this command to generate an active startup script for automatic start.
pm2 startup
pm2 save
Confirm the service is running:
$ sudo ss -tunelp | grep *:80
tcp LISTEN 0 511 *:80 *:* users:(("node /root/xen-",pid=12495,fd=19)) ino:52496 sk:5 v6only:0 <->
If you ever need to delete the service, run the command forever-service delete orchestra
Additionally install xo-cli tool.
$ sudo npm install --global xo-cli
added 45 packages, and audited 46 packages in 6s
5 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
npm notice
npm notice New major version of npm available! 8.19.4 -> 9.6.7
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.7
npm notice Run npm install -g [email protected] to update!
npm notice
Step 5: Access Xen Orchestra Web interface
You can now access the web UI of Xen Orchestra by putting the IP you configured during deployment into your web browser.
Use below default login credentials:
Username: [email protected]
Password: admin
Navigate to “Settings” > “Users“
Select admin user and click “edit” under Password section to update user’s password.
Step 6: Add XenServer | XCP-ng Server
Add the Xen|XCP-ng server by going to “Home” > “Add server“
Input the server label, IP Address, Username and Password used to login.
Confirm connection is successful
You can now see existing Virtual Machines and create new ones from XO console.
Similar articles: