[Solved] Container already locked for OpenVZ VPS

OpenVZ is one of the host virtulization technique using since years ago.. It’s simple and easy to manage from the command line. You can do almost all operations from the host machine command line interface itself.

Operations like, creation of VM, termination, start/stop, log into guest machine [here it’s container], migrating containers [VMs] from one host machine to another, etc.. are very simple to manage via commandline interface.

We already covered the basic operations [commands] in one of the previous article. If you are new to OpenVZ or you want to explore more from the host command line interface, just read the article added below:

15+ Commonly using OpenVZ commands and its usages

OpenVZ is a container based, OS level 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. Read more…

In this blog post we are discussing about a common error while stopping a container from the host node. It’s because of the lock file existing on the node server. Error details and the solution is added/explained in this article.

If you get the error as “container already locked” for an OpenVZ VPS when you are trying to stop a VPS, then follow the steps mentioned here.

Assuming that your VPS ID or container ID is 111.

Error details:

[[email protected] ~]# vzctl stop 111
Container already locked


1. Remove the lock.

# rm /vz/lock/VE_ID.lck

[[email protected] ~]#  rm /vz/lock/111.lck
rm: remove regular file `/vz/lock/111.lck'? y

2. Kill the checkpoint

# vzctl chkpnt VE_ID –kill

[[email protected] ~]#  vzctl chkpnt 111 --kill

Done! 🙂 🙂

That’s it dude!! Go ahead!

Related links:

Post navigation

Arunlal Ashok

DevOps Engineer. Linux lover. Traveller.
Always happy for an open discussion! Write to arun ((@)) crybit ((dot)) com.

Leave a Reply

Your email address will not be published. Required fields are marked *