xen中USB设备的使用方法--资料收集
上一篇 / 下一篇 2011-08-02 21:20:23 / 个人分类:xen
TAG:
- 引用 删除 werm520 / 2011-08-22 14:00:42
- (原始网页: http://www.drivers-download.com/cn/downloadlist.php?id=180)
- 引用 删除 werm520 / 2011-08-18 14:18:29
-
On Do, Feb 21, 2008 at 03:15:57 +0200, Andris wrote:
> Hello all!
>
> I have Centos 5.1 64bit xen Dom0 and ABIT mobo with no serial ports.
> The task is:
>
> - connect an external fax modem to Dom0 via USB -> to serial converter cable
> - export that serial port to paravirtualized Gentoo DomU for use with
> Hylafax
>
> I found the solution:
> http://www.olivetalks.com/2008/01/24/usb-forwarding-on-xen by exporting
> mobo usb PCI device to domU.
> But unfortunately it seems not to be stable setup as noted by author.
> Although I successfully use a similar approach for PCI printer port card
> (Dom0) and HASP device (DomU) in production environment with no problems
> at all.
> Are there differences for USB?
>
> I connected USB to serial converter cable to my Dom0 machine. Everything
> is detected and ok. I see /dev/ttyUSB0 as my serial port.
> How to export /dev/ttyUSB0 to my DomU?
> I suppose the irq and ioports options in domU config file are not
> applicable to port created by USB converter cable.
>
> If this setup is impossible for paravirtualized domU, then I can create
> a HVM gentoo DomU.
> What about usb=1 option or serial='/dev/ttyUSB0' option?
You can export it e.g. via network:
Server:
socat TCP4-LISTEN:54321,reuseaddr /dev/ttyUSB0,b115200,nonblock,raw,echo=0
Client:
socat PTY,link=/dev/vmodem0,b115200,raw,echo=0,waitslave TCP4:127.0.0.1:54321
==================================
If you're using Linux on the other computer to view and log the serial console:
In linux you can get a list of the serial ports by running "dmesg | grep ttyS". USB serial adapters are usually named "ttyUSB*", so you can check for them with "dmesg | grep ttyUSB".
You can use for example "minicom", "kermit" or many other tools to view the serial console. You can start minicom with "minicom -s" to enter the setup mode to configure the serial settings. Another option is to press "Ctrl-A p" when minicom is running to enter the settings dialog. After configuring the settings remember to save them, and then restart minicom. "Ctrl-A x" can be used to quit minicom. Read the minicom man-page for more information about the usage.
You can also use simple "screen" command to view the serial console: "screen /dev/ttyUSB0 115200".
==================================================
- 引用 删除 werm520 / 2011-08-04 14:15:23
-
添加usb文件:
1、在将usb插入宿主机前,通过lsusb查看设备;
2、插入后,在通过lsusb查看,新加的设备即为usb设备;
3、将usb设备假如xm管理
创建一个用来管理usb的通用账户:
xm usb-hc-create Domain-0 2 8
//This creates a virtual USB 2.0 host controller on the guest that has 8 ports.
通过命令获取usb信息:
xm usb-list-assignable-devices
将usb接入管理
xm usb-attach Domain-0 0 1 8-1
通过xm usb-list Domain-0可以查看
4、确认VM支持接入usb设备:
查看VMconfig.xen文件,确认是否有参数usb = 1,当存在这个参数时VM可以在线接入usb设备。
如果想VM启动时,就载入USB设备,可以增加参数
usbdevice='host 0644:1008' //其中 0644:1008 为上图查出的ID后的参数后
5、将USB设备接入VM,命令格式如下:
xm usb-add <domain> <[host:bus.addr] [host:vendor_id:product_id]>
例:xm usb-add 52 host:0644:1008 (52为VMID,host:为设备ID,既上图查出的ID)
接入后 windows就可以正常看到设备了,linux如需使用该设备则需要安装相关驱动,且设备支持linux。
通过 xm usb-del 52 host:0644:1008 可去除usb
备注:
linux发现USB设备需要载入以下模块(不同版本linux可能文件夹位置有所不同,find后载入):
/lib/modules/`uname -r`/kernel/drivers/ide/ide-core.ko
/lib/modules/`uname -r`/kernel/drivers/scsi/scsi_mod.ko
/lib/modules/`uname -r`/kernel/drivers/scsi/sd_mod.ko
/lib/modules/`uname -r`/kernel/drivers/usb/core/usbcore.ko //redhat没有该模块
/lib/modules/`uname -r`/kernel/drivers/usb/host/ehci-hcd.ko
/lib/modules/`uname -r`/kernel/drivers/usb/host/ohci-hcd.ko
/lib/modules/`uname -r`/kernel/drivers/usb/host/uhci-hcd.ko
/lib/modules/`uname -r`/kernel/drivers/usb/storage/usb-storage.ko
/lib/modules/`uname -r`/kernel/drivers/usb/input/usbhid.ko #加载这个模块是为了支持USB键盘,如果在启动过程中,如果出现无法找到root的时候,会进入一个临时的shell,因此可能需要一些简单的调试,如 果是USB键盘的话,就必须要加载这个模块了
/lib/modules/`uname -r`/kernel/fs/ext2/ext2.ko
/lib/modules/`uname -r`/kernel/fs/ext3/ext3.ko
/lib/modules/`uname -r`/kernel/fs/jbd/jbd.ko
/lib/modules/`uname -r`/kernel/fs/mbcache.ko
标题搜索
日历
|
|||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
1 | 2 | 3 | 4 | 5 | 6 | ||||
7 | 8 | 9 | 10 | 11 | 12 | 13 | |||
14 | 15 | 16 | 17 | 18 | 19 | 20 | |||
21 | 22 | 23 | 24 | 25 | 26 | 27 | |||
28 | 29 | 30 |
我的存档
数据统计
- 访问量: 38706
- 日志数: 46
- 建立时间: 2010-07-13
- 更新时间: 2019-03-21