To create a container, use the prlctl create
command as follows:
# prlctl create MyCT --vmtype ct
OpenVZ will create a new container with the name MyCT
using the default parameters from the global configuration file /etc/vz/vz.conf
.
If you want to create a container with a guest OS different from the default specified in the global configuration file, add the --ostemplate
option after the prlctl create
command. For example:
# prlctl create MyCT --vmtype ct --ostemplate centos-6-x86_64
All container contents will be stored in this container’s private area. To find out where the private area is located, use the prlctl list
command as follows:
# prlctl list MyCT -i | grep "Home"
Home: /vz/private/26bc47f6-353f-444b-bc35-b634a88dbbcc
Note
Notes:
- The first time you install an operating system in a container, its cache is created. To create a cache, you need to have an active Internet connection to access repositories that contain packages for the respective operating system. You can also set up a local package repository and use this repository to provide packages for your operating system. A local package repository is also required for some commercial distributions (e.g., for Red Hat Enterprise Linux).
- For information on creating containers with preinstalled applications, see Section 7.2.1, “Using Golden Image Functionality”.