[SOLVED] Problems migrating OpenVZ containers Proxmox 2->4 (ssh PTY allocation request failed)

maxwellc

New Member
Nov 13, 2015
1
1
1
I have not so far found any mention of the two problems we experienced migrating out OpenVZ containers into LXC when we upgraded to Proxmox 4, so I am memorializing them here in case they are useful to others:

Scenario: CentOS6 container (of maybe unknown template origin) running in OpenVZ under Proxmox 2.x. We followed the normal procedure for migration (proxmoxwiki Convert_OpenVZ_to_LXC) but

1) ssh into the CT gives the error
PTY allocation request failed on channel 0
shell request failed on channel 0

on the client side and

Nov 13 20:12:14 abc-vm sshd[1626]: error: openpty: No such file or directory
Nov 13 20:12:14 abc-vm sshd[1633]: error: session_pty_req: session 0 alloc failed

on the server/container side.

Unfortunately, I can not post the solution clearly because phpBB thinks I am posting a web link, maybe because it has slashes in it.

short form is that inside the container, remove slash dev slash ptmx and softlink it to slash dev slash pts slash ptmx


2) During the conversion, some of our CTs would not recognize as CentOS. (I have no idea if this is relevant to anyone but those
who used whatever templates we used to install our machines, but in case anyone else comes across this.)

The detection code found in
slash usr slash share slash perl5 slash PVE slash LXC slash Setup.pm
gets diverted if it finds the file $rootfs slash etc slash lsb-release and when it turns out to not be Ubuntu, we never get to checking
for
slash etc slash redhat-release to discover RedHat or CentOS. As a result we never do the conversions appropriate to CentOS and so
the converted container will not start.

This quick and dirty change resolved the problem for us: (though the indentation does not look quite like an the screen, so the
cut and paste has messed something up.)


(removed patch text)
(change the logic so it continues trying other indicators instead of failing to the end if lsb-release is present but Ubuntu is not in the file.

Hopefully this is somewhat useful to someone.
 
  • Like
Reactions: sneer
Re: Problems migrating OpenVZ containers Proxmox 2->4 (ssh PTY allocation request fai

Thank a lot for your information :-)
Code:
ln -s /dev/pts/ptmx /dev/ptmx
solved my problem with:
Code:
sshd[XXXXX]: error: openpty: No such file or directorysshd[XXXXX]: error: session_pty_req: session 0 alloc failed
(openvz container converted into 4.0 LXC)
 

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!