-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqkvm.sh
15 lines (14 loc) · 1.02 KB
/
qkvm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env bash
sudo apt update && sudo apt install qemu-kvm bridge-utils virt-manager virt-viewer spice-vdagent libhugetlbfs-bin libvirt-clients qemu-utils virt-manager ovmf spice-vdagent && \
sudo sed -i "s/#user = \"root\"/user = \"$(id -un)\"/g" /etc/libvirt/qemu.conf && \
sudo sed -i "s/#group = \"root\"/group = \"$(id -gn)\"/g" /etc/libvirt/qemu.conf && \
sudo usermod -a -G kvm $(id -un) && \
sudo usermod -a -G libvirt $(id -un) && \
sudo systemctl restart libvirtd && \
sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/ && \
wget https://gitlab.com/apparmor/apparmor/-/blob/master/profiles/apparmor.d/usr.sbin.dnsmasq -O ~/usr.sbin.dnsmasq && \
sudo mv ~/usr.sbin.dnsmasq /etc/apparmor.d/ && \
sudo sed -i "s/\/usr\/libexec\/libvirt_leaseshelper m,/\/usr\/libexec\/libvirt_leaseshelper mr,/g" /etc/apparmor.d/usr.sbin.dnsmasq && \
mkdir -p ~/.config/libvirt && \
echo "uri_default = \"qemu:///system\"" >> ~/.config/libvirt/libvirt.conf && \
echo "Restart System & Then Run: extra.sh for cassowary support!"