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

we maintain the Debian templates, not Ubuntu, CentOS, Fedora ...

but there are very easy howto´s to enable the console. but as most use Debian, just use them and be happy.

Many use Ubuntu and CentOS just as they use Debian. I don't understand why the Debian templates were updated but not the rest???
 
Yes a free script or directly implemented this future in a new proxmox version would be nice.

i edited the file on turnkey lamp debian

root@rsproxmox13:~# vzctl enter 100
entered into CT 100
root@rsproxmox13 /# start
start: missing job name
Try `start --help' for more information.
 
Yes a free script or directly implemented this future in a new proxmox version would be nice.

i edited the file on turnkey lamp debian

root@rsproxmox13:~# vzctl enter 100
entered into CT 100
root@rsproxmox13 /# start
start: missing job name
Try `start --help' for more information.

I just switched to SolusVM. Their templates aren't busted.
 
I just switched to SolusVM. Their templates aren't busted.

our templates are not "busted". Proxmox Debian 6 and 7 templates - created with dab - are working by default with our console. The rest are official OpenVZ templates or TKL and are also working great. if you need a console, you can adapt them.

I am pretty sure on SolusVM you will have the same templates, but not such a great console than we have here. but anyways, each user can choose their tools but do not write such bullshit here about our templates - maybe your username seems to describe your approach - sysfailure?
 
our templates are not "busted". Proxmox Debian 6 and 7 templates - created with dab - are working by default with our console.

Yes, the Debian templates are fine, but the others aren't. The others require me to manually configure the system after it's installed to get it to work. That is busted.
 
All templates are working. If you want the console for the third part templates, you need to enable it according to the wiki. is that so hard?
 
furthermore, modifying the templates yourself is extremely easy. you can

a) extract the template, modify it (if you want something custom to be in all CTs you create... like nrpe or mc or a custom /etc/motd, or custom repository URLs), then repack it
or, and this couldnt possibly be any easier:
b) get a modified file (like, a "modded" /etc/inittab) and just replace the file in the template, heres a copy,paste,done-style "tutorial" for that using centos6 as an example:

Code:
cd [TEMPLATE LOCATION]
mkdir -p etc/init

cat <<EOF >etc/init/tty.conf
# 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
EOF

gunzip centos-6-standard_6.3-1_amd64.tar.gz
tar -rf centos-6-standard_6.3-1_amd64.tar etc
gzip centos-6-standard_6.3-1_amd64.tar

rm etc/init/tty.conf
rmdir -p etc/init

EDIT to add: I just added this to the wiki article linked above.
 
Last edited:
All templates are working. If you want the console for the third part templates, you need to enable it according to the wiki. is that so hard?

You're telling me the templates that I can download directly from the Proxmox GUI are 3rd party templates? I wasn't downloading them from another website, I was using the templates available in Proxmox.
 
Yes, there a lot of third party templates.
 
I have also set up 2 containers, one debian and the other ubuntu both templates I downloaded directly. I can't connect to a console on either one. I have followed this and three other links to try and make this function to no avail. Both containers simply say:

screenshot.PNG

Thanks for any help in advance!
 
Last edited by a moderator:
I believe this has been covered many times, but here it is again:

For Ubuntu 12.04:

edit or create: /etc/init/tty.conf

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
 
In ubuntu 12.0.4 LTS not works for me...attach the screenshot. I can't login in the console openvz....I have add:

root@drupal-mo2o:~# cat /etc/inittab
1:2345:respawn:/sbin/getty 38400 tty1

openvz.png


Thanks in advanced.
 
Sorry, I'm not see the post very well- I have add this in /etc/init/tty1.conf. Now it works very well!

# 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
 
I currently wrote a dirty and simple script for Debian, which automically adds the required line to all Debian-containers:
Code:
#!/bin/bash
abPath="/var/lib/vz/root/"
string="1:2345:respawn:/sbin/getty 38400 tty1"
cd $abPath
for dir in $(ls -d */); do
        if [ -f $abPath$dir"etc/debian_version" ]; then
                echo -ne "
[*] Processing CTID $(echo $dir | sed 's|/||g') [`cat $abPath$dir"etc/debian_version"`]... "
                if grep -Fxq "$string" $abPath$dir"etc/inittab"; then
                        echo -e "already exists."
                else
                        echo $string >> $abPath$dir"etc/inittab"
                        if [ ${?} -ne 0 ]; then
                                echo -e "error."
                        else
                                echo -e "done."
                        fi
                fi
        fi
done


Output is something like this:
Code:
root@proxmox /var/lib/vz/root # bash tty.sh 

[*] Processing CTID 100 [7.2]... already exists.

[*] Processing CTID 101 [7.2]... done.

[*] Processing CTID 102 [7.2]... error.

[*] Processing CTID 150 [7.1]... done.

Suggestions welcome :)
 
Last edited:
is there any way to update console login for an old 8.04 ct?
it has no /etc/inittab or /etc/init/tty1.conf...
and can't guess what to do..

Thanks
Marco
 
If you create your own /etc/inittab file, Ubuntu will honour it.

that's the problem: it does not work for me...

i entered the ct with vzctl, created inittab with

Code:
nano /etc/inittab

and then inserted the (only) line:

Code:
1:2345:respawn:/sbin/getty 38400 tty1

then _stopped_ the vm, then started it, and the console it's stuck at

"running local boot scripts (/etc/rc.local) [OK]"

I'm sure I created this CT using the standard 8.04 template (probably on the old 1.7 days...)

...any other idea?

Thanks,
Marco
 
Last edited:
Hm.. sorry I gotta pass then. Thing is I dont even use the console, finding vzctl much more convenient, so I never really bothered with the ins and outs of it
 

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 yours easily in our online shop.

Buy now!