-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-virtmenager.sh
executable file
·69 lines (60 loc) · 2.23 KB
/
install-virtmenager.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh
command_exists() {
command -v "$@" >/dev/null 2>&1
}
if ! command_exists sudo; then
echo "sudo not install"
fi
install_virt() {
if command_exists pacman; then
sudo pacman -Sy qemu-full virt-manager virt-viewer dnsmasq vde2 bridge-utils \
openbsd-netcat ebtables iptables ebtables iptables edk2-ovmf
else if command_exists apt; then # installer for Debian
apt install libvirt-deamon virt-manager qemu
else if command_exists dnf; then # installer for Fedora
sudo dnf install @virtualization
else echo "I'm sorry"
fi
fi
fi
sudo systemctl enable --now libvirtd.service
sudo usermod -a -G libvirt $(whoami)
sudo usermod -a -G kvm $(whoami)
sudo systemctl restart libvirtd.service
notify-send "Done!"
}
if [[ $1 == --help ]] || [[ $1 == -h ]] || [[ $1 == -HELP ]]; then
cat << 'EOF'
This script will install virt-manager and qemu with all necessary packages,
obviously reading the documentation is recommended.
----------------------------------------------------------------------------
- commands -
----------------------------------------------------------------------------
-y: continues without asking for consent (obviously the user's password will
be required)
EOF
exit 0
fi
if [[ $1 == "-y" ]];then
install_virt
exit 0
fi
cat << 'EOF'
╻ ╻╻┏━┓╺┳╸ ┏┳┓┏━┓┏┓╻┏━┓┏━╸┏━╸┏━┓ ╻┏┓╻┏━┓╺┳╸┏━┓╻ ╻ ┏━╸┏━┓
┃┏┛┃┣┳┛ ┃ ╺━╸┃┃┃┣━┫┃┗┫┣━┫┃╺┓┣╸ ┣┳┛ ┃┃┗┫┗━┓ ┃ ┣━┫┃ ┃ ┣╸ ┣┳┛
┗┛ ╹╹┗╸ ╹ ╹ ╹╹ ╹╹ ╹╹ ╹┗━┛┗━╸╹┗╸ ╹╹ ╹┗━┛ ╹ ╹ ╹┗━╸┗━╸┗━╸╹┗╸
--------------------------------------------------------------
* easy install
* efi firmware
* arm support
* distro supported - Arch Linux, Fedora and Debian
* qemu extra
--------------------------------------------------------------
Do you want to install the virt-manager environment (Yes or No)?
EOF
read con
if [[ $con == "yes" ]] || [[ $con == "y" ]];then
install_virt
exit 0
else echo "exit!!!"
fi