[Lxc-users] Lxc-users Digest, Vol 47, Issue 13

brian mullan bmullan.mail at gmail.com
Fri Nov 15 12:21:35 UTC 2013


John...

Thanks for you note also..  I'd seen a very similar Bash script for Arch
Linux here:

http://pastebin.com/zZEAk3Ny

while researching all of this.

Brian




On Fri, Nov 15, 2013 at 5:14 AM, <lxc-users-request at lists.sourceforge.net>wrote:

> Send Lxc-users mailing list submissions to
>         lxc-users at lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.sourceforge.net/lists/listinfo/lxc-users
> or, via email, send a message with subject or body 'help' to
>         lxc-users-request at lists.sourceforge.net
>
> You can reach the person managing the list at
>         lxc-users-owner at lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Lxc-users digest..."
>
> Today's Topics:
>
>    1. lxc-start setenv & setuid (Vijay Viswanathan)
>    2. Re: Fwd: LXC and sound in container - (St?phane Graber)
>    3. Re: Fwd: LXC and sound in container - (Serge Hallyn)
>    4. Bonding inside LXC container (wang yao)
>    5.  Crosscompile for android (Zhao Hongjiang)
>    6. Recommended kernel/lxc version for Ubuntu 12.04 (Robert Pendell)
>    7. Re: LXC and sound in container - (John)
>    8. Re: LXC and sound in container - (John)
>
>
> ---------- Forwarded message ----------
> From: Vijay Viswanathan <vijay.vishy at gmail.com>
> To:
> Cc: Linux Containers List <lxc-users at lists.sourceforge.net>
> Date: Thu, 14 Nov 2013 10:03:20 -0800
> Subject: [Lxc-users] lxc-start setenv & setuid
> Hi,
> I want to start a program inside a container under a particular uid and
> after setting particular ENV variable, but I dont have the luxury of
> busybox & shell start script and I also dont want to exec that program
> under a C wrapper program. How do I achieve that ?
>
> simply put, without a hack in start.c is there a way to print a different
> uid for 1) and MYENV in 2 ?
>
> 1)
> # ./lxc-start -n r id
> uid=0(root) gid=0(root) groups=0(root)
>
> 2)
> --- with hack in start.c &
> # ./lxc-start -n r env
> container=lxc
> MYENV=TESTVAL
>
>
> Thanks,
> Vijay
>
>
> ---------- Forwarded message ----------
> From: Stéphane Graber <stephane.graber at canonical.com>
> To: Serge Hallyn <serge.hallyn at ubuntu.com>
> Cc: brian mullan <bmullan.mail at gmail.com>, lxc-users at lists.sourceforge.net
> Date: Thu, 14 Nov 2013 14:12:39 -0500
> Subject: Re: [Lxc-users] Fwd: LXC and sound in container -
> On Thu, Nov 14, 2013 at 11:57:04AM -0600, Serge Hallyn wrote:
> > Quoting brian mullan (bmullan.mail at gmail.com):
> > > I'm not sure the lxc-user alias will take an file attachment or not.
> If
> > > not I'll try something else.
> > >
> > > I tried to document everything I did to finally get sound working in
> an LXC
> > > container on my Ubuntu 13.10 system.
> >
> > Thanks Brian.  If you're interested, I would suggest splitting this into
> > two howtos, and posting them in a wiki or at linuxcontainers.org.  One
> > would be on just setting up x.  That actually could be a main page with
> > a list of options, one being the one you documented, another (soon)
> > spice, etc.  The other would be on pulseaudio.
> >
> > Stéphane, could you briefly comment on what arkose did to allow
> > simulatenous host and container pulseaudio access?  Brian mentioned
> > something about glueing in a pulseaudio socket?
>
> arkose basically runs:
> pactl load-module module-native-protocol-unix socket=/some/path
> auth-cookie-enabled=0
>
> The bind-mounts that socket inside the container and exports
> PULSE_SERVER=/some/path in the container's environment.
>
> --
> Stéphane Graber
> Ubuntu developer
> http://www.canonical.com
>
>
> ---------- Forwarded message ----------
> From: Serge Hallyn <serge.hallyn at ubuntu.com>
> To: Stéphane Graber <stephane.graber at canonical.com>
> Cc: brian mullan <bmullan.mail at gmail.com>, lxc-users at lists.sourceforge.net
> Date: Thu, 14 Nov 2013 16:08:43 -0600
> Subject: Re: [Lxc-users] Fwd: LXC and sound in container -
> Quoting Stéphane Graber (stephane.graber at canonical.com):
> > On Thu, Nov 14, 2013 at 11:57:04AM -0600, Serge Hallyn wrote:
> > > Quoting brian mullan (bmullan.mail at gmail.com):
> > > > I'm not sure the lxc-user alias will take an file attachment or not.
>   If
> > > > not I'll try something else.
> > > >
> > > > I tried to document everything I did to finally get sound working in
> an LXC
> > > > container on my Ubuntu 13.10 system.
> > >
> > > Thanks Brian.  If you're interested, I would suggest splitting this
> into
> > > two howtos, and posting them in a wiki or at linuxcontainers.org.  One
> > > would be on just setting up x.  That actually could be a main page with
> > > a list of options, one being the one you documented, another (soon)
> > > spice, etc.  The other would be on pulseaudio.
> > >
> > > Stéphane, could you briefly comment on what arkose did to allow
> > > simulatenous host and container pulseaudio access?  Brian mentioned
> > > something about glueing in a pulseaudio socket?
> >
> > arkose basically runs:
> > pactl load-module module-native-protocol-unix socket=/some/path
> auth-cookie-enabled=0
> >
> > The bind-mounts that socket inside the container and exports
> > PULSE_SERVER=/some/path in the container's environment.
>
> Thanks, Stéphane.  Interesting.
>
> (I need to find time to work on Xspice in a container, but unfortunately
> it was segfaulting for me last week.)
>
>
>
>
> ---------- Forwarded message ----------
> From: wang yao <yaowang2014 at gmail.com>
> To: lxc-users at lists.sourceforge.net
> Cc:
> Date: Fri, 15 Nov 2013 11:33:05 +0800
> Subject: [Lxc-users] Bonding inside LXC container
> Hi all,
> I tried to bond two NICs (eth0 and eth1) in the container, but when I
> finished the bonding configuration (I think my configuraion is correct) and
> started bonding device inside container, this message came out:
> "Bringing up interface bond0:  bonding device bond0 does not seem to be
> present, delaying initialization."
> So I want to know if LXC can't support the way of bonding configuration as
> I did, or I can do something to make this achieved.
> I am glad to talk about "Bonding and LXC" with someone who has interest in
> it.
> Regards,
> Yao
>
>
> ---------- Forwarded message ----------
> From: Zhao Hongjiang <zhaohongjiang at huawei.com>
> To: <lxc-users at lists.sourceforge.net>
> Cc:
> Date: Fri, 15 Nov 2013 11:54:21 +0800
> Subject: [Lxc-users] Crosscompile for android
> Hello,
>
> I'm try to use lxc for android.
>
> I crosscompile the 0.8.0 use
> gcc-linaro-arm-linux-gnueabi-2012.01-20120125_linux
> and it works. But when i update lxc to 0.9.0 and complile in the same way
> and it
> appear "Segmentation fault" or "Illegal instruction" when lxc-start.
>
> I found out this is because lxc is rely on librt.so and libpthread.so, but
> the
> gcc-linaro-arm tool already have them.
>
> I've no idea, if anyone familiar about this, please give some adervice,
> thank you!
>
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Robert Pendell <shinji at elite-systems.org>
> To: lxc-users at lists.sourceforge.net
> Cc:
> Date: Fri, 15 Nov 2013 03:37:43 -0500
> Subject: [Lxc-users] Recommended kernel/lxc version for Ubuntu 12.04
> I apologize for the noobish question here.  What's the recommended LXC
> version and Kernel version combination for Ubuntu 12.04.2?
>
> Robert Pendell
> shinji at elite-systems.org
> A perfect world is one of chaos.
>
>
>
>
> ---------- Forwarded message ----------
> From: John <lxc at jelmail.com>
> To: lxc-users at lists.sourceforge.net
> Cc:
> Date: Fri, 15 Nov 2013 09:50:58 +0000
> Subject: Re: [Lxc-users] LXC and sound in container -
> On 09/11/13 15:12, brian mullan wrote:
>
>> I've searched the web for 2 weeks now and can find no documentation
>> describing steps to configure "sound" in an LXC container.
>>
>>  Here is what I do. It's just ALSA (not Pulseaudio) but I do run a
> desktop in a container and it works for me.
>
> 1. install alsa-lib alsa-utils in the container
> 2. enable autodev in the container's LXC config
>
>     # Use autodev to be compatible with systemd
>     lxc.autodev = 1
>     lxc.hook.autodev = /etc/lxc/myhost/autodev
>
> (set the autodev path to an apprpriate location on your host)
>
> 3. write an autodev script on the host at the path in "lxc.hook.autodev"
> from step 1. Make it executable.
>
> #!/bin/bash
>     # LXC Autodev hook. Created by Amylum
>     cd ${LXC_ROOTFS_MOUNT}
>
>     mkdir ./dev/snd
>     ifs_char=$IFS
>     IFS=$'\n'
>     ifs_line=$IFS
>     for i in $(ls -l /dev/snd | grep '^c' | tr -s ' ' | awk -F "[ ,]"
> {'print "mknod -m 660 ./dev/snd/"$11" c "$5" "$7" && chown root:audio
> ./dev/snd/"$11'})
>     do
>         IFS=$ifs_char
>         eval $i
>         IFS=$ifs_line
>     done
>
> 4. add devices to lxc config file
>
>     # For ALSA Sound
>     lxc.cgroup.devices.allow = c 116:* rwm # dev/snd/
>
> 5. add any users needing to use audio to the "audio" group
>
>     for user in ${audio_users}
>     do
>         usermod -a -G audio $user
>     done
>
> Some explanation:
>
> Container cannot use udev to create device nodes and the way systemd
> initialises the container's /dev prevents you creating them from the host.
> So, you have to use an autodev hook to create the device nodes at start-up
> (steps 2 and 3). You also need allow access to the devices in the
> container's config and that is what step 4 does.
>
> I ought to get PA working but I haven't had the time or the inclination.
>
> I hope this is of some help.
>
> John
>
>
>
>
>
>
> ---------- Forwarded message ----------
> From: John <lxc at jelmail.com>
> To: lxc-users at lists.sourceforge.net
> Cc:
> Date: Fri, 15 Nov 2013 10:13:19 +0000
> Subject: Re: [Lxc-users] LXC and sound in container -
> sorry forgot to add - this is on Arch Linux :)
>
>
>
>
> ------------------------------------------------------------------------------
> DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
> OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
> Free app hosting. Or install the open source package on any LAMP server.
> Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
> http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20131115/0b591d73/attachment.html>


More information about the lxc-users mailing list