Creating a basic container and starting it on Ubuntu 12.04 LTS is now down to:
sudo apt-get install lxc
sudo lxc-create -t ubuntu -n my-container
sudo lxc-start -n my-container
I needed this, because the container name was wrong.
sudo cp -rf my-container/ my-cloud-container/
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.
Container shuts down when the running system is shut down with the “halt” command.
Shut down a crashed container with:-
sudo lxc-stop -n my-container-name
It’s now possible to use qemu-user-static with LXC to run containers of non-native architectures, ARM for example:
sudo apt-get install lxc qemu-user-static
sudo lxc-create -t ubuntu -n p3 -- -a armhf
Use the code below to test your ARM gcc compiler.
/* NOP */
asm ("mov r0, r0");
Save the code as test.c, compile with gcc test.c, and run with ./a.out.
It will put hello on the screen.