vzctl – A Quick Guide to Everyday Use Commands

vzctl – A Quick Guide to Everyday Use Commands

Certainly! vzctl is a utility used for managing containers in Virtuozzo, a virtualization platform. Here’s a quick guide to everyday vzctl commands:

1. Creating a Container:

vzctl create <CTID> --ostemplate <OS_template>
  • Replace <CTID> with the Container ID.
  • <OS_template> is the OS template to use for creating the container.

2. Starting a Container:

vzctl start <CTID>
  • Start the container with the specified <CTID>.

3. Stopping a Container:

vzctl stop <CTID>
  • Stop the running container with the specified <CTID>.

4. Entering a Container:

vzctl enter <CTID>
  • Enter the container’s shell to execute commands.

5. Setting Resources:

vzctl set <CTID> --cpus <number>:<limit> --save vzctl set <CTID> --ram <amount>:<limit> --swap <amount>:<limit> --save
  • Set CPU, RAM, and swap limits for the container.

6. Mounting Directories:

vzctl mount <CTID> vzctl umount <CTID>
  • Mount and unmount directories in the container.

7. Setting IP Address:

vzctl set <CTID> --ipadd <IP_address> --save
  • Assign an IP address to the container.

8. Removing a Container:

vzctl destroy <CTID>
  • Remove the container with the specified <CTID>.

9. Listing Containers:

vzlist -a
  • List all containers, including those not currently running.

10. Container Information:

vzctl exec <CTID> df -h vzctl exec <CTID> ps aux
  • Execute commands within the container to get disk space or process information.

11. Snapshotting a Container:

vzctl suspend <CTID> vzctl resume <CTID>
  • Suspend and resume a container to create a snapshot.

12. Setting Hostname:

vzctl set <CTID> --hostname <new_hostname> --save
  • Change the hostname of the container.

13. Applying Configurations:

vzctl applyconfig <CTID> --save
  • Apply changes made to the container’s configuration.

These are basic commands for everyday use with vzctl in Virtuozzo. Adjust parameters and options based on your specific requirements and Virtuozzo setup.

You May Also Like
Proxmox commands cheat sheet terminal output
Read More

Proxmox Commands – cheat sheet

Managing Proxmox Virtual Environment (PVE) through the command line can significantly speed up administration tasks, especially when working…
secure ssh configuration changing default ssh port for linux and windows servers
Read More

How to Change the SSH Port

Why Change the Default SSH Port? Changing the default SSH port is a common security practice that helps…