I have a weird behavior on my xubuntu machine and I don\'t know why.
On Ubuntu 18.04 and 19.04 this happens when you have multiple keyboard layouts installed on your system. Try to select your first keyboard layout from the list to make virtual keyboard work in emulator.
Strangely, it doesn't matter which particular layout you have selected, or if it matches with language in the emulator, but looks like it is related to the position of the keyboard layout in the list.