CentOS 8.x install lxc

From Notes_Wiki
Revision as of 03:57, 3 August 2020 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb self="Install lxc">CentOS 8.x lxc|lxc<yambe:breadcrumb> =CentOS 8.x install lxc= ==Package installation To install lxc on CentOS 8.x use: # Install required...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb self="Install lxc">CentOS 8.x lxc|lxc<yambe:breadcrumb>

CentOS 8.x install lxc

==Package installation To install lxc on CentOS 8.x use:

  1. Install required packages:
    sudo dnf install lxc lxc-templates lxc-doc libcgroup-pam libcgroup-tools libcgroup
  2. Test by running
    lxc-checkconfig
  3. Then create network bridge if not created already by referring Creating bridge interfaces (br0) for virtual hosts to use shared interface or CentOS 7.x Managing virtual networks using libvirt virsh command
  4. Edit '/etc/lxc/default.conf' and update value of 'lxc.network.link' in this file appropriately.
  5. Store container files in a different partition then / or /var using CentOS 7.x installing lxc#Get_more_space_for_lxc_containers
    lxc-ls --active
    mkdir /mnt/data1/large_files/lxc-files
    mkdir /mnt/data1/large_files/lxc-files/{var_cache_lxc,var_lib_lxc}
    mv /var/cache/lxc/* /mnt/data1/large_files/lxc-files/var_cache_lxc/ #Ignore no-such files error, if printed
    rmdir /var/cache/lxc
    ln -s /mnt/data1/large_files/lxc-files/var_cache_lxc/ /var/cache/lxc
    mv /var/lib/lxc/* /mnt/data1/large_files/lxc-files/var_lib_lxc/ #Ignore no such fies error, if printed
    rmdir /var/lib/lxc
    ln -s /mnt/data1/large_files/lxc-files/var_lib_lxc/ /var/lib/lxc
    lxc-ls
  6. Create a few lxc containers and test


Refer:


<yambe:breadcrumb self="Install lxc">CentOS 8.x lxc|lxc<yambe:breadcrumb>