I successfully created an archlinux container on an archlinux host with lxc. However, whenever I start a container via

    lxc-start -n GUESTNAME

the keyboard layout changes to the default us-layout on the host and in the container. But I want it to be de-latin1. What is surprising is that this keeps happening despite the fact that in


on the host and in the container I have set the options


The cause of this problem seems to be that the systemd service responsible for setting the vconsole options is not running inside the container:

            systemctl status systemd-vconsole-setup
     ● systemd-vconsole-setup.service - Setup Virtual Console
       Loaded: loaded (/usr/lib/systemd/system/systemd-vconsole-setup.service; static)
       Active: inactive (dead)
               start condition failed at Mon 2014-06-02 20:53:10 UTC; 27s ago
               ConditionPathExists=/dev/tty0 was not met
         Docs: man:systemd-vconsole-setup.service(8)

Somehow it states that

    /dev/tty0 was not met

but I am unsure what it is trying to tell me. The archlinux linux containers page (https://wiki.archlinux.org/index.php/Linux_Containers#Terminal_settings) is not helping me. Can someone please explain the error and how to solve it?


(1) The keyboard layout does not change when I start the container directly from the console (e.g. by starting tmux tmux new -s stoic then running sudo lxc-start -n stoic and then detaching from the tmux session via CTRL-a-d) i.e. before logging into X.

This points to another possible explanation: When I log into X the keyboard layout gets set by my .xinitrc which has the content:

    setxkbmap -model pc105 -layout de -variant ,qwertz -option lv3:caps_switch
    if [ -s ~/.Xmodmap ]; then
        xmodmap ~/.Xmodmap
    [[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

If I then run a container via sudo lxc-start -n stoic within X it will also boot to the console and not to X (that’s the way I set up all my systems). Hence, it resets the keyboard layout I guess. But this wouldn’t be that big a problem if the container would at least respect the aformentioned /etc/vconsole.conf.

(2) I use a privileged container.

(3) Here is my current config-file:

    lxc.cap.drop=sys_module mac_admin mac_override sys_time
    lxc.cgroup.devices.deny = a
    lxc.cgroup.devices.allow = c *:* m
    lxc.cgroup.devices.allow = b *:* m
    lxc.cgroup.devices.allow = c 1:3 rwm
    lxc.cgroup.devices.allow = c 1:5 rwm
    lxc.cgroup.devices.allow = c 1:7 rwm
    lxc.cgroup.devices.allow = c 1:8 rwm
    lxc.cgroup.devices.allow = c 1:9 rwm
    lxc.cgroup.devices.allow = c 4:1 rwm
    lxc.cgroup.devices.allow = c 5:0 rwm
    lxc.cgroup.devices.allow = c 5:1 rwm
    lxc.cgroup.devices.allow = c 5:2 rwm
    lxc.cgroup.devices.allow = c 136:* rwm
    lxc.rootfs = /var/lib/lxc/stoic/rootfs
    lxc.pts = 1024
  • You forgot to mention one important fact: privileged or unprivileged container? Have you tried bind-mounting /dev/tty0 from the host into the container at (container) startup? – 0xC0000022L Jun 5 '14 at 23:34
  • Ah, sorry. I use a privileged container. No, I have no entry lxc.mount=/dev/tty0 in my config. I will edit the post and include my current config. – lord.garbage Jun 6 '14 at 7:18

This has been fixed in releases of lxc >= 1.1 with the introduction of the fuse-filesystem lxcfs. Simply install and set up lxc with lxcfs.

| improve this answer | |

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.