]> git.proxmox.com Git - pve-docs.git/blobdiff - pct.adoc
pct.adoc: add Guest Operating System Configuration
[pve-docs.git] / pct.adoc
index 2f6378f8993a9ad321ccbe11a39e20d5199cbc5e..8c8db744f2c96e68e74db6d841f4123115b4af09 100644 (file)
--- a/pct.adoc
+++ b/pct.adoc
@@ -108,9 +108,14 @@ unique - cluster wide. Files are stored inside '/etc/pve/', so they get
 automatically replicated to all other cluster nodes.
 
 Those configuration files are simple text files, and you can edit them
-using a normal text editor ('vi', 'nano', ...). But one can also use
-the 'pct' command to generate and modify those files, or do the whole
-thing using the GUI.
+using a normal text editor ('vi', 'nano', ...). This is sometimes
+useful to do small corrections, but keep in mind that you need to
+restart the container to apply such changes.
+
+For that reason, it is usually better to use the 'pct' command to
+generate and modify those files, or do the whole thing using the GUI.
+Our toolkit is smart enough to instantaneously apply most changes to
+running containers (hot plug).
 
 
 File Format
@@ -137,6 +142,52 @@ or
 Those settings are directly passed to the LXC low-level tools.
 
 
+Guest Operating System Configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We normally try to detect the operating system type inside the
+container, and then modify some files inside the container to make
+them work as expected. Here is a short list of things we do at
+container startup:
+
+set /etc/hostname:: to set the container name
+
+modify /etc/hosts:: allow to lookup the local hostname
+
+network setup:: pass the complete network setup to the container
+
+configure DNS:: pass information about DNS servers
+
+adopt the init system:: for example, fix the number os spawned getty processes
+
+set the root password:: when creating a new container
+
+rewrite ssh_host_keys:: so that each container has unique keys
+
+randomize crontab:: so that cron does not start at same time on all containers
+
+Above task depends on the OS type, so the implementation is different
+for each OS type. You can also disable any modifications by manually
+setting the 'ostype' to 'unmanaged'.
+
+OS type detection is done by testing for certain files inside the
+container:
+
+Ubuntu:: inspect /etc/lsb-release ('DISTRIB_ID=Ubuntu')
+
+Debian:: test /etc/debian_version
+
+Fedora:: test /etc/fedora-release
+
+RedHat or CentOS:: test /etc/redhat-release
+
+ArchLinux:: test /etc/arch-release
+
+Alpine:: test /etc/alpine-release
+
+NOTE: Container start fails is configured 'ostype' differs from auto
+detected type.
+
 Container Storage
 -----------------
 
@@ -171,11 +222,10 @@ also provides an easy way to share data between different containers.
 Managing Containers with 'pct'
 ------------------------------
 
-'pct' is a tool to manages Linux Containers (LXC). You can create and
-destroy containers, and control execution
-(start/stop/suspend/resume). Besides that, you can use pct to set
-parameters in the associated config file, like network configuration
-or memory.
+'pct' is the tool to manage Linux Containers on {pve}. You can create
+and destroy containers, and control execution (start, stop, migrate,
+...). You can use pct to set parameters in the associated config file,
+like network configuration or memory.
 
 CLI Usage Examples
 ------------------
@@ -213,9 +263,9 @@ Reduce the memory of the container to 512MB
 Files
 ------
 
-'/etc/pve/lxc/<vmid>.conf'::
+'/etc/pve/lxc/<CTID>.conf'::
 
-Configuration file for the container <vmid>
+Configuration file for the container '<CTID>'.
 
 
 Container Advantages