How to set keyboard layout for a macbook Pro?

I'm running Ubuntu in VirtualBox on my Macbook Pro.

I chose a 'French (Mac)' layout (see below). enter image description here

Unfortunately, the character | (vertical bar) does not seem to be mapped! Usually, in Mac OSX, I get it by pressing: Alt+Shift+L.

How can I add a vertical bar (any key combination would be ok) to this keyboard?


Solution 1:

Here is my "commandline solution" (Ubuntu 12.04 server on MacBookPro 10.9 within VirtualBox 4.3.8) :

sudo apt-get install keyboard-configuration
sudo dpkg-reconfigure keyboard-configuration

Keyboard-configuration choices for MackBookPro French keyboard:

-> MacBook / MacBookPro (Intl)

-> French

-> French (again)

-> Right Alt (AltGr)

-> No Compose Key

It seems keyboard settings works fine and are keep after reboot.

--- EDIT Thomas ---

You should install all the console tools to make it work

apt-get install console-data

apt-get install console-setup

apt-get install console-locales

apt-get install keyboard-configuration