Re: [Lxc-users] Running XOrg in a container

2010-08-24 Thread listm...@oceanfree.net
Ok, checked that your configuration lines have too many spaces in the 
fields and the kernel does not like this.
I suppose, the kernel should trim the spaces but anyway, that can be 
fixed in userspace ...

If you remove the extra spaces between dev minor:major and rwm that 
should work.

lxc.cgroup.devices.allow = c 1:1 rwm # dev/mem
lxc.cgroup.devices.allow = c 13:63 rwm # dev/input/mice

Good news to report: I have X running natively in a container using a vt on
the host's graphics adapter!!! 

The extra spaces you pointed out was all that was in my way. I wonder if
getting the kernel to trim whitespace is a viable thing for the to-do list?
I am sure it will catch others out sooner or later.

I have a bit more evaluation to do but I plan to write it up on the Arch
Linux Wiki. I will let you know when it's done if you are interested.

Thank you for your help Daniel.

John.





mail2web.com – What can On Demand Business Solutions do for you?
http://link.mail2web.com/Business/SharePoint



--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Running XOrg in a container

2010-08-23 Thread l...@jelmail.com

 With some tweaks that maybe possible, but IMHO it is not adequate.
 Lxc is not like QEMU/KVM or Virtualbox, the hardware is not virtualized, 
 so you may have conflicts with the differents X server because they will 
 share the same hardware (eg. different resolutions in different
containers).

It should be adequate for what I want to do. I can already run multiple X
servers on the host and switch between them (e.g. Alt-F7, Alt-F8). This
works fine with no problems.

I just want to containerise the separate environments with a view towards
keeping the host environment as lean and clean as possible. It will make
for an easier life maintaining the host.

IMHO, using ssh won't work when you need to make use of the 3D graphics
card. I may be wrong here but I believe direct hardware access is the only
way. I've proved to myself it works outside containers - all I now need is
to be able to containerise my configuration.

What's stopping me doing that right now is the inability to configure
access to /dev/mem which I think the container needs.



mail2web.com – Enhanced email for the mobile individual based on Microsoft®
Exchange - http://link.mail2web.com/Personal/EnhancedEmail



--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Running XOrg in a container

2010-08-23 Thread Daniel Lezcano
On 08/23/2010 01:13 PM, l...@jelmail.com wrote:

 With some tweaks that maybe possible, but IMHO it is not adequate.
 Lxc is not like QEMU/KVM or Virtualbox, the hardware is not virtualized,
 so you may have conflicts with the differents X server because they will
 share the same hardware (eg. different resolutions in different
  
 containers).

 It should be adequate for what I want to do. I can already run multiple X
 servers on the host and switch between them (e.g. Alt-F7, Alt-F8). This
 works fine with no problems.

Interesting, do you have any pointer explaining how to setup this ?

 I just want to containerise the separate environments with a view towards
 keeping the host environment as lean and clean as possible. It will make
 for an easier life maintaining the host.

 IMHO, using ssh won't work when you need to make use of the 3D graphics
 card.

Ok.

   I may be wrong here but I believe direct hardware access is the only
 way. I've proved to myself it works outside containers - all I now need is
 to be able to containerise my configuration.


Ok, if running several X server is valid, I think containerize them is 
not a problem.

 What's stopping me doing that right now is the inability to configure
 access to /dev/mem which I think the container needs.


Is it possible to copy the content of the host's /dev directory to the 
container's /dev ?

eg. cp -a /dev /var/lib/lxc/name/rootfs/dev

and then run the container.



Thanks
   -- Daniel

--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Running XOrg in a container

2010-08-23 Thread l...@jelmail.com


 With some tweaks that maybe possible, but IMHO it is not adequate.
 Lxc is not like QEMU/KVM or Virtualbox, the hardware is not virtualized,
 so you may have conflicts with the differents X server because they will
 share the same hardware (eg. different resolutions in different
  
 containers).

 It should be adequate for what I want to do. I can already run multiple X
 servers on the host and switch between them (e.g. Alt-F7, Alt-F8). This
 works fine with no problems.

Interesting, do you have any pointer explaining how to setup this ?

Of the top of my head, the below should work, I’ll double check it tonight
though.
 
Log on to VT1 (Alt-F1)
  $ startx -- vt7 

Log on to VT2 (Alt-F2)
  $ startx -- vt8 

Access first desktop on vt7 (Alt-F7)
Access second desktop on vt8 (Alt-F8)


 What's stopping me doing that right now is the inability to configure
 access to /dev/mem which I think the container needs.


Is it possible to copy the content of the host's /dev directory to the 
container's /dev ?

eg. cp -a /dev /var/lib/lxc/name/rootfs/dev

and then run the container.

I will try that tonight but I think cgroup device allow is needed to make
such device files valid anyway. The problem I have right now is that a
container will not start if either of the following two lines are present
in its configuration file:

lxc.cgroup.devices.allow = c 1:1   rwm  # dev/mem
lxc.cgroup.devices.allow = c 13:63  rwm # dev/input/mice

Is this some restriction imposed by LXC and/or the kernel (i.e. you can’t
have /dev/mem in a cgroup) or is there something else that I am missing ?

It would be good if someone can try adding the above to a working
container’s configuration and confirm whether it stops working. It would be
good to confirm it isn’t due to an error or omission that I have made.

Thanks,
John



myhosting.com - Premium Microsoft® Windows® and Linux web and application
hosting - http://link.myhosting.com/myhosting



--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] Running XOrg in a container

2010-08-23 Thread Daniel Lezcano
On 08/23/2010 03:01 PM, l...@jelmail.com wrote:



 With some tweaks that maybe possible, but IMHO it is not adequate.
 Lxc is not like QEMU/KVM or Virtualbox, the hardware is not virtualized,
 so you may have conflicts with the differents X server because they will
 share the same hardware (eg. different resolutions in different

  
 containers).

 It should be adequate for what I want to do. I can already run multiple X
 servers on the host and switch between them (e.g. Alt-F7, Alt-F8). This
 works fine with no problems.


 Interesting, do you have any pointer explaining how to setup this ?
  
 Of the top of my head, the below should work, I’ll double check it tonight
 though.

 Log on to VT1 (Alt-F1)
$ startx -- vt7

 Log on to VT2 (Alt-F2)
$ startx -- vt8

 Access first desktop on vt7 (Alt-F7)
 Access second desktop on vt8 (Alt-F8)



Thanks for info.

 What's stopping me doing that right now is the inability to configure
 access to /dev/mem which I think the container needs.


 Is it possible to copy the content of the host's /dev directory to the
 container's /dev ?

 eg. cp -a /dev /var/lib/lxc/name/rootfs/dev

 and then run the container.
  
 I will try that tonight but I think cgroup device allow is needed to make
 such device files valid anyway. The problem I have right now is that a
 container will not start if either of the following two lines are present
 in its configuration file:

 lxc.cgroup.devices.allow = c 1:1   rwm  # dev/mem
 lxc.cgroup.devices.allow = c 13:63  rwm # dev/input/mice

 Is this some restriction imposed by LXC and/or the kernel (i.e. you can’t
 have /dev/mem in a cgroup) or is there something else that I am missing ?

 It would be good if someone can try adding the above to a working
 container’s configuration and confirm whether it stops working. It would be
 good to confirm it isn’t due to an error or omission that I have made.

Ok, checked that your configuration lines have too many spaces in the 
fields and the kernel does not like this.
I suppose, the kernel should trim the spaces but anyway, that can be 
fixed in userspace ...

If you remove the extra spaces between dev minor:major and rwm that 
should work.

lxc.cgroup.devices.allow = c 1:1 rwm # dev/mem
lxc.cgroup.devices.allow = c 13:63 rwm # dev/input/mice

Thanks
-- Daniel




--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


[Lxc-users] Running XOrg in a container

2010-08-22 Thread l...@jelmail.com
Hello, this is my first post here so please bear with me. I have been
evaluating LXC over the past week and I am trying to set up a desktop
environment inside a container that uses the host's hardware devices. 

Is what I am trying to do possible?

I have read various things via google on the subject and believe that the
container needs access to the graphics hardware device (in my case,
/dev/nvidia0), /dev/input/mice and /dev/mem.

I have been unable to set up access to the latter two via cgroups in the
container configuration file and I have been unable to create device files
in the container for them.

lxc.cgroup.devices.allow = c 195:* rwm # dev/nvidia*
lxc.cgroup.devices.allow = c 1:1   rwm # dev/mem
lxc.cgroup.devices.allow = c 13:63  rwm # dev/input/mice

If the last two are present, the container will not start. If I remove them
then the container starts but I can't create the device files.

$mknod /dev/mem c 1 1
mknod: `/dev/mem': Operation not permitted

Any advice of how to get X up and running from inside a container would be
most welcome.




mail2web.com – Enhanced email for the mobile individual based on Microsoft®
Exchange - http://link.mail2web.com/Personal/EnhancedEmail



--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users