-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlibvirt_config.sh
More file actions
55 lines (54 loc) · 1.36 KB
/
libvirt_config.sh
File metadata and controls
55 lines (54 loc) · 1.36 KB
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
53
54
55
#!/bin/bash
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 --needed
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
sed -i "s/amongysus/$USERNAME/g" qemu.conf
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