0

I'm creating a Vagrant Box with Ubuntu Desktop 16.04. The Box requires to have a German Keyboard Layout. How do I create this "German Text Entry Settings" during the provisioning phase in non-interactive mode and set it as standard? (I'm talking about the Icon/Settings in the Menu Bar Top-Left with shows usually "EN" only)

The following things didn't work for me.

  • locale-gen --purge de_DE de_DE.UTF-8 & dpkg-reconfigure locales -f noninteractive
  • modifying /etc/default/keyboard & dpkg-reconfigure keyboard-configuration -f noninteractive
  • echo -e 'LANG="de_DE.UTF-8"\nLANGUAGE="de_DE:de"\n' > /etc/default/locale
  • loadkeys de
geri-m
  • 665
  • 2
  • 11
  • 23
  • 1
    You need to figure out how the desktop environment manages the user's input preferences. In Gnome this used to be managed via `gconf` but recent Ubuntu probably uses something different. There might not even be a way to set a system default elegantly. Are you explicitly adding a user or is the installer doing that for you? – tripleee Jan 19 '18 at 17:44
  • I'm using the standard user that is there and I'm running a bash-Script to do the configuration. But I'll look into ```gconf```. Tnx. – geri-m Jan 19 '18 at 17:57
  • Actually ```gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'de')]"```does exactly what I want, but as the command is executed during the "vagrant provision" process I do get ```default: (process:5524): dconf-WARNING **: failed to commit changes to dconf: Cannot autolaunch D-Bus without X11 $DISPLAY```. – geri-m Jan 19 '18 at 18:51
  • Maybe you can hook this from somewhere inside the user's desktop session hooks or whatever so it runs once the first time you actually log in. This is slightly intrusive, but your description sounds vaguely like at last you won't be shooting anyone else's foot. – tripleee Jan 19 '18 at 19:04
  • 1
    I solved the problem by copying a correctly configured dconf "user" file into ~/.config/dconf/. Not very nice, but does the job. – geri-m Jan 19 '18 at 20:55

0 Answers0