This repository has been archived by the owner on Feb 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup
47 lines (35 loc) · 1.38 KB
/
setup
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
#!/bin/bash
echo "Welcome to vm-mgr installer!"
echo "Going to install qemu & kvm packages in:"
echo "3"
sleep 0.8
echo "2"
sleep 0.8
echo "1"
sleep 0.8
sudo curl -o /usr/bin/vm-mgr https://raw.githubusercontent.com/j0shua-daniel/vm-mgr/refs/heads/main/vm-mgr
sudo chmod +x /usr/bin/vm-mgr; mkdir -p ~/.vm-mgr/
if [ -x "$(command -v apk)" ];
then
doas apk add --no-cache libvirt-daemon qemu-img qemu-system-x86_64 qemu-modules openrc bash; doas rc-update add libvirtd; doas service libvirtd start; modprobe tun; su -c " echo 'tun' >> /etc/modules-load.d/tun.conf; cat /etc/modules | grep tun || echo tun >> /etc/modules"; doas addgroup $USER libvirt; doas rc-update add libvirt-guests; doas service libvirt-guests start
elif [ -x "$(command -v apt-get)" ];
then
sudo apt-get -y --install-recommends install libvirt-clients qemu-system qemu-kvm libvirt-daemon
elif [ -x "$(command -v dnf)" ];
then
sudo dnf install -y qemu-kvm libvirt libvirt-devel
elif [ -x "$(command -v zypper)" ];
then
sudo zypper install libvirt qemu libvirt-daemon-driver-qemu qemu-kvm
elif [ -x "$(command -v xbps-install)" ];
then
sudo xbps-install libvirt qemu
elif [ -x "$(command -v pacman)" ];
then
sudo pacman -S qemu-desktop qemu-img libvirt guestfs-tools libosinfo tuned
elif [ -x "$(command -v swupd)" ];
then
sudo swupd bundle-add kvm-host
else
echo "Failed to install VM packages!"
fi