...
In the following, we'll first create a single container that is fully configured, and then clone the original as many times as needed.
Installing LXC is as simple as running
Code Block | ||
---|---|---|
| ||
sudo apt-get install lxc |
You should run lxc-checkconfig
to determine your system properly supports this technology.
...
Next we'll create a new container with a clean Ubuntu install. This command will download all kinds of dependencies so it might take a while to complete.
Code Block | ||
---|---|---|
| ||
sudo lxc-create -n onos1 -t ubuntu |
You can verify the container is now available on your system. Note the container is currently stopped.
Code Block | ||
---|---|---|
| ||
sudo lxc-ls --fancy |
Go ahead and start the container. The -d flag instructs LXC to daemonize the container, so we'll stay in our shell while the container runs in the background.
Code Block | ||
---|---|---|
| ||
sudo lxc-start -n onos1 -d |
Take a look at the output of lxc-ls
again: note the container is now started and, if all has gone well, has received an IP address.
...