OpenVZ is a container based virtualization technique for Linux. OpenVZ creates multiple secure, isolated Linux containers (otherwise known as VEs or VPSs) on a single physical server. Each container performs and executes exactly like a stand-alone server; a container can be rebooted independently and have root access, users, IP addresses, memory, processes, files, applications, system libraries and configuration files.
We already discussed about the basic command line operation for an OpenVZ node. Please see the documentation >> 15+ Commonly using OpenVZ commands and its usages << for more details. Here I am listing some useful OpenVz commands with example.
Here I explain a fix for the error “Resource temporarily unavailable” while switching user in OpenVZ based servers.
Error details
# su -
Password:
su: cannot set user id: Resource temporarily unavailable
Solution
Edit (add) or change the following values in /etc/security/limits.conf
# vi /etc/security/limits.conf
-------------
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
-------------
It should be okay now!
Please try to switch now and let me know if you have any questions.
Also read:
1, 10+ Commonly using OpenVZ commands and its usages
2, How to Enable/Check TUN/TAP module in VPS(OpenVZ)
Nice and to the point…
Thank you.
Thanks for your feedback. 🙂
# su –
Password:
su: cannot set user id: Resource temporarily unavailable OR it continues to ask for password (even though I’m putting it in correctly)
OR
# sudo su –
RESPONSE: sudo: PERM_ROOT: setresuid(0, -1, -1): too many processes
The issue was resolved by editing the /etc/security/limits.d/90-nproc.conf file to allow root more open files. After that, sysctl -p /etc/sysctl.conf was used to make it take effect.
Thanks, this worked and solved my problem
You’re welcome!
I’m facing the same problem. Since I cant sudo into the system, I cant open the files mentioned in the solution above in write mode and hence cant save the changes. Anything that I’m missing.
Great, working fine..
Thank you!
please help ! I dunno how to edit that since the terminal is not giving me the chance to give it orders 🙁
What exactly are you doing when you add those lines?
Is it safe? Im reseller.
Yes, it’s safe.
why we will this type of error? what might be the cause?