Skip to content

Commit 6ab5693

Browse files
committed
feat(just): add option to add user to libvirt group
1 parent 6d96727 commit 6ab5693

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

system_files/desktop/shared/usr/share/ublue-os/just/84-bazzite-virt.just

+11-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ setup-virtualization ACTION="":
2323
echo " <option>: Specify the quick option to skip the prompt"
2424
echo " Use 'enable' to select Enable Virtualization"
2525
echo " Use 'disable' to select Disable Virtualization"
26+
echo " Use 'group' to select Add $USER to libvirt group"
2627
echo " Use 'vfio-on' to select Enable VFIO drivers"
2728
echo " Use 'vfio-off' to select Disable VFIO drivers"
2829
echo " Use 'shm' to select Autocreate Looking-Glass shm"
@@ -31,7 +32,14 @@ setup-virtualization ACTION="":
3132
echo "${bold}Virtualization Setup${normal}"
3233
echo "NOTE: Enabling Virtualization will layer virt-manager and qemu"
3334
echo " this will slow down system updates by a lot."
34-
OPTION=$(Choose "Enable Virtualization" "Disable Virtualization" "Enable VFIO drivers" "Disable VFIO drivers" "Autocreate Looking-Glass shm")
35+
OPTION=$(Choose \
36+
"Enable Virtualization" \
37+
"Disable Virtualization" \
38+
"Add $USER to libvirt group" \
39+
"Enable VFIO drivers" \
40+
"Disable VFIO drivers" \
41+
"Autocreate Looking-Glass shm" \
42+
)
3543
fi
3644
if [[ "${OPTION,,}" =~ ^enable[[:space:]]virt ]]; then
3745
virt_test=$(rpm-ostree status | grep -A 4 "●" | grep "virt-manager")
@@ -121,4 +129,6 @@ setup-virtualization ACTION="":
121129
LOOKING_GLASS_TMP"
122130
echo "Adding SELinux context record for /dev/shm/looking-glass"
123131
sudo semanage fcontext -a -t svirt_tmpfs_t /dev/shm/looking-glass
132+
elif [[ "${OPTION,,}" =~ group ]]; then
133+
sudo usermod -aG libvirt $USER
124134
fi

0 commit comments

Comments
 (0)