Linux 鼠标和键盘在 qemu 模拟器中不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19665412/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Mouse and Keyboard not working in qemu emulator
提问by Zafrullah Syed
I am trying to run Yocto Image in qemu on my Ubuntu laptop with the following command.
我正在尝试使用以下命令在我的 Ubuntu 笔记本电脑上的 qemu 中运行 Yocto Image。
qemu-system-arm -M overo -m 256 -sd ./test.img -clock unix -serial stdio -device usb-mouse -device usb-kbd
Qemu works fine and the image is booted pretty clean, but I am unable to use my keyboard and Mouse. On any key press I get this warning.
Qemu 工作正常,映像启动时非常干净,但我无法使用键盘和鼠标。在任何按键按下时,我都会收到此警告。
usb-kbd: warning: key event queue full
Any workaround for this unresponsive keyboard?
这个无响应的键盘有什么解决方法吗?
采纳答案by Zafrullah Syed
The problem was, I need to specify USB bus number with device number for USB Pass-Through.
Get the list of USB's by this command lsusb
and it will list them as following:
问题是,我需要为 USB Pass-Through 指定带有设备编号的 USB 总线编号。通过此命令获取 USB 列表,lsusb
它将列出如下:
My keyboard bus number is 002 and address is 001. So, change the command based on the device number and address. So, my command will be as follows:
我的键盘总线号是002,地址是001。所以,根据设备号和地址更改命令。所以,我的命令如下:
qemu-system-arm -M overo -m 256 -sd ./test.img -clock unix -serial stdio -usb -device usb-host,hostbus=2,hostaddr=1
You need to add this line -usb -device usb-host,hostbus=2,hostaddr=1
based on the device number and address. To get cursor pointer working add -show-cursor
as specified by here
您需要-usb -device usb-host,hostbus=2,hostaddr=1
根据设备号和地址添加此行。要使光标指针-show-cursor
按照此处指定的方式工作,请添加
回答by vinay hunachyal
Add -show-cursor
argument to your command.
-show-cursor
向您的命令添加参数。
i.e qemu-system-arm -M overo -m 256 -sd ./test.img -clock unix -serial stdio -device usb-mouse -device usb-kbd -show-cursor
IE qemu-system-arm -M overo -m 256 -sd ./test.img -clock unix -serial stdio -device usb-mouse -device usb-kbd -show-cursor
That will emulate your cursor pointer
这将模拟您的光标指针
回答by Patrick Smit
I had the same problem, installing os x 10.0 and the keyboard stopped working, on installing os x 10.1 no mouse even, but after removing the following entries I got it to work (OS X gave me a hint saying USB error at start up in verbose mode)
我遇到了同样的问题,安装 os x 10.0 并且键盘停止工作,在安装 os x 10.1 时甚至没有鼠标,但是在删除以下条目后我让它工作了(OS X 提示我在启动时出现 USB 错误)详细模式)
-device usb-mouse -device usb-kbd