I installed Ubuntu under VirtualBox on my Windows 7 machine. All is working okay, except that when I type a hyphen - I get an apostrophe ' instead. This happens on the command line, in the browser, and elsewhere.

Where can I change the keyboard settings to apply the correct character when keys are pressed?

I'm using VirtualBox 4.1.14 and Ubuntu 12.04.

  • 2
    Could you tell us which type of keyboard do you have and which layout you choose. Note: there are several QWERTY keyboard, try to be more specific if you can. – Huygens May 8 '12 at 20:50

If you open up the launcher and search for keyboard layout, you get the system dialog which controls what layout you're using. Add your keyboards layout to the list and then set it as the default :)

  • 1
    That was it. For some weird reason it was set to "Italian". – user237815 May 8 '12 at 22:52

If you do not have a GUI installed then you can also fix this via the command line:

sudo dpkg-reconfigure keyboard-configuration

The keyboard type on the first screen will likely be correct ("Generic") then when you hit OK (Enter) the other screens will prompt you for language etc. Use arrow keys to scroll up and down between options and "Enter" for OK.

  1. Select the large cog in the bottom left hand corner for System Settings.
  2. Select Keyboard layout (not Keyboard).
  3. Use the plus button to add your keyboard.
  4. The minus button to deselect Italian.
  • This saved me some tome, as the downloaded vbox image had italian. – RainDoctor Aug 15 '14 at 23:02

I had a similar problem with Bitnami Drupal Virtual Machine, running on a VirtualBox instance on Windows 10; in my case, the keyboard is using the Italian layout, but the virtualized Operating System (Ubuntu 64-bit) thought it was using the English layout.

I ran sudo apt-get install console-common, I was asked to choose the layout, and when I selected the Italian one, all went fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.