@@ -693,6 +693,13 @@ usb_passthrough_frontend() { #help the user add USB devices to be forwarded to t
693
693
# no devices specified, reset line to default and comment it out
694
694
sed -i" s/^usb_passthrough=.*/#usb_passthrough='05dc:a720'/g" " $vmdir /bvm-config"
695
695
else
696
+ # First make sure config file has usb_passthrough section. If not, add it.
697
+ grep -q usb_passthrough" $vmdir /bvm-config" || echo "
698
+ #USB forwarding: uncomment this line for the VM to have direct access to a USB device.
699
+ #usb_passthrough='05dc:a720'
700
+ #Replace 05dc:a720 with the value you see, for the device you want, from the output of lsusb
701
+ #For multiple devices, keep it in those quotes, but separate each one with a space character." >> " $vmdir /bvm-config"
702
+
696
703
# edit config file to uncomment the line and replace it with user-selected list of usb devices
697
704
sed -i" s/^#usb_passthrough=/usb_passthrough=/g ; s/^usb_passthrough=.*/usb_passthrough='$( echo" $output " | grep. | tr' \n' ' ' | sed' s/ $//g' ) '/g" " $vmdir /bvm-config"
698
705
fi