2016-03-26 21:49:41 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
2017-04-27 22:58:43 +02:00
|
|
|
set -o pipefail
|
2016-03-26 21:49:41 +01:00
|
|
|
|
|
|
|
# add the correct user perms
|
|
|
|
gpasswd -a root libvirt
|
|
|
|
gpasswd -a root kvm
|
|
|
|
chown root:kvm /dev/kvm
|
|
|
|
|
|
|
|
# create the bridge for networking
|
|
|
|
ip link add name virt0 type bridge
|
2016-03-26 22:41:58 +01:00
|
|
|
ip link set dev virt0 up
|
2016-03-26 21:49:41 +01:00
|
|
|
bridge link
|
2016-03-26 22:41:58 +01:00
|
|
|
ip addr add dev virt0 172.20.0.1/16
|
|
|
|
iptables -t nat -A POSTROUTING -s 172.20.0.1/16 -j MASQUERADE
|
2016-03-26 21:49:41 +01:00
|
|
|
|
|
|
|
# start the virtlogd daemon
|
|
|
|
exec virtlogd --daemon &
|
|
|
|
|
2018-09-25 01:17:06 +02:00
|
|
|
# shellcheck disable=SC2068
|
2016-03-26 21:49:41 +01:00
|
|
|
exec $@
|