[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
howtos:misc:lxc [2018/09/15 20:49 (UTC)] – [Setting up a Network Bridge] Clarifications on configuring lxc-net montagdudehowtos:misc:lxc [2018/09/15 20:56 (UTC)] – [Sharing Directories with the Host] Slight wording change montagdude
Line 76: Line 76:
 </code> </code>
  
-When lxc-create is executed, the container will be created at lxcpath/container_name, and slackpkg will download and install the packages needed for a minimal install. The mirror will also be appended to /etc/slackpkg/mirrors.+When lxc-create is executed, the container will be created at $lxcpath/container_name, and slackpkg will download and install the packages needed for a minimal install. The mirror will also be appended to /etc/slackpkg/mirrors.
  
 ===== Container Configuration ===== ===== Container Configuration =====
Line 111: Line 111:
  
 <note tip> <note tip>
-The minimal Slackware installation set up by lxc-create does not have a lot of choice in editors, but //vi// (symlink to //elvis//) is available. If that's not your cup of tea, you can always edit the container's config files from the host using whichever editor you prefer. The container's entire filesystem is at lxcpath/container_name/rootfs.+The minimal Slackware installation set up by lxc-create does not have a lot of choice in editors, but //vi// (symlink to //elvis//) is available. If that's not your cup of tea, you can always edit the container's config files from the host using whichever editor you prefer. The container's entire filesystem is at $lxcpath/container_name/rootfs.
 </note> </note>
  
Line 145: Line 145:
 ==== Sharing Directories with the Host ==== ==== Sharing Directories with the Host ====
  
-Because an LXC container's filesystem is just a directory on the host, if you only need to transfer files from the host to the container, you can simply copy them over. However, often you will want to share the files both ways, or rather, be able to access //the same files// within the container without having to actually transfer anything, and this is a little more difficult because the container is isolated. LXC provides utilities to mount host directories on containers for this purpose. We will assume that the directory to be shared is at /home/username/foo on the host. To share a user directory with the host, first log into the container and create the top-level of the directory to be shared. Then log out and stop the container. Add the following lines to the container's config file (lxcpath/container_name/config):+Because an LXC container's filesystem is just a directory on the host, if you only need to transfer files from the host to the container, you can simply copy them over. However, often you will want to share the files both ways, or rather, be able to access //the same files// within the container without having to actually transfer anything, and this is a little more difficult due to the isolation of the container. LXC provides utilities to mount host directories on containers for this purpose. We will assume that the directory to be shared is at /home/username/foo on the host. To share a user directory with the host, first log into the container and create the top-level of the directory to be shared. Then log out and stop the container. Add the following lines to the container's config file (lxcpath/container_name/config):
  
 <code> <code>
 howtos:misc:lxc ()