Passthrough PS/2 keyboard to guest OS
OS Windows run on VM (ubuntu, libvirt, qemu-kvm). And I have PS/2 keyboard on host hardware. Is there any way to pass it to guest OS without lost of performance (maybe emulate USB keyboard with keys mapping from PS/2 keyboard). I tried to use Spice server (from libvirt GUI "Virtual Machine Manager"), but it gives very annoying delay when pressing keys.
ubuntu kvm qemu libvirtd
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
OS Windows run on VM (ubuntu, libvirt, qemu-kvm). And I have PS/2 keyboard on host hardware. Is there any way to pass it to guest OS without lost of performance (maybe emulate USB keyboard with keys mapping from PS/2 keyboard). I tried to use Spice server (from libvirt GUI "Virtual Machine Manager"), but it gives very annoying delay when pressing keys.
ubuntu kvm qemu libvirtd
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
OS Windows run on VM (ubuntu, libvirt, qemu-kvm). And I have PS/2 keyboard on host hardware. Is there any way to pass it to guest OS without lost of performance (maybe emulate USB keyboard with keys mapping from PS/2 keyboard). I tried to use Spice server (from libvirt GUI "Virtual Machine Manager"), but it gives very annoying delay when pressing keys.
ubuntu kvm qemu libvirtd
OS Windows run on VM (ubuntu, libvirt, qemu-kvm). And I have PS/2 keyboard on host hardware. Is there any way to pass it to guest OS without lost of performance (maybe emulate USB keyboard with keys mapping from PS/2 keyboard). I tried to use Spice server (from libvirt GUI "Virtual Machine Manager"), but it gives very annoying delay when pressing keys.
ubuntu kvm qemu libvirtd
ubuntu kvm qemu libvirtd
asked Apr 26 '15 at 18:50
avi9526avi9526
877
877
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
First you must use virsh edit <vm-name>
to modify the configuration XML, as you can't do this through the virt-manager GUI.
Check your top-level <domain>
tag. It should look something like this:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
If the type isn't kvm, you've boarded the wrong flight - start over with a new VM. If the xmlns:qemu attribute isn't there, add it.
If you already have a <qemu:commandline>
section, then add these two lines inside it:
<qemu:arg value='-object'/>
<qemu:arg value='input-linux,id=kbd,evdev=/dev/input/eventN,grab_all=on,repeat=on'/>
If you don't, then create it right under the <domain>
tag with those two tags inside it.
You will also need to create the keyboard device in the guest using the following XML, which you should add to the <devices>
section:
<serial type='dev'>
<source path='/dev/input/eventN'/>
<target port='0'/>
</serial>
The second qemu:arg and the source path defined here both have eventN
defined. You will need to replace N with the input device number for your keyboard. Don't change the target port - just the source path.
My keyboard device is 2, but yours might be 0, or some other number. To find out which one yours is, do dmesg | grep input
and look for your keyboard device. Mine says:
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
You still want to use the path of /dev/input/eventN - this just lets you know what the right number is to use for N. If you're using X with evdev, which you probably are, you can also find this information in the X logfile. One caveat: Your device number might change if you reconfigure your host hardware.
Your keyboard will no longer be recognized by the host while you are using it in a guest. To control the host, you can:
- Exit the guest, or
- Attach another keyboard via USB, or
- Log in via ssh, or
- Use a serial console.
I got most of this information from this link:
https://www.reddit.com/r/VFIO/comments/5hja2k/how_do_you_pass_through_a_ps2_keyboard/
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f198736%2fpassthrough-ps-2-keyboard-to-guest-os%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
First you must use virsh edit <vm-name>
to modify the configuration XML, as you can't do this through the virt-manager GUI.
Check your top-level <domain>
tag. It should look something like this:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
If the type isn't kvm, you've boarded the wrong flight - start over with a new VM. If the xmlns:qemu attribute isn't there, add it.
If you already have a <qemu:commandline>
section, then add these two lines inside it:
<qemu:arg value='-object'/>
<qemu:arg value='input-linux,id=kbd,evdev=/dev/input/eventN,grab_all=on,repeat=on'/>
If you don't, then create it right under the <domain>
tag with those two tags inside it.
You will also need to create the keyboard device in the guest using the following XML, which you should add to the <devices>
section:
<serial type='dev'>
<source path='/dev/input/eventN'/>
<target port='0'/>
</serial>
The second qemu:arg and the source path defined here both have eventN
defined. You will need to replace N with the input device number for your keyboard. Don't change the target port - just the source path.
My keyboard device is 2, but yours might be 0, or some other number. To find out which one yours is, do dmesg | grep input
and look for your keyboard device. Mine says:
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
You still want to use the path of /dev/input/eventN - this just lets you know what the right number is to use for N. If you're using X with evdev, which you probably are, you can also find this information in the X logfile. One caveat: Your device number might change if you reconfigure your host hardware.
Your keyboard will no longer be recognized by the host while you are using it in a guest. To control the host, you can:
- Exit the guest, or
- Attach another keyboard via USB, or
- Log in via ssh, or
- Use a serial console.
I got most of this information from this link:
https://www.reddit.com/r/VFIO/comments/5hja2k/how_do_you_pass_through_a_ps2_keyboard/
add a comment |
First you must use virsh edit <vm-name>
to modify the configuration XML, as you can't do this through the virt-manager GUI.
Check your top-level <domain>
tag. It should look something like this:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
If the type isn't kvm, you've boarded the wrong flight - start over with a new VM. If the xmlns:qemu attribute isn't there, add it.
If you already have a <qemu:commandline>
section, then add these two lines inside it:
<qemu:arg value='-object'/>
<qemu:arg value='input-linux,id=kbd,evdev=/dev/input/eventN,grab_all=on,repeat=on'/>
If you don't, then create it right under the <domain>
tag with those two tags inside it.
You will also need to create the keyboard device in the guest using the following XML, which you should add to the <devices>
section:
<serial type='dev'>
<source path='/dev/input/eventN'/>
<target port='0'/>
</serial>
The second qemu:arg and the source path defined here both have eventN
defined. You will need to replace N with the input device number for your keyboard. Don't change the target port - just the source path.
My keyboard device is 2, but yours might be 0, or some other number. To find out which one yours is, do dmesg | grep input
and look for your keyboard device. Mine says:
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
You still want to use the path of /dev/input/eventN - this just lets you know what the right number is to use for N. If you're using X with evdev, which you probably are, you can also find this information in the X logfile. One caveat: Your device number might change if you reconfigure your host hardware.
Your keyboard will no longer be recognized by the host while you are using it in a guest. To control the host, you can:
- Exit the guest, or
- Attach another keyboard via USB, or
- Log in via ssh, or
- Use a serial console.
I got most of this information from this link:
https://www.reddit.com/r/VFIO/comments/5hja2k/how_do_you_pass_through_a_ps2_keyboard/
add a comment |
First you must use virsh edit <vm-name>
to modify the configuration XML, as you can't do this through the virt-manager GUI.
Check your top-level <domain>
tag. It should look something like this:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
If the type isn't kvm, you've boarded the wrong flight - start over with a new VM. If the xmlns:qemu attribute isn't there, add it.
If you already have a <qemu:commandline>
section, then add these two lines inside it:
<qemu:arg value='-object'/>
<qemu:arg value='input-linux,id=kbd,evdev=/dev/input/eventN,grab_all=on,repeat=on'/>
If you don't, then create it right under the <domain>
tag with those two tags inside it.
You will also need to create the keyboard device in the guest using the following XML, which you should add to the <devices>
section:
<serial type='dev'>
<source path='/dev/input/eventN'/>
<target port='0'/>
</serial>
The second qemu:arg and the source path defined here both have eventN
defined. You will need to replace N with the input device number for your keyboard. Don't change the target port - just the source path.
My keyboard device is 2, but yours might be 0, or some other number. To find out which one yours is, do dmesg | grep input
and look for your keyboard device. Mine says:
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
You still want to use the path of /dev/input/eventN - this just lets you know what the right number is to use for N. If you're using X with evdev, which you probably are, you can also find this information in the X logfile. One caveat: Your device number might change if you reconfigure your host hardware.
Your keyboard will no longer be recognized by the host while you are using it in a guest. To control the host, you can:
- Exit the guest, or
- Attach another keyboard via USB, or
- Log in via ssh, or
- Use a serial console.
I got most of this information from this link:
https://www.reddit.com/r/VFIO/comments/5hja2k/how_do_you_pass_through_a_ps2_keyboard/
First you must use virsh edit <vm-name>
to modify the configuration XML, as you can't do this through the virt-manager GUI.
Check your top-level <domain>
tag. It should look something like this:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
If the type isn't kvm, you've boarded the wrong flight - start over with a new VM. If the xmlns:qemu attribute isn't there, add it.
If you already have a <qemu:commandline>
section, then add these two lines inside it:
<qemu:arg value='-object'/>
<qemu:arg value='input-linux,id=kbd,evdev=/dev/input/eventN,grab_all=on,repeat=on'/>
If you don't, then create it right under the <domain>
tag with those two tags inside it.
You will also need to create the keyboard device in the guest using the following XML, which you should add to the <devices>
section:
<serial type='dev'>
<source path='/dev/input/eventN'/>
<target port='0'/>
</serial>
The second qemu:arg and the source path defined here both have eventN
defined. You will need to replace N with the input device number for your keyboard. Don't change the target port - just the source path.
My keyboard device is 2, but yours might be 0, or some other number. To find out which one yours is, do dmesg | grep input
and look for your keyboard device. Mine says:
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
You still want to use the path of /dev/input/eventN - this just lets you know what the right number is to use for N. If you're using X with evdev, which you probably are, you can also find this information in the X logfile. One caveat: Your device number might change if you reconfigure your host hardware.
Your keyboard will no longer be recognized by the host while you are using it in a guest. To control the host, you can:
- Exit the guest, or
- Attach another keyboard via USB, or
- Log in via ssh, or
- Use a serial console.
I got most of this information from this link:
https://www.reddit.com/r/VFIO/comments/5hja2k/how_do_you_pass_through_a_ps2_keyboard/
answered Sep 25 '17 at 9:37
fluffysheapfluffysheap
1312
1312
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f198736%2fpassthrough-ps-2-keyboard-to-guest-os%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown