-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathlibvirt_configuration.sh
52 lines (52 loc) · 1.3 KB
/
libvirt_configuration.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
if [ $EUID -ne 0 ]
then
echo "This program must run as root to function."
exit 1
fi
echo "This will install and configure libvirt."
sleep 1s
pacman -S libvirt libvirt-glib libvirt-python virt-install virt-manager qemu qemu-arch-extra ovmf vde2 ebtables dnsmasq bridge-utils openbsd-netcat iptables swtpm
sleep 1s
systemctl enable libvirtd
echo "systemctl enable libvirtd"
sleep 1s
systemctl start libvirtd
echo "systemctl start libvirtd"
clear
echo "Now it's time to edit your configs!"
mv /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.old
echo "mv /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.old"
sleep 1s
echo "What is your username?"
read USERNAME
sleep 1s
clear
echo "Adding $USERNAME to kvm and libvirt groups..."
gpasswd -M $USERNAME kvm
gpasswd -M $USERNAME libvirt
sleep 2s
clear
mv libvirtd.conf /etc/libvirt
echo "mv libvirtd.conf /etc/libvirt"
sleep 1s
clear
echo "libvirt has been successfully configured!"
sleep 2s
clear
echo "Time for your QEMU configs babe!"
sleep 2s
echo
echo "Yes, honey"
sleep 3s
clear
echo "mv /etc/libvirt/qemu.conf /etc/libvirt/qemu.conf.old"
mv /etc/libvirt/qemu.conf /etc/libvirt/qemu.conf.old
sleep 1s
echo "mv qemu.conf /etc/libvirt"
mv qemu.conf /etc/libvirt
sleep 1s
clear
systemctl restart libvirtd
echo "QEMU has been successfully configured!"
sleep 5s
exit