Re: [Lxc-users] Container start unmounts shared bind mounts

2012-02-13 Thread Serge Hallyn
Quoting Ivan Vilata i Balaguer (i...@selidor.net):
 Serge Hallyn (2012-02-11 00:08:10 +0100) wrote:
 
  Quoting Ivan Vilata i Balaguer (i...@selidor.net):
  Serge Hallyn (2012-02-10 16:05:19 +0100) wrote:
  
   mv /usr/bin/lxc-start /usr/bin/lxc-start.real
  
   cat  /usr/bin/lxc-start.mid  EOF
   mount --make-unbindable /lxc-shared
   mount --make-shared /lxc-shared
 
  Oops, this isn't right.  I think I just meant
 
  cat  /usr/bin/lxc-start.mid  EOF
  mount --make-rslave /lxc-shared
  exec /usr/bin/lxc-start.real $*
  EOF
 
   exec /usr/bin/lxc-start.real $*
   EOF
  
   cat  /usr/bin/lxc-start  EOF
   lxc-unshare -s MOUNT -- /usr/bin/lxc-start.mid $*
   EOF
  
   chmod ugo+x /usr/bin/lxc-start{,.mid}
 
 Yup, the new one did work! :)
 
  Well, I'm actually trying on the host to mount and unmount file systems
  I don't know beforehand *while myvm is running* under subdirectories in
  /lxc-shared,
 
  You've lost me here (I don't understand what you're saying), but
 
 Sorry, tried to stuff too much into too few words. :D
 
 What I want to do is set up a shared directory /lxc-shared in the host,
 which will appear as /shared in myvm.  While myvm is running, I'll be
 binding host directories to /lxc-shared/foo, /lxc-shared/bar and other
 subdirs I don't know beforehand so that they become visible as
 /shared/foo, /shared/bar etc. at myvm.  I don't need other containers to
 access /lxc-shared (and of course I don't want them to accidentaly
 unmount things from it when starting).
 
  but running myvm through the scripts you suggest creates a
  new namespace so that myvm no longer sees mounts done by the host.
 
  Note that you're still supposed to do
 
  mount --bind /lxc-shared /lxc-shared
  mount --make-shared /lxc-shared /lxc-shared
 
  at host boot.  Then creating a new namespace shouldn't stop myvm from
  seeing new mounts done by the host.  The reason I was creating that new
  namespace was so that the mount --make-rslave wouldn't happen in the
  host's namespace.
 
 Yes, I was already doing that before starting myvm.  Indeed, your fix
 above made the sharing work as expected.
 
  But in any case, like I say I think it'd be worth adding explicit
  support through the config file for this.
 
 Running the containers through your scripts do the trick, but having an
 option in myvm's config file to make the host's /lxc-shared directory
 shared only for this container (so that other containers don't need to
 go through lxc-unshare  --make-rslave) would be great.  Does that fit
 the behaviour of the new config entries you suggest?

I think so.  I've put it down on the list of things to consider for
next cycle.

 Anyway, thanks a lot for you help!

My pleasure.  It's a good feature to have.

-serge

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] fedora 16 under lxc

2012-02-13 Thread Ramez Hanna
hei
I have been able to get some form of f16 under lxc running but some quirks
so steps (untill i make a patch or a new script)
use the current lxc-fedora to create a container
chroot into the rootfs
unlink /etc/systemd/system/default.target
ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
touch /etc/fstab

now that should in theory work
my setup is a KVM guest with lxc installed
i'm using VM-manager so i get to see the ttys while i start the
container from ssh
in fedora the tty1 is empty
i make sure i have tty1 visible
start the container from an ssh session using the -d flag
looking at the tty1 of the VM
i can see the console log from the lxc container

so 1st quirk: i only get the container output on tty1 of the host (kvm
guest) and not from the lxc-console
lxc-console is blank
when i installed ssh inside the container i was able to access it and
use it nicely
only had 2 services failing
systemd-kmsg-syslogd.service
plymouth-start.service


any hints on how does lxc-console work to help me figure it out
also agetty on tty* keeps restarting (maybe that's why no lxc-console)

anyoe interested in trying it out?

-- 
BR
RH
http://informatiq.org

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users