# Hype² ```mermaid graph LR Webpage[Web page] <--Flask--> Server[Server] Server[Server] <----> Qemu((Qemu)) Server[Server] <----> LXC((LXC)) ``` ## Install requirement 1 - Update and Install packages : ```sh apt-get update -y -qq apt-get install lxc lxcfs lxc-templates qemu qemu-utils qemu-kvm virtinst bridge-utils virt-manager libvirt-daemon libvirt-daemon-system virt-viewer libvirt-clients libosinfo-bin websockify sqlite3 novnc apt-get install python3 python3-flask python3-flask-login python3-flask-sqlalchemy python3-requests python3-lxc python3-libvirt python3-psutil python3-werkzeug python3-websockify python3-novnc ``` 2 - Configure Libvirst to start on boot ```sh systemctl --quiet enable --now libvirtd systemctl --quiet start libvirtd ``` 3 - Create a bridge nework ```sh cp ./bridged.xml /usr/share/libvirt/networks/ virsh net-define bridged.xml virsh net-start bridged virsh net-autostart bridged ``` ## Create Database for user ```sh sqlite3 db.db CREATE TABLE user (id INTEGER PRIMARY KEY AUTOINCREMENT, username NVARCHAR(200) NULL, email NVARCHAR(200) NULL, password NVARCHAR(200) NULL; ``` ## Create first user 1 - Generate encrypted password : ```sh python3 import app app.encrypt('Password') ``` 2 - Fill Database with user info : ```sh sqlite3 db.db INSERT INTO user (id,username,email,password) VALUES (1,'','',':6080/websockify retry=3 ProxyPassReverse /websockify ws://:6080/websockify retry=3 ProxyPass /socket.io ws://:5008/socket.io retry=3 ProxyPassReverse /socket.io ws://:5008/socket.io retry=3 ``` ## Run and use ```sh python3 app and go to https://:5007 with your credentials (mail and normal password) ``` ## Systemd You can manage hype using Systemd management: ```sh [Unit] Description= Hype2 service After=multi-user.target [Service] Type=simple Restart=always ExecStart=/usr/bin/python3 /app.py [Install] WantedBy=multi-user.target ``` put this file in /etc/systemd/system/ and you can then enable it for autostart on boot and/or start/stop the app. ## Configuration You can also change some configuration in the file *configuration.py* such as flask port, storage location...use it at your own risk.