Howto Xen XCP-NG: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
= installation =
= installation =
download iso:
download iso:
  wget https://mirrors.xcp-ng.org/isos/8.2/xcp-ng-8.2.1-20231130.iso?https=1 -O xcp-ng-8.2.1-20231130.iso
  wget -c https://mirrors.xcp-ng.org/isos/8.2/xcp-ng-8.2.1-20231130.iso?https=1 -O xcp-ng-8.2.1-20231130.iso
= install xen-orchestra =
= install xen-orchestra =
clone repo using git:
clone repo using git:
Line 10: Line 10:
   - "80:80"
   - "80:80"
   - "443:443"
   - "443:443"
environment:
  - HTTP_PORT=80
  - HTTPS_PORT=443
  # redirect to https
  # redirect to https
   - REDIRECT_TO_HTTPS=true
   - REDIRECT_TO_HTTPS=true
Line 19: Line 22:
   - ./xo-data:/var/lib/xo-server
   - ./xo-data:/var/lib/xo-server
   - ./redis-data:/var/lib/redis
   - ./redis-data:/var/lib/redis
  # mount certificate files to container  
  # if you have geniune ssl use this setting to mount certificate files to container  
  - ./certs/cert.pem:/cert.pem
  - ./certs/cert.pem:/cert.pem
  - ./certs/cert.key:/cert.key
  - ./certs/cert.key:/cert.key
Line 25: Line 28:
start docker container using docker-compose:
start docker container using docker-compose:
  docker-compose up -d
  docker-compose up -d
enter web ui user: admin@admin.net | pass: admin :
https://172.16.100.1
= import cloud image =
= import cloud image =
install guestfs-tools:
install guestfs-tools:
Line 50: Line 56:
restart networkd:
restart networkd:
  systemctl restart systemd-networkd
  systemctl restart systemd-networkd
configure sshd host keys:
dpkg-reconfigure openssh-server
edit /etc/ssh/sshd_config:
edit /etc/ssh/sshd_config:
  PermitRootLogin yes
  PermitRootLogin yes
Line 60: Line 68:
= references =
= references =
* https://github.com/ronivay/XenOrchestraInstallerUpdater
* https://github.com/ronivay/XenOrchestraInstallerUpdater
* https://docs.xcp-ng.org/installation/migrate-to-xcp-ng
* https://docs.xcp-ng.org
* https://docs.xcp-ng.org

Latest revision as of 02:36, 16 May 2024

installation

download iso:

wget -c https://mirrors.xcp-ng.org/isos/8.2/xcp-ng-8.2.1-20231130.iso?https=1 -O xcp-ng-8.2.1-20231130.iso

install xen-orchestra

clone repo using git:

git clone https://github.com/ronivay/xen-orchestra-docker

enable ssl in docker-compose:

# ports
ports:
  - "80:80"
  - "443:443"
environment:
  - HTTP_PORT=80
  - HTTPS_PORT=443
# redirect to https
  - REDIRECT_TO_HTTPS=true
# certificates path inside container
  - CERT_PATH='/cert.pem'
  - KEY_PATH='/cert.key'
# volumes
volumes:
  - ./xo-data:/var/lib/xo-server
  - ./redis-data:/var/lib/redis
# if you have geniune ssl use this setting to mount certificate files to container 
- ./certs/cert.pem:/cert.pem
- ./certs/cert.key:/cert.key
- ./certs/ca.pem:/host-ca.pem

start docker container using docker-compose:

docker-compose up -d

enter web ui user: admin@admin.net | pass: admin :

https://172.16.100.1

import cloud image

install guestfs-tools:

pacman -S guestfs-tools --noconfirm

download debian 12 cloud image:

wget http://cdimage.debian.org/cdimage/cloud/bookworm/latest/debian-12-generic-amd64.qcow2

change image root password:

virt-sysprep -a debian-12-generic-amd64.qcow2 -q --root-password password:debian

convert image to vhd:

qemu-img convert -f qcow2 -O vpc -o subformat=dynamic  debian-12-generic-amd64.qcow2 debian-12-generic-amd64.vhd -p

import image in xen-orchestra:

/ login / import / disk / sr local storage

or trasnfer file to host:

scp debian-12-generic-amd64.vhd root@192.168.75.45:~/

import via cli:

xe vdi-import filename=debian-12-generic-amd64.vhd format=vhd --progress uuid=525d86de-cc81-48df-9c04-02b17d7ad7a5

edit /etc/systemd/network/enX0.network:

[Match]
Name=enX0
[Network]
Address=192.168.75.67/24
Gateway=192.168.77.1
DNS=4.2.2.1
DNS=4.2.2.2

restart networkd:

systemctl restart systemd-networkd

configure sshd host keys:

dpkg-reconfigure openssh-server

edit /etc/ssh/sshd_config:

PermitRootLogin yes
PasswordAuthentication yes

restart sshd:

systemctl restart sshd

remove cloud-init:

apt remove cloud-init -y

references