HowTo: Enable console login for OpenVZ Debian containers (V2.2 and later)

tom

Proxmox Staff Member
Staff member
Aug 29, 2006
15,420
856
163
Update: See Wiki article on http://pve.proxmox.com/wiki/OpenVZ_Console
____

Beginning with V2.2 (already available in pvetest repo) we implemented a new OpenVZ console.

If you start the console for an existing OpenVZ Debian container you cannot login by default - see screenshot.
no-login.png

In order to enable login, just do the following:

Login via SSH on your Proxmox VE host and 'enter' the container, and open /etc/inittab:
Code:
proxmox-ve:~# vzlist
      CTID      NPROC STATUS    IP_ADDR         HOSTNAME
       107         13 running   192.168.9.100   debian6.maurer-it.com
       108         29 running   192.168.9.101   debian.maurer-it.com
proxmox-ve:~# vzctl enter 108
entered into CT 108
root@debian:/# nano /etc/inittab

On the bottom of /etc/inittab just add the following line, save and poweroff the container:
Code:
1:2345:respawn:/sbin/getty 38400 tty1

now, start the container again by clicking on "start" on the console window and voila, now you can login! see screenshot.
login-enabled.png
 
Last edited:

peterx

Active Member
May 5, 2008
41
1
28
Thank you Tom. It works. But on older openvz ct's based on turnkey ubuntu versions I can't find /etc/inittab.
What now, dear Tom?

Peter
 

tom

Proxmox Staff Member
Staff member
Aug 29, 2006
15,420
856
163
what are "older turnkey" versions? I suggest you contact the creator of the template.
 

peterx

Active Member
May 5, 2008
41
1
28
I mean Turnkey openvz before they turned from ubuntu to debian.
Openvz containers based on ubuntu downloaded at the time from the Proxmox website either don't have the inittab file. In that case: where do I put your line to be able to use the console.
Peter
 

peterx

Active Member
May 5, 2008
41
1
28
Thank you villain666. i tried your proposal on a openvz container ubuntu 10.04.4 LTS. But I found no way to make the console work.
 

tom

Proxmox Staff Member
Staff member
Aug 29, 2006
15,420
856
163
console should work (but no login) - is this true?

as a workaround, just do the following:
- open the shell of the host and just use "vzctl enter CTID"
- or use ssh to access your CT
 

peterx

Active Member
May 5, 2008
41
1
28
That's right, Tom. I get the console but I can't login. I will use the workarounds.
Thank you for your support. proxmox rocks!!
Peter
 

bazzi

Active Member
Jun 4, 2010
107
0
36
And with CentOS(5 and 6) packages it seems not to work. What need I to do to fix that? I search but I can't find anything on internet.
Maybe add an option to choice between console and "vzctl enter"?
 

dietmar

Proxmox Staff Member
Staff member
Apr 28, 2005
17,078
490
103
Austria
www.proxmox.com
Centos6 uses upstart, and you need a working /etc/init/tty.conf - for example:

Code:
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]

stop on runlevel [!2345]

respawn
exec /sbin/agetty -8 tty1 38400
 

dietmar

Proxmox Staff Member
Staff member
Apr 28, 2005
17,078
490
103
Austria
www.proxmox.com
Ubuntu uses upstart, and does not start terminals inside openvz containers by default.

You need to modify /etc/init/tty1.conf

Code:
# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc RUNLEVEL=[2345]

stop on runlevel [!2345]

respawn
exec /sbin/getty -8 38400 tty1
 

dietmar

Proxmox Staff Member
Staff member
Apr 28, 2005
17,078
490
103
Austria
www.proxmox.com
For CentOS5, you need to have the following line in /etc/inittab

Code:
1:2345:respawn:/sbin/agetty tty1 38400 linux
 

c0mputerking

Member
Oct 5, 2011
172
4
18
Don't really see the point in this, i guess i might be nice to login as someother than root, but since you are root you can login to whatever account you wish. Plus without copy/paste auto login as root seemed about the only advantage to proxmox console. Guess i will just keep using putty
 

tom

Proxmox Staff Member
Staff member
Aug 29, 2006
15,420
856
163
Don't really see the point in this, i guess i might be nice to login as someother than root, but since you are root you can login to whatever account you wish. Plus without copy/paste auto login as root seemed about the only advantage to proxmox console. Guess i will just keep using putty

the console show startup logs - very useful. also, you can login to your container without a running network configuration (e.g. if you need to configure veth)

with ssh (putty), you can only enter if the network is running or if you are root on the host (vzctl enter CTID).
 

Chris Rivera

Guest
if a client looses their password... is it possible to reboot the vm and log in as single mode to reset their password?

if so thats great... if not thats a problem...

let me know thanks.
 

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!