From 068344d7a256be2b16b52881712cae3420300704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Mon, 24 Oct 2022 21:44:40 +0200 Subject: [PATCH] Update USB devices for VM handover --- hosts/chocolatebar/virtualisation/create-service.nix | 5 +++-- hosts/chocolatebar/virtualisation/default.nix | 2 +- hosts/chocolatebar/virtualisation/guest-xml.nix | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hosts/chocolatebar/virtualisation/create-service.nix b/hosts/chocolatebar/virtualisation/create-service.nix index 00fd21da..b88c089b 100644 --- a/hosts/chocolatebar/virtualisation/create-service.nix +++ b/hosts/chocolatebar/virtualisation/create-service.nix @@ -53,9 +53,10 @@ in ${if vm.handOverUSBDevices then '' # Hand over mouse - USB_DEV=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c52b | grep 'Bus 001' | cut -b 18) + USB_BUS=5 + USB_DEV=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c52b | grep 'Bus 005' | cut -b 18) LINE_NUMBER=$(cat $TMP_FILE | grep -n -A 1 0xc52b | tail -n 1 | cut -b 1,2,3) - sed -i "''${LINE_NUMBER}s/\(.\{33\}\)./\1''${USB_DEV}/" "$TMP_FILE" + sed -i "''${LINE_NUMBER}s/.*/
/" "$TMP_FILE" # Hand over keyboard USB_BUS=$(${pkgs.usbutils}/bin/lsusb | grep 046d:c328 | cut -b 7) diff --git a/hosts/chocolatebar/virtualisation/default.nix b/hosts/chocolatebar/virtualisation/default.nix index 24fa205c..043e3f23 100644 --- a/hosts/chocolatebar/virtualisation/default.nix +++ b/hosts/chocolatebar/virtualisation/default.nix @@ -9,7 +9,7 @@ let isolateGPU = "rx550x"; memory = 48; # in GB - handOverUSBDevices = false; + handOverUSBDevices = true; isolateAnyGPU = isolateGPU != null; in diff --git a/hosts/chocolatebar/virtualisation/guest-xml.nix b/hosts/chocolatebar/virtualisation/guest-xml.nix index 117e4da5..876c6714 100644 --- a/hosts/chocolatebar/virtualisation/guest-xml.nix +++ b/hosts/chocolatebar/virtualisation/guest-xml.nix @@ -190,7 +190,7 @@ in -
+
@@ -198,7 +198,7 @@ in -
+