lxc-console fails to connect to Converted LXC container

churro

Member
Feb 23, 2017
6
0
6
42
Hello,

I am having a hard time figuring out how to get lxc-console working for an LXC container that was converted from an older openvz proxmox host.

When I try to console into the container using lxc-console it just hangs at

Connected to tty 2
Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a itself

There are other newly created LXC containers on the host that are working just fine but any container that was converted doesn't work.

I don't see anything in the /var/log/secure, but I tested on the container that does work and the login from lxc-console says "LOGIN ON lxc/tty2 BY"

so I found that the following was missing from the /etc/securetty file.
# LXC (Linux Containers)
lxc/console
lxc/tty1
lxc/tty2
lxc/tty3
lxc/tty4
# For libvirt/Virtual Machine Monitor
pts/0

I added that but it is still not working. I'm not sure what else to look at. If anyone has run into this problem or might know what is causing this, I'd appreciate the help

Thanks
 

t.lamprecht

Proxmox Staff Member
Staff member
Jul 28, 2015
5,331
1,641
164
South Tyrol/Italy
shop.proxmox.com
Which DIstribution runs in the containers?

On some Container lxc/ttyX is not a link to ttyY, you could try to add also the following terminals to /etc/securetty:
Code:
Virtual consoles
tty1
tty2
tty3
tty4
 

churro

Member
Feb 23, 2017
6
0
6
42
Thank you for the reply, Those are already there in /etc/securetty. The container is Centos 6.4.

I did notice after the conversion there were thousands of tty and pty files. I already deleted them though
 

t.lamprecht

Proxmox Staff Member
Staff member
Jul 28, 2015
5,331
1,641
164
South Tyrol/Italy
shop.proxmox.com
Hi, I tried to reproduce your problem with success!

Installed a Centos 6 CT on PVE 3.4 updated it to latest versions and the backup/restored it on PVE 4.4.

In my CT noone listened at a tty, so no login console was present, but I had this problem already under PVE 3.4, so it should not worked for you there either?

Anyway, my solution was to get an agetty up on tty1 on CT start, for that add or edit the upstart file '/etc/init/tty1.conf' in the CT so that it looks like:

Code:
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/agetty -8 38400 tty1

This starts an agetty to listen on tty1 when the CT boots up.

And '/etc/securetty' must include
Code:
...
lxc/tty1
tty1
for that to work.

Edit those files by entering the CT with:
Code:
pct enter VMID

So a CT configuration problem. I tested also our new LXC templates, just to be sure, there it works out of the box with no seen problems.
 
  • Like
Reactions: churro

churro

Member
Feb 23, 2017
6
0
6
42
Thank you very much for your diligence. I do not have the problem under pve 3 and being an openvz so the situation might be different.

I tried what you suggested but it's still the same problem. I have done quite a few things already that might be conflicting so I'm going to restore from my original openvz backup again and try your suggestion just to be sure.

1 more thing that might be relevant is the openvz container is from pve 3.1.2

EDIT:
I tried to restore fresh from the openvz backup as well as another container and both still have the same problems even after making the suggested changes
 
Last edited:

vzfanatic

Active Member
Jul 22, 2008
67
0
26
I have the same problem with debian 8 containers backed up on pm3 and pct restored on px4. the gui console does not work. tried the above, still does not work.
 

t.lamprecht

Proxmox Staff Member
Staff member
Jul 28, 2015
5,331
1,641
164
South Tyrol/Italy
shop.proxmox.com
tried to restore fresh from the openvz backup as well as another container and both still have the same problems even after making the suggested changes

:/
I have the same problem with debian 8 containers backed up on pm3 and pct restored on px4. the gui console does not work. tried the above, still does not work.

Entering the CT with pct and starting the agetty porcess manually resolves the problem?
Code:
pct enter VMID
# in the CT then:
/sbin/agetty -8 38400 tty1

Debian 8 is strange though, where they with or without systemd? I'll take another look at it...
 

churro

Member
Feb 23, 2017
6
0
6
42
:/
Code:
pct enter VMID
# in the CT then:
/sbin/agetty -8 38400 tty1

I got the webconsole to get to a login prompt now by doing - /sbin/agetty -8 38400 lxc/tty1 but it just hangs and kicks me out of ssh as well as lxc-attach on the host.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!