Re: [Lxc-users] Horrors using Debian Wheezy

2013-09-17 Thread Rob van der Hoeven
 I'm using your template on an Ubuntu 12.04 stock LXC install.  I've run into 
 a problem trying to use shared memory with Python's multiprocessing library.  
 It relies on /dev/shm using tmpfs.  I tried mounting it with an entry:
 
 lxc.mount.entry = tmpfs /dev/shm tmpfs defaults 0 0
 
 and variations of the above without success.
 
 The included Ubuntu LXC template creates several tmpfs entries and I don't 
 have this problem with it, so I think the issue is with the Debian guest.  Do 
 you have any idea how to fix this?

My best guess is that it has something to do with the cgroup device
restrictions. In the generated LXC configuration file you find several
lxc.cgroup.devices.* entries. Remove these (make them comments) and
restart your container. If this solves the problem you can probably copy
the device entries from the Ubuntu configuration to the Debian
configuration.

Rob.
http://freedomboxblog.nl  



--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151iu=/4140/ostg.clktrk
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Using common rootfs for multiple containers

2013-07-09 Thread Rob van der Hoeven

 I would like it know is it possible to create a single rootfs (might
 be in read-only mode) and share it among multiple containers ?

At Dotcloud.com they use one basic OS rootfs. For each container they
mount this OS rootfs read-only and use a union file-system (AUFS) to add
a writable layer. Here are some pointers:

PAAS Under the Hood, Episode 3: AUFS
http://blog.dotcloud.com/kernel-secrets-from-the-paas-garage-part-34-a

Lightweight Virtualization with namespaces, cgroups, and unioning
filesystems:
http://blog.dotcloud.com/scale11 (excellent slides!)

Rob.
http://freedomboxblog.nl




--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Difficulties setting up lxc on Debian 7

2013-05-24 Thread Rob van der Hoeven
On Fri, 2013-05-24 at 11:26 +0100, Rory Campbell-Lange wrote:
 I'd be grateful for assistance trying to get a minimal Debian 7 lxc system
 running on a Debian 7 host.
 

The debian template that comes with Wheezy is broken. Solution: use
another template. See: 

http://sourceforge.net/mailarchive/message.php?msg_id=30820418

Rob.
http://freedomboxblog.nl




--
Try New Relic Now  We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app,  servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Horrors using Debian Wheezy

2013-05-11 Thread Rob van der Hoeven
 I'm trying to get LXC to work for me on Debian Wheezy/amd64 and I'm having a
 Hellish time. I'm following the advice on wiki.debian.org and other places,
 and I believe I'm creating my containers correctly, but when I launch a
 container, I get a bunch of messages about needing root to set a hostname,
 needing root to mount things, needing root to do various other things, and I
 see sshd fail to create keys, and at the very end I get nothing. No console.
 I can't use the console command to connect - I get nothing. The status tool
 says things are running.
 
 lxc-checkconfig says everything is hunky-dory and I'm not deviating from the
 instructions.
 
 Can someone suggest what might be going wrong here?

Hi,

The template to create Debian containers that ships with Wheezy is
broken. I tried to get this fixed before the Wheezy release but failed.
Here is my solution from the bug report at:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680469

snip

First let me explain the problem. LXC uses shell scripts (they call them
templates) to create the rootfs of a container, this is where things go
wrong. The current Wheezy templates for creating a Debian rootfs use
live-debconfig and this package will not be included in Wheezy. Although
the scripts run, the generated rootfs is not configured correctly.
Fortunately there is nothing wrong with LXC. Simply replacing the shell
script with a version that does not depend on packages that are not in
Wheezy will solve the problem.

On my own computers i use a slightly modified version of the Debian
template that came with Squeeze. My modifications are:
 
1) Installing a Squeeze rootfs instead of a Lenny rootfs
2) Replacing the deprecated DHCP package
3) Adding some mknod commands to create tty's in the generated rootfs
4) Support for the armel architecture.
5) For the network configuration the template expects that the host has
a bridged network with the name br0 and a DHCP server running. 

I have updated this template to install a Wheezy rootfs and tested the
result. It seems to work perfectly. So my solution is: remove the
non-functioning Debian templates from the LXC package and replace them
with my working template. 

You can download my Debian Wheezy template at:

http://freedomboxblog.nl/wp-content/uploads/lxc-debian-wheezy.gz

If you want to test the template:

Extract the file to /usr/share/lxc/templates , change owner and group to
root and make it executable.

Create a container with:

lxc-create -n wheezy01 -t debian-wheezy

Start it:

lxc-start -n wheezy01

The generated rootfs reports the container name to the DHCP server. If
you happen to to run a combined DHCP/DNS server like dnsmasq this can be
used to automatically create a domain-name for the container. (My own
setup would create the DNS name wheezy01.freedom.box for the container.
Handy for ssh connections...)

Rob.
http://freedomboxblog.nl

/snip



--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Seeking advice on appropriate network layout for my LXC setup

2013-01-07 Thread Rob van der Hoeven

 My intention is to have a container running nginx as a reverse proxy
 and containers running the various combinations of Apache, PHP, RoR,
 MySQL, etc software for the web apps I want. After experimenting
 (mixed success) with combinations of the Ubuntu default lxcbr0 (nginx
 container attached) and macvlan (the other containers + additional
 interface in the nginx container) I've come back around to looking at
 simply attaching all containers to lxcbr0. I don't think anything I
 want to run would have an issue with NAT. I would then port forward
 connections to the public IP for web onto the nginx container and so
 on for other services. The nginx container would proxy to the various
 apache container instances - as they're all connected to lxcbr0 i'm
 assuming from what I've read that's as straightforward as a regular
 LAN.

Hi James,

Looks like you want the *exact* configuration that i currently use for
my FreedomBox. I have put nginx inside a bastion host container where
it acts like a reverse proxy for containers running wordpress blogs and
for example owncloud. I also have shorewall (a firewall) running which
can do NAT. Here are some links if you want my configuration:

First, my lxc and network setup
http://freedomboxblog.nl/installing-lxc-dhcp-and-dns-on-my-freedombox/

Then, creation of my nginx bastion host container
http://freedomboxblog.nl/my-freedombox-internet-module-part-1/

Creation of a wordpress container, connect it to nginx
http://freedomboxblog.nl/a-wordpress-module-for-my-freedombox/

Limit what containers can do on the network
http://freedomboxblog.nl/adding-a-firewall-and-nat-to-my-freedombox/

Safe ssh access from the internet to any container
http://freedomboxblog.nl/ssh-access-from-the-internet-to-my-freedombox/

My setup is running on Debian, so it probably is easy to adapt for
Ubuntu.

Cheers,
Rob.
http://freedomboxblog.nl



--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Networking between host and container

2012-12-28 Thread Rob van der Hoeven

 What is the best way to broadcast container's hostname to host? 
 I want to be able to ssh from host into the container using its 
 hostname as handle, instead of an IP address.
 
 I'm using the default template in Ubuntu 12.04. 
 I have made a container template that I want to reuse.

My setup uses the container name as its handle.
If I create a container like this: 

cd /var/lib/lxc
mkdir test
/usr/lib/lxc/templates/lxc-debian-box -n test -p /var/lib/lxc/test

I can access it with:

ssh r...@test.freedom.box

Maybe this is what you want?
My setup uses dnsmasq to do some DHCP/DNS magic. 
Wrote an article about my setup:

http://freedomboxblog.nl/installing-lxc-dhcp-and-dns-on-my-freedombox/

Rob.
http://freedomboxblog.nl



--
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users