简体   繁体   中英

Scrambled Keyboard - VMware on Linux from NX Client on MBP

The problem:
I have a scrambled keyboard while using VMware Player on Linux from NX Client on a MacBook Pro. Letters are numbers, numbers are letters, delete is comma, e is delete; it's pure madness. I asked Google but it seems just as confused as me.

Note:
I am using an old-school mac keyboard with number pad plugged into my MBP and an additional monitor.

Things I've tried:

  • Altering my Linux keyboard settings (Layout: USA, USA Macintosh. Model: Apple, MBP, Apple Aluminum)
  • Altering my MBP keyboard settings (actually didn't see any settings that would affect this)
  • Unplugging my old-school keyboard with number pad and only using my MBP keyboard

Have the same issue, but with virt-manager (NX client runs on my Mac 10.6.8, connects to an Ubuntu 10.10 server and all is well, but if I run virt-manager and open a virtual machine, the keystrokes sent to the VM are all messed up).

I guess it has something to do with the Mac NX client and the VNC client (built into virt-manager) on the linux server. I tested the same setup in a Windowx XP virtual machine and it worked flawlessly. So it's got to be the Mac NX Client somehow.

As a workaround I've found that if I create an SSH with a port-forward from the remote linux-server (where I used to run virt-manager to access a VM running on another server) to the server with the VM and I forward a local port to the VM's vnc-server, then I can start up a VNC client (on the linux-server that I connect to via NX) and connect to the VM via the SSH tunnel and keys work just fine. So in my case the problem is somehow with the Mac NX Client + virt-manager's embedded VNC client.

I'm just guessing here, but VMware Player might use an embedded VNC server+client as well to show you the VM's screen. And both the reason for the problem and the workaround might be the same. Ie. try to use a separate VNC client to connect to the VM.

Update: I've got the solution to my problem, it's a KVM bug. The KVM machine starts the VNC server for the VM without specifying the correct keymap to use. See: http://blog.loftninjas.org/2010/11/17/virt-manager-keymaps-on-os-x/

The solution for VMware Player might be just as simple. A little googling revealed that VMware supports connections to a VM via VNC. Here's how to specify a keyboard layout for a VM's VNC server: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1004815

Probably you just have to:

  1. shut down the VM
  2. open the VMX file in an editor
  3. add the proper keyboard layout to the file as described on the page linked above (I guess you should specify the layout that your Linux server uses, eg. en-us)
  4. start the VM and test with a VNC client

Of course it'd be better if you could tweak the Player's console to handle keycodes properly, but I did not find a fix for that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM