I`ve recently moved my server from a colocated Xen-box we bought with a few friends to the excellent hosting of UptimeVPS.co. For about €3.75 a month, I get 4GB of memory, 250GB of storage and 2.5TB of traffic. On top of that, you can pick from a very wide selection of operating systems and Linux distributions. I went with Arch Linux.
Here`s what I had to do to get it running like it should:
This is actually a common problem for OpenVZ guests, and is not limited to Arch Linux. You can find a lot of information on the Internet about this issue. It ussually manifests itself with the following error message when you try to SSH into your server:
PTY allocation request failed on channel 0
To fix this, append these lines to /etc/rc.local
:
# Avoid pty bug
rm -rf /dev/ptmx
mknod /dev/ptmx c 5 2
chmod 666 /dev/ptmx
umount /dev/pts
rm -rf /dev/pts
mkdir /dev/pts
mount /dev/pts
udev
and initscripts
to their current versionsSince you share the kernel of the host system with other guests on OpenVZ, you also cant touch certain device nodes. This means
udevcan
t be installed/uninstalled/updated by pacman, so you should keep its version frozen. initscripts
depends on udev
, and ignoring udev
updates without locking initscripts
will cause pacman to fail. To ignore updates for both packages, add the following line to your /etc/pacman.conf
:
IgnorePkg = udev initscripts
/etc/fstab
For some reason, updating my system using pacman -Syu
consistently wiped my /etc/fstab
, which made the server forget to mount /dev/pts
every time I rebooted the VPS.
Make sure you have a copy of your fstab somewhere on your system. I simply copied it to my home directory for safe-keeping:
cp /etc/fstab ~/fstab_backup
After every update, remember to check if your /etc/fstab still contains the needed entries. An empty /etc/fstab
will make it impossible to create the device nodes for PTYs and TTYs discussed above, so they can also cause the familiar PTY allocation request failed on channel 0
error message.
In case you lost your /etc/fstab
, here`s a copy of mine, which should be enough to boot most systems:
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
tmpfs /tmp tmpfs nodev,nosuid 0 0
devpts /dev/pts devpts defaults 0 0
shm /dev/shm tmpfs nodev,nosuid 0 0