summaryrefslogblamecommitdiffstats
path: root/core/modules/qemukvm/data/opt/openslx/scripts/systemd-qemukvm_env
blob: e19ae1eef0c5a06d377137d9820cae701e907b52 (plain) (tree)
































                                                                                  
#!/bin/ash
# -----------------------------------------------------------------------------
# Copyright (c) 2013 - OpenSLX GmbH
#
# This program/file is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your feedback to feedback@openslx.org
#
# General information about OpenSLX can be found at http://openslx.org
# -----------------------------------------------------------------------------
# systemd-qemukvm_env
#    - This is the preparation script for the configuration of Linux Qemu/KVM.
################################################################################


modprobe kvm
modprobe kvm_amd
modprobe kvm_intel

# check for Linux kvm modules (if required at all)

lsmod |grep kvm || slxlog "qemukvm-modules" "Cannot find any kvm kernel module(s)"

cat >> /etc/sudoers << EOF
# allow to start and stop kvm services / load-/unload kvm modules
ALL ALL=NOPASSWD: /opt/openslx/sbin/tunctl -t kvmnet*
ALL ALL=NOPASSWD: /opt/openslx/sbin/tunctl -d kvmnet*
ALL ALL=NOPASSWD: /opt/openslx/sbin/brctl addif br0 kvmnet*
ALL ALL=NOPASSWD: /opt/openslx/bin/ip link set dev kvmnet* *
EOF