Console not working in proxmox lxc container

I followed the guide here:
https://nixos.wiki/wiki/Proxmox_Virtual_Environment

and I am able to ssh in to the container. However, when I use the Proxmox console, I get a cursor. I can type anything I like and see my input, but it does nothing.

I’m having the exact same issues also following the wiki page you linked.

At the bottom of the wiki page you linked there’s a link to the old version of the page, Proxmox Linux Container - NixOS Wiki.

At the very bottom of that page is the below snippet

If you are still unable to get the console to render, you can try changing the console to /dev/console instead of the standard tty.

In the LXC options page, double clicking “Console mode” and changing it from “Default (tty)” to “/dev/console” and restarting the container lets me access the console as expected.

I’ve not been able to figure out why the default doesn’t work.

From debugging using the instructions in Proxmox Virtual Environment - NixOS Wiki it looks like “getty@tty1.service” in systemd is disabled using the minimal/default config.

If I create a minimal config as provided in the wiki and add console.enable = true i get the below error. No /dev/tty0 exists so the service fails to start

root@lldap:~]# systemctl status getty@tty1.service
○ getty@tty1.service - Getty on tty1
     Loaded: loaded (/etc/systemd/system/getty@.service; disabled; preset: enabled)
    Drop-In: /nix/store/3n2fg3yd4m780r1l4hgqggnv9s4g1zdp-system-units/getty@.service.d
             └─overrides.conf
     Active: inactive (dead)
  Condition: start condition failed at Sun 2023-07-16 08:16:01 UTC; 1min 26s ago
             └─ ConditionPathExists=/dev/tty0 was not met
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             http://0pointer.de/blog/projects/serial-console.html

configuration.nix:

[root@lldap:~]# systemctl status getty@tty1.service
○ getty@tty1.service - Getty on tty1
     Loaded: loaded (/etc/systemd/system/getty@.service; disabled; preset: enabled)
    Drop-In: /nix/store/3n2fg3yd4m780r1l4hgqggnv9s4g1zdp-system-units/getty@.service.d
             └─overrides.conf
     Active: inactive (dead)
  Condition: start condition failed at Sun 2023-07-16 08:16:01 UTC; 4min 56s ago
             └─ ConditionPathExists=/dev/tty0 was not met
       Docs: man:agetty(8)
             man:systemd-getty-generator(8)
             http://0pointer.de/blog/projects/serial-console.html

If I do touch /dev/tty0 then systemctl start getty@tty1.service the service comes up. I can then access the console in Proxmox using the “Default (tty)”. On reboot I’ll loose access as manually need to create /dev/tty0 again and then manually start systemctl start getty@tty1.service.

For now I just use /dev/console but it’d be nice for the default proxmox option to work.

1 Like

Hi @aevans,

I’ve also tried to fix this “issue” on my Proxmox system and eventually got ones step closer with the following setting:

  console.enable = true;

  systemd.services."getty@" = {
    unitConfig.ConditionPathExists = ["" "/dev/%I"];
  };

So, back to using the default (tty) console for the LXC container. But now I see with every login via the proxmox console the following error in getty@tty1.service log:

login[36163]: pam_systemd(login:session): Failed to create session: Seat has no VTs but VT number not 0

Well, I have no idea where to go from here … but maybe someone else has one?