Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’ve been using LXC as a lightweight “virtualization” platform for over 5 years now, with great success. It allows me to take existing installations of entire operating systems and put them in containers. Awesome stuff. On my home server, I have a VNC terminal server LXC container that is separate from the host system.

Combined with ipvlan I can flexibly assign my dedicated server’s IP addresses to containers as required (MAC addresses were locked for a long time). Like, the real IP addresses. No 1:1 NAT. Super useful also for deploying Jitsi and the like.

I still use Docker for things that come packaged as Docker images.



> . It allows me to take existing installations of entire operating systems and put them in containers

Friend, do you have documentation for this process? Please share your knowledge. ^_^


Nothing too spectacular, I’m afraid. I had to consolidate some physical machines, all running Gentoo Linux. For each, I simply created a Gentoo LXC container and then replaced the rootfs (in /var/lib/lxc/NAME/rootfs) with the one from the physical server.

The significant changes from the physical systems were:

* rc_provide="net" in rc.conf because base networking is controlled externally

* rc_sys="lxc" may or may not be necessary

* Disable various net setup services

On the host OS (Debian) I have interfaces like this:

    auto ipvl-main
    iface ipvl-main inet manual
       pre-up ip link add link eth0 name ipvl-main type ipvlan mode l2
       post-down ip link delete ipvl-main
In the container config, they are referenced this way:

    lxc.net.2.type = phys
    lxc.net.2.link = ipvl-main
    lxc.net.2.ipv4.address = 1.2.3.4/29
    lxc.net.2.ipv4.gateway = 1.2.3.1
    lxc.net.2.ipv6.address = abcd::2/128
    lxc.net.2.ipv6.gateway = fe80::1
    lxc.net.2.flags = up
Later on, I removed the dedicated IP address and set up a reverse proxy instead.

Oh yeah, all containers are of course privileged containers. With unprivileged containers, various things may not work as expected.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: