fstab option
You probably want to use the fstab file:
$ cat /var/lib/lxc/ubuntu-trusty-amd64/fstab
/dev/sdc1 mnt/sdc ext4 noatime 0 0
It's important that the mountpoint (2nd argument) doesn't begin with a slash, otherwise the LXC script tries to mount the filesystem in the host os.
On Ubuntu, the file should aready exist but empty. If not, just create it and make sure you have the following line in your config file:
$ grep fstab /var/lib/lxc/ubuntu-trusty-amd64/config
lxc.mount = /var/lib/lxc/ubuntu-trusty-amd64/fstab
device option
If you really need access to your device, you can make it available in your container:
$ grep devices /var/lib/lxc/ubuntu-trusty-amd64/config
lxc.cgroup.devices.allow = b 8:1 rwm
This will make /dev/sda1 available in your container (8:1 is the block device major:minor).
But this will not be enough. Your container normally doesn't have the permission to mount any file system. You will need to use the following line or a similar trick too:
$ grep profile /var/lib/lxc/ubuntu-trusty-amd64/config
lxc.aa_profile = unconfined
Warning: this allows much more than just mounting
shared directory option
If you want to access your data from multiple containers (and the host os), you may want to use the most common solution: Similar to the first option, use the fstab to bind-mount a aready-mounted directory to your container:
$ cat /var/lib/lxc/ubuntu-trusty-amd64/fstab
/mnt/mydata mnt/mydata none bind 0 0
Again: the first argument is the source, the directory in your host os. The second argument is the directory in your container, relative to its root. Again: DONT PUT A SLASH IN FRONT OF THE SECOND ARGUMENT.
If you don't want to create the directory in your container, you can do this automatically be using the options bind,create=dir
instead of simply bind
Best Answer
_________________________________________________ L X C _________________________________________________________
A container is a way to isolate a group of processes from the others on a running Linux system. By making use of existing functionality like the Linux kernel's new resource management and resource isolation features (Cgroups and name spaces), these processes can have their own private view of the operating system with its own process ID (PID) space, file system structure and network interfaces.
Containers share the same kernel with anything else that is running on it, but can be constrained to only use a defined amount of resources such as CPU, memory or I/O. By combining containers with other features like the Btrfs file system , it will be possible to quickly set up multiple lightweight isolated Linux instances on a single host. Therefore containers are better compared to Solaris zones or BSD jails.
Making LXC easier
One of the main focus for Ubuntu LTS was to make LXC dead easy to use, to achieve this. Creating a basic container and starting it on Ubuntu
Log In
This will default to using the same version and architecture as your machine, additional option are obviously available (–help will list them). Login/Password are ubuntu/ubuntu.
For Detail Host Configuration
Debian
Oracle
sourceforge
LXC Web Panel
Open Web Browser and Connect
Overview
Resource Limitation