-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup_qemu.sh
More file actions
39 lines (32 loc) · 1.27 KB
/
setup_qemu.sh
File metadata and controls
39 lines (32 loc) · 1.27 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
#!/bin/bash
# QEMU & Libvirt Setup Script for Arch Linux
# This script installs and configures everything needed to run Windows 11 in Virt-Manager
echo "--- Starting QEMU/Libvirt Setup ---"
# 1. Install necessary packages
echo "[*] Installing QEMU, Virt-Manager, and Windows 11 dependencies..."
sudo pacman -S --needed --noconfirm \
qemu-base \
qemu-desktop \
virt-manager \
virt-viewer \
dnsmasq \
iptables-nft \
bridge-utils \
swtpm \
edk2-ovmf
# 2. Add current user to libvirt group for permission
echo "[*] Adding $USER to libvirt group..."
sudo usermod -aG libvirt $USER
# 3. Enable and start libvirt modular daemons
echo "[*] Starting and enabling libvirt services..."
sudo systemctl enable --now libvirtd
sudo systemctl enable --now virtnetworkd
sudo systemctl enable --now virtstoraged
# 4. Set up default network if it doesn't exist
echo "[*] Ensuring default network is active..."
sudo virsh net-start default 2>/dev/null
sudo virsh net-autostart default 2>/dev/null
echo ""
echo "--- Setup Complete! ---"
echo "IMPORTANT: You MUST log out and log back in (or reboot) for the group changes to take effect."
echo "After logging back in, you can launch 'virt-manager' to start creating your Windows 11 VM."