Hypervisor installation - Gargravarr2112/kvm-vdi GitHub Wiki
On Debian based systems:
KVM-VDI uses Python version 2. You may experience problems with Python version 3.
apt-get install qemu-kvm libvirt-bin sudo python python-requests virtinst socat libxml-xpath-perl
Debian Stretch:
Since Debian Stretch the package libvirt-bin replaced with libvirt-daemon-system, libvirt-dev and libvirt-clients.
apt-get install qemu-kvm libvirt-daemon-system libvirt-dev libvirt-clients sudo python python-requests virtinst socat libxml-xpath-perl
NOTICE: Ubuntu apparmor!
You must disable apparmor feature on hypervisors.
Failing to do so will disable "virtual snapshots" capabilities. And won't allow VMs to start
service apparmor stop
update-rc.d -f apparmor remove
apt-get remove apparmor apparmor-utils
reboot
On dashboard servers and hypervisors create VDI user:
useradd -s /bin/bash -m VDI
On dashboard server type:
su VDI
cd
ssh-keygen -t rsa
mkdir /var/hyper_keys
copy files from /home/VDI/.ssh to /var/hyper_keys folder.
Make files in /var/hyper_keys
readable by webserver.
copy rsa.pub file from dashboard /var/hyper_keys folder to each of hypervisors /home/VDI/.ssh/authorized_keys file.
To check if everything works, from dashboard server type:
ssh -i /var/hyper_keys/id_rsa VDI@hypervisor_address
If passwordless connection is established, everythin is fine.
On each hypervisor create /usr/local/VDI folder. Copy all files from "KVM/hypervisors/" folder to /usr/local/VDI/ folder.
Edit config file accordingly. Note: password
parameter in KVM/hypervisors/config
file must match $backend_pass
parameter in dashboard functions/config.php
Edit your /etc/sudoers file according to examlpe of KVM/hypervisors/sudeors file.
Copy systemd init script vdi-agent.service
to your /etc/systemd/system
.
Reload systemd: systemctl daemon-reload
Enable vdi-agent: systemctl enable vdi-agent
Start vdi-agent: systemctl start vdi-agent
Ensure that vdi-agent is running: systemctl status vdi-agent