Install Xen Orchestra on Ubuntu 20.04 | Debian 10 to manage Xen/XCP-ng

You can download this article in PDF format via the link below to support us.
Download the guide in PDF formatshut down

Xen Orchestra (XO) is a web interface tool for Xen and XCP-ng administrators to visualize and manage the complete virtualization stack. Xen Orchestra does not require an agent to be installed on the desktop to work. All operations are performed from the web interface.

On a VM hosting Xen Orchestra, the minimum hardware requirements are:

  • 2 vCPUs
  • 2GiB of RAM
  • 20GiB of available SR space (2GiB on Thin Pro SR)

If you can connect to the Xen/XCP-ng server, you can complete the installation on an instance running in XCP-ng or any other virtualized environment.

To use off-the-shelf devices, see Deploy Xen Orchestra devices on Xen/XCP-ng from CLI

Step 1: Update the system

Let’s start the installation by updating all system packages:

sudo apt update

You can also consider performing an upgrade:

sudo apt upgrade -y

After the upgrade is complete, you can restart immediately or later.

Step 2: Install Node.js 14 Debian on Ubuntu

The next step is to install Node.js on Ubuntu/Debian Linux system:

curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -

After adding the repository, proceed to install Node.js:

sudo apt install -y nodejs

To install the Yarn package manager, run:

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn

Confirm to install Node.js and Yarn

$ node -v
v14.16.1

$ yarn -v
1.22.5

Step 3: Install XO package on Ubuntu 20.04 | Debian 10

Install Python:

#For Python 2
sudo apt install python2-minimal

#For Python 3
sudo apt install python3-minimal

Install the XO package on Ubuntu 20.04 | Debian 10 by running the following command:

sudo apt update
sudo apt install build-essential redis-server libpng-dev git libvhdi-utils lvm2 cifs-utils

Confirm package installation:

The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential cifs-utils cpp cpp-9 dpkg-dev fakeroot g++ g++-9 gcc gcc-9 gcc-9-base
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libatomic1 libbfio1 libbinutils libc-dev-bin libc6-dev libcc1-0 libcrypt-dev
  libctf-nobfd0 libctf0 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-9-dev libgomp1 libhiredis0.14 libisl22 libitm1 libjemalloc2 liblsan0 liblua5.1-0
  libmpc3 libpng-dev libpng-tools libquadmath0 libstdc++-9-dev libtalloc2 libtevent0 libtsan0 libubsan1 libvhdi-utils libvhdi1 libwbclient0 linux-libc-dev
  lua-bitop lua-cjson make manpages-dev redis-server redis-tools zlib1g-dev
0 upgraded, 58 newly installed, 0 to remove and 0 not upgraded.
Need to get 42.3 MB of archives.
After this operation, 184 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

Step 4: Get the Xen Orchestra code and build it

Next is to clone the Xen Orchestra code from github:

git clone -b master http://github.com/vatesfr/xen-orchestra

Now that you have the code, you can enter the xen-orchestra directory

cd xen-orchestra

Start to build Xen Orchestra and install other dependent packages on Ubuntu/Debian systems.

$ yarn
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
warning [email protected]: Invalid bin field for "url-loader".
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
Done in 180.55s.

$ yarn build
...
Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
[10:36:00] Finished 'buildStyles' after 6.95 s
[10:36:00] Finished 'copyAssets' after 6.96 s
Successfully compiled 129 files with Babel (17350ms).

[10:37:55] Finished 'buildScripts' after 2.03 min
[10:37:55] Finished 'build' after 2.03 min
Done in 138.77s.

Now, you must create a configuration 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 configuration file, you can change the default ports (80 and 443) of xo-server. If you are running the server as a non-root user, you need to set the port to 1024 or higher.

You can try to start xo-server to see if it works. You should have the following:

$ sudo yarn start
yarn run v1.22.5
$ node bin/xo-server
  app-conf /home/jkmutai/xen-orchestra/packages/xo-server/config.toml +0ms
  app-conf /etc/xo-server/config.toml +6ms
2021-04-20T10:42:27.569Z xo:main INFO Configuration loaded.
2021-04-20T10:42:27.575Z xo:main INFO Web server listening on http://[::]:80
2021-04-20T10:42:27.651Z xo:mixins:hooks DEBUG start start…
2021-04-20T10:42:27.774Z xo:mixins:hooks WARN start failure {
  error: Error: Command failed with exit code 5: vgchange -an
    Logical volume ubuntu-vg/ubuntu-lv contains a filesystem in use.
    Can't deactivate volume group "ubuntu-vg" with 1 open logical volume(s)
      at makeError (/home/jkmutai/xen-orchestra/node_modules/execa/lib/error.js:59:11)
      at handlePromise (/home/jkmutai/xen-orchestra/node_modules/execa/index.js:114:26)
      at processTicksAndRejections (internal/process/task_queues.js:93:5) {
    shortMessage: 'Command failed with exit code 5: vgchange -an',
    command: 'vgchange -an',
    exitCode: 5,
    signal: undefined,
    signalDescription: undefined,
    stdout: '',
    stderr: '  Logical volume ubuntu-vg/ubuntu-lv contains a filesystem in use.n' +
      `  Can't deactivate volume group "ubuntu-vg" with 1 open logical volume(s)`,
    failed: true,
    timedOut: false,
    isCanceled: false,
    killed: false
  }
}
  app-conf /home/jkmutai/xen-orchestra/packages/xo-server/config.toml +219ms
  app-conf /etc/xo-server/config.toml +2ms
2021-04-20T10:42:27.799Z xo:xo-mixins:subjects INFO Default user created: [email protected] with password admin
2021-04-20T10:42:27.807Z xo:mixins:hooks DEBUG start finished
2021-04-20T10:42:27.808Z xo:mixins:hooks DEBUG clean start…
2021-04-20T10:42:27.822Z xo:mixins:hooks DEBUG clean finished
2021-04-20T10:42:27.931Z xo:main INFO Setting up / → /home/jkmutai/xen-orchestra/packages/xo-web/dist

use Always serve Install XO as a system service:

$ sudo yarn global add forever
yarn global v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "[email protected]" with binaries:
      - forever
Done in 21.97s.

$ sudo yarn global add forever-service
yarn global v1.22.5
[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 8.77s.

$ cd ~/xen-orchestra/packages/xo-server/bin/
$ sudo forever-service install orchestra -r root -s xo-server
forever-service version 0.5.11
Platform - Ubuntu 20.04.2 LTS
orchestra provisioned successfully

Here are the commands to interact with the service band:

Start   - "sudo service orchestra start"
Stop    - "sudo service orchestra stop"
Status  - "sudo service orchestra status"
Restart - "sudo service orchestra restart"

Let’s start the service:

sudo service orchestra start

Confirm that the service is running:

$ sudo ss -tunelp | grep *:80
tcp    LISTEN  0       511                        *:80                  *:*      users:(("node",pid=269785,fd=18)) ino:1883628 sk:9 v6only:0 <->

If you need Delete service, Run the command:

sudo forever-service delete orchestra

Additional installation xo-cli tool.

$ sudo npm install --global xo-cli
npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated [email protected]: looking for maintainer
/usr/bin/xo-cli -> /usr/lib/node_modules/xo-cli/dist/index.js
+ [email protected]
added 75 packages from 50 contributors in 26.199s

Step 5: Access the Xen Orchestra web interface

Now, you can access Xen Orchestra’s Web UI by putting the IP configured during the deployment process into a web browser.

Use under the following default login credentials:

Username: [email protected]
Password: admin

navigation”Set value“>”User numberInstall Xen Orchestra Ubuntu Debian 02

Select the admin user and click “editThe “” under the “Password” section can update the user’s password.Install Xen Orchestra Ubuntu Debian 03

Step 6: Add XenServer | XCP-ng server

By going to “Add Xen | XCP-ng Server”Home“>”Add serverInstall Xen Orchestra Ubuntu Debian 04

Enter the server label, IP address, username and password used to log in.Install Xen Orchestra Ubuntu Debian 05

Confirm the connection is successfulInstall Xen Orchestra Ubuntu Debian 06

Now you can view existing virtual machines and create new virtual machines through the XO console.Install Xen Orchestra Ubuntu Debian 07

Similar articles:

Add and use ISO library repository in Xen XCP-ng

Use XenCenter to manage the XCP-ng hypervisor | XCP-ng中心

You can download this article in PDF format via the link below to support us.
Download the guide in PDF formatshut down

Sidebar