日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

KVM通过qemu实现USB重定向

發布時間:2024/8/26 综合教程 30 生活家
生活随笔 收集整理的這篇文章主要介紹了 KVM通过qemu实现USB重定向 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

KVM是通過qemu來支持USB設備的,可以在啟動的時候就指定需要連接的USB設備,也可以系統啟動后動態的添加刪除.通過qemu的help可知,使用qemu的usb_add host:xxx:xxx來添加usb設備,那么如何知道對應的host:xxx:xxx呢,有2種方法:
1)在host主機ubuntu中執行lsusb得到這些信息
比如在我機器上usb的信息如下:

1 Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
2 Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
3 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
4 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
5 Bus 001 Device 003: ID 0461:4d80 Primax Electronics, Ltd 
6 Bus 001 Device 006: ID 0951:1665 Kingston Technology 
7 Bus 001 Device 004: ID 058f:b002 Alcor Micro Corp. 
8 Bus 002 Device 003: ID 0489:e010 Foxconn / Hon Hai 

  0951:1665就是我們需要的了。

2)進入服務端虛擬機后,通過ctrl+alt+2調出qemu控制臺,輸入info usb來列出相關已經加載的USB信息。如果顯示:

(qemu): usb support not enabled

If you see 'USB support not enabled', confirm to use option -usb at startup.

-usb
This option adds pseudo USB mouse device to a guest OS.

-usbdevice tablet
When a guest OS has a driver for USB tablet, a mouse doesn't need to click in the guest OS windows to capture.

-usbdevice host:xxxx:yyyy
A USB device xxxx:yyyy on a host OS can be used from a guest OS.

3.)Press Ctrl-Alt-2 and check USB device ID of host OS in QEMU monotor.

 

Then connect USB device (0951:1665) to the guest OS. 0951 is a vender ID and 1665 is a product ID.

(qemu) usb_add host:0951:1665

 Finally, PnP manager of WindowsXP guest recognizes USB mouse and a device driver is installed.

4.)When you want to remove the USB device, remove USB device in guest OS. For example, right click on task bar and select remove the device. The mouse doesn't need to do this. Then check a number of USB bus and address in QEMU monitor.

Use usb_del in QEMU monitor. 0.3 means that the bus number is 0 and the address of USB device is 3.

(qemu) usb_del 0.3

Then remove USB device in host OS. For example, right click on the task bar and remove the USB device as in guest OS. The mouse doesn't need to do this.

After that, unplug the USB device on your machine.

總結

以上是生活随笔為你收集整理的KVM通过qemu实现USB重定向的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。