Re: [Lxc-users] File sharing between host and container during startup

2010-06-06 Thread Nirmal Guhan
On Sun, Jun 6, 2010 at 11:16 AM, Daniel Lezcano daniel.lezc...@free.frwrote:

 On 06/04/2010 05:44 PM, Nirmal Guhan wrote:

 Hi,

 I tried to extend the fstab as below:

 /etc/resolv.conf  /lxc/lenny/rootfs.lenny/etc/
 resolv.conf none bind 0 0
 /test  /testdir  none bind 0 0--- I added this line

  From the host :
 # ls /testdir
 a  b  c

  From the container :
 [r...@test-fedora lenny]# chroot rootfs.lenny/
 test-fedora:/# ls /test
 test-fedora:/#

 But when I do lxc-start I get an error as :
 #lxc-start -n lencon
 lxc-start: No such file or directory - failed to mount '/test' on
 '/testdir'

 Basically what am trying to do is to share the host library files (/lib)
 between the containers.

 Any clues on the error above? Please let me know. Also, any better way to
 share the files between host and container will be helpful.



 Hi Nimal,

 I am not sure to understand what you are trying to achieve. You created a
 system container, but you want to launch it as an application container. Can
 you give your use case if possible, so I may be able to give more clues on
 how to set ip up.

 Thanks
  -- Daniel


Hi Daniel,

I want to run my application on fedora as a container and use the libraries
(/lib, /usr/lib) from the host (so my application container size is small).
I did lxc-create but lxc-execute failed (I had sent a mail earlier on this).
Suggestion was to use lxc-start itself and run as system container.

I changed the fstab file and could share the lib directory.

Please let me know if there are better solution for my use case. I would
like to try it too.

Thanks,

-Nirmal
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] File sharing between host and container during startup

2010-06-06 Thread Gordon Henderson
On Sun, 6 Jun 2010, Nirmal Guhan wrote:

 I want to run my application on fedora as a container and use the libraries
 (/lib, /usr/lib) from the host (so my application container size is small).
 I did lxc-create but lxc-execute failed (I had sent a mail earlier on this).
 Suggestion was to use lxc-start itself and run as system container.

 I changed the fstab file and could share the lib directory.

 Please let me know if there are better solution for my use case. I would
 like to try it too.

You can import directories from the host into a contianer using bind 
mounts.

For example, I have this in some of my systems - this is the fstab file 
named in a container config file:

none /vservers/vdsx10/dev/pts devpts defaults 0 0
none /vservers/vdsx10/procproc   defaults 0 0
none /vservers/vdsx10/sys sysfs  defaults 0 0
none /vservers/vdsx10/dev/shm tmpfs  defaults 0 0

#/usr   /vservers/vdsx10/usr/   
nonedefaults,bind,ro 0 0
/usr/lib/asterisk   /vservers/vdsx10/usr/lib/asterisk   
nonedefaults,bind,ro 0 0
/var/lib/asterisk/moh   /vservers/vdsx10/var/lib/asterisk/moh   
nonedefaults,bind,ro 0 0
/var/lib/asterisk/sounds/vservers/vdsx10/var/lib/asterisk/sounds
nonedefaults,bind,ro 0 0

The first 4 lines ought to be faimilar, but the bottom ones are ones I use 
which are common over all containers on that host.

/usr is commented out here - can't remember why - I'd need to go back 
through my notes for this instance, but it's sunday night here

Gordon

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] File sharing between host and container during startup

2010-06-06 Thread Daniel Lezcano
On 06/04/2010 05:44 PM, Nirmal Guhan wrote:
 Hi,

 I tried to extend the fstab as below:

 /etc/resolv.conf  /lxc/lenny/rootfs.lenny/etc/
 resolv.conf none bind 0 0
 /test  /testdir  none bind 0 0--- I added this line

  From the host :
 # ls /testdir
 a  b  c

  From the container :
 [r...@test-fedora lenny]# chroot rootfs.lenny/
 test-fedora:/# ls /test
 test-fedora:/#

 But when I do lxc-start I get an error as :
 #lxc-start -n lencon
 lxc-start: No such file or directory - failed to mount '/test' on '/testdir'

 Basically what am trying to do is to share the host library files (/lib)
 between the containers.

 Any clues on the error above? Please let me know. Also, any better way to
 share the files between host and container will be helpful.


Hi Nimal,

I am not sure to understand what you are trying to achieve. You created 
a system container, but you want to launch it as an application 
container. Can you give your use case if possible, so I may be able to 
give more clues on how to set ip up.

Thanks
   -- Daniel

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users