Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. root@host:~# cat /home/petya/vir_mng/vir_mng.sh
  2. #!/bin/bash
  3.  
  4. while :
  5. do
  6. read -s -n 1 keypressed
  7. case "$keypressed" in
  8. 1) sudo /home/petya/vir_mng/HIDtoWin.sh;;
  9. 2) sudo /home/petya/vir_mng/HIDtoLin.sh;;
  10. *) ;;
  11. esac
  12. done
  13.  
  14. root@host:~# cat /home/petya/vir_mng/HIDtoWin.sh
  15. #!/bin/bash
  16.  
  17. virsh -c qemu:///system detach-device debian9-dt usb_mouse.xml --live > /dev/null 2>&1
  18. virsh -c qemu:///system detach-device debian9-dt usb_kb.xml --live > /dev/null 2>&1
  19. virsh -c qemu:///system attach-device win7_440 usb_mouse.xml --live > /dev/null 2>&1
  20. virsh -c qemu:///system attach-device win7_440 usb_kb.xml --live > /dev/null 2>&1
  21.  
  22. root@host:~# cat /home/petya/vir_mng/usb_mouse.xml
  23. <hostdev mode='subsystem' type='usb' managed='yes'>
  24. <source>
  25. <vendor id='0x046d'/>
  26. <product id='0xc051'/>
  27. </source>
  28. </hostdev>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement