forked from BigAnteater/KVM-GPU-Passthrough
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libvirt_configuration_apt.sh
49 lines (48 loc) · 1.35 KB
/
libvirt_configuration_apt.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
#!/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
apt install libvirt-dev libvirt-doc libvirt-glib-1.0-0 virt-manager qemu-efi qemu qemu-block-extra ovmf vde2 ebtables dnsmasq bridge-utils netcat-openbsd iptables swtpm qemu-system qemu-system-common
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!"
cp -i /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 append 2>/dev/null
echo "mv libvirtd.conf /etc/libvirt"
sleep 1s
clear
echo "libvirt has been successfully configured!"
sleep 2s
clear
echo "Will ask you if you want to update the old qemu.conf file."
cp -i /etc/libvirt/qemu.conf /etc/libvirt/qemu.conf.old
sleep 1s
echo "mv qemu.conf /etc/libvirt"
mv qemu.conf /etc/libvirt append 2>/dev/null
sleep 1s
clear
systemctl restart libvirtd
mkdir /usr/share/vgabios 2>/dev/null
echo "QEMU has been successfully configured!"
sleep 5s
exit