User Tools

Site Tools


linux:virtualization:lxc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
linux:virtualization:lxc [2020/11/19 16:57]
tkilla
linux:virtualization:lxc [2022/01/13 23:06]
tkilla [Create new container]
Line 344: Line 344:
 http://wiki.fr33.info/doku.php/linux/virtualization/lxc?&#unprivileged_containers http://wiki.fr33.info/doku.php/linux/virtualization/lxc?&#unprivileged_containers
  
-  lxc-create -n debian8  -B btrfs -t debian -- -r jessie+FIX:  original keyserver is broken! add: --keyserver hkp://keyserver.ubuntu.com 
 + 
 + 
 +  lxc-create -n debian8  -B btrfs -t debian -- -r jessie --keyserver hkp://keyserver.ubuntu.com
  
 or or
  
-  lxc-create -n websrv -t debian-wheezy  -B btrfs+  lxc-create -n websrv -t debian-wheezy  -B btrfs --keyserver hkp://keyserver.ubuntu.com
  
 Start / Stop VS: Start / Stop VS:
Line 360: Line 363:
 In Buster, use the lxc-download script: In Buster, use the lxc-download script:
  
-  /usr/share/lxc/templates/lxc-download --list | grep debian | grep amd64 +  /usr/share/lxc/templates/lxc-download --list --no-validate| grep debian | grep amd64 
-  lxc-create -t /usr/share/lxc/templates/lxc-download -n <NAME> -- -d debian -r buster -a amd64+  lxc-create -t /usr/share/lxc/templates/lxc-download -n <NAME> --  --no-validate -d debian -r buster -a amd64
  
  
Line 372: Line 375:
   lxc-clone --backingstore btrfs --orig vs1 --new vs2 --snapshot   lxc-clone --backingstore btrfs --orig vs1 --new vs2 --snapshot
  
 +\\
 +===== Mount external Dirs in Container =====
 +
 +The recommended way is to add the mountpoint with a relative path in the VS config:
 +
 +  lxc.mount.entry=/home/mountme home none bind,optional,relative,create=dir
 +
 +
 +Under some cicumstances it does not work (in unprivileged containers), but this works:
 +
 +  lxc.mount.entry = /home/test /home/vservers/stretch/rootfs/home/test none bind 0 0
 +
 +Also check Permissions and Ownership. chown to the root ID inside the container.
  
 \\ \\
Line 381: Line 397:
  
   lxc-create -B btrfs -n mycontainer -t ubuntu   lxc-create -B btrfs -n mycontainer -t ubuntu
 +
 +
  
  
linux/virtualization/lxc.txt · Last modified: 2022/01/13 23:08 by tkilla