OpenVZ Forum


Home » Mailing lists » Devel » Containers HOWTO? (Where do I start?)
Containers HOWTO? (Where do I start?) [message #41979] Wed, 08 December 2010 08:36 Go to next message
Rob Landley is currently offline  Rob Landley
Messages: 19
Registered: December 2010
Junior Member
I've been poking at the container code and reading the openvz wiki and the pages linked from http://lxc.sourceforge.net/index.php/about/kernel-namespaces / and random other things Google finds like http://www.howtoforge.com/how-to-do-live-migration-of-openvz -containers but I have yet to find a good "start here" document for what I want to do.

I want to build a containers test environment from source. I.E. I want to configure and build a kernel, build and configure my own root filesystem, invoke a chroot-with-benefits binary to set up a new init process in a container, and run test programs in the container.

I've found a lot of articles on how to use a distro to automate away the details, and I've found articles on several of the individual components, but if there's a design overview or a HOWTO on adding container support to a system you built yourself, I haven't found it yet. (A case insensitive search of Documentation didn't find a filename with "contain" or "vz" in it.)

I have no shortage of things to read, but it's all really unfocused. Any hints to help narrow my search?

Thanks,

Rob
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
RE: Containers HOWTO? (Where do I start?) [message #41981 is a reply to message #41979] Wed, 08 December 2010 21:17 Go to previous message
Rob Landley is currently offline  Rob Landley
Messages: 19
Registered: December 2010
Junior Member
> A few places to start since you want to start from the ground up:
>
> 1. man clone

Yup, got that one already.

> 2. man pivot_root

I wrote the busybox switch_root implementation, which meant I had to
really _understand_ the full horror of the pivot_root implementation
and why it _wasn't_ switch_root (examining every process in the system
so you can move their chroot entry for kernel threads and daemons is
really ugly, but you can't unmount a filesystem that has processes
pinning it). Although come to think of it I thought kernel threads were
parked in initramfs these days? (Doesn't initrd overmount initramfs?
Now I have to go look at what the code's doing again...)

But how does pivot_root enter into this when you haven't got an initrd to
free? I thought when you killed a container's init process that killed all
the children and freed the resources, so how does pivot_root enter
into this? (You don't reparent existing processes, you span new ones,
right?)

> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6 .git ;a=tree;f=Documentation/cgroups;h=8c6b3f6c41a929f8db38b51a39 442387ecbd5986;hb=HEAD

Ah, _that_ is what i was looking for. Documentation/cgroups.

I'll look at #3 and #5 after reading that.

Thanks,

Rob
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Previous Topic: RE: trying to build simple checkpoint/restart recipes
Next Topic: Re: [Lxc-users] regular lxc development call?
Goto Forum:
  


Current Time: Fri Aug 01 05:49:14 GMT 2025

Total time taken to generate the page: 0.46791 seconds