retspen / webvirtcloud

WebVirtCloud is virtualization web interface for admins and users
1.67k stars 371 forks source link

dont run the https://clck.ru/9V9fH in the node #593

Open alian001 opened 1 year ago

alian001 commented 1 year ago

hi,my kvm services have used in prod env。

this shell script is must to run?because i can the scirtpt modify more args for the kvm configure,if i run it,i afraid my procduct env have some problem, how can i reduce the problem, but i want to use the webvirtcloud to manage my kvm machine, i have more physical machine,

install final required packages for libvirtd and others on Host Server wget -O - https://clck.ru/9V9fH | sudo sh

if i not run the shell script https://clck.ru/9V9fH
i use the ssh configure , this can replace the shelll https://clck.ru/9V9fH, ???

https://github.com/retspen/webvirtmgr/wiki/Setup-SSH-Authorization

Create file /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla (permissions for user webvirtmgr):# [Remote libvirt SSH access] Identity=unix-user:webvirtmgr Action=org.libvirt.unix.manage ResultAny=yes ResultInactive=yes ResultActive=yes

catborise commented 1 year ago

it does not have to be run. it is a script for easiness. webvirtcloud needs some conf but you can change it manually. for example libvirt need this changes for centos


    if [ "$DISTRO_MAJOR_VERSION" -lt 8 ]; then 
        if [ -f /etc/sysconfig/libvirtd ]; then
            sed -i 's/#LIBVIRTD_ARGS/LIBVIRTD_ARGS/g' /etc/sysconfig/libvirtd
        else
            echoerror "/etc/sysconfig/libvirtd not found. Exiting..."
            exit 1
        fi
        if [ -f /etc/libvirt/libvirtd.conf ]; then
            sed -i 's/#listen_tls/listen_tls/g' /etc/libvirt/libvirtd.conf
            sed -i 's/#listen_tcp/listen_tcp/g' /etc/libvirt/libvirtd.conf
            sed -i 's/#auth_tcp/auth_tcp/g' /etc/libvirt/libvirtd.conf
        else
            echoerror "/etc/libvirt/libvirtd.conf not found. Exiting..."
            exit 1
        fi
    fi
    if [ -f /etc/libvirt/qemu.conf ]; then
        sed -i 's/#[ ]*vnc_listen.*/vnc_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf
        sed -i 's/#[ ]*spice_listen.*/spice_listen = "0.0.0.0"/g' /etc/libvirt/qemu.conf
    else
        echoerror "/etc/libvirt/qemu.conf not found. Exiting..."
        exit 1
    fi
    if [ -f /etc/sasl2/libvirt.conf ]; then
        sed -i 's/: gssapi/: digest-md5/g' /etc/sasl2/libvirt.conf
        sed -i 's/#sasldb_path/sasldb_path/g' /etc/sasl2/libvirt.conf
    else
        echoerror "/etc/sasl2/libvirt.conf not found. Exiting..."
        exit 1
    fi
    if [ "$DISTRO_MAJOR_VERSION" -lt 7 ]; then
        if [ -f /etc/supervisord.conf ]; then
            curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/daemon/gstfsd > /usr/local/bin/gstfsd
            chmod +x /usr/local/bin/gstfsd
            curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/supervisor/gstfsd.conf >> /etc/supervisor.conf
        else
            echoerror "Supervisor not found. Exiting..."
            exit 1
        fi
    else
        if [ -f /etc/supervisord.conf ]; then
            curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/daemon/gstfsd > /usr/local/bin/gstfsd
            chmod +x /usr/local/bin/gstfsd
            curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/supervisor/gstfsd.conf > /etc/supervisord.d/gstfsd.ini
        else
            echoerror "Supervisor not found. Exiting..."
            exit 1
        fi
    fi
    return 0
}```
1. make libvirt daemon network accessible.
2. edit libvirtd.conf and enable listen_tls, listen_tcp, auth_tcp
3. edit qemu.conf enable vnc_listen, spice_listen
4. edit /etc/sasl2/libvirt.conf make digest type md5 (for easiness)
this is it. you dont have to install gstfsd if you do not need.