[Lxc-users] how to use system container

Brian K. White brian at aljex.com
Tue Feb 21 14:30:55 UTC 2012

On 2/21/2012 8:46 AM, allen wrote:
> 2012/2/20 Serge Hallyn<serge.hallyn at canonical.com>:
>> Quoting allen (allen303allen at gmail.com):
>>> HI ALL:
>>>      My aim is to run a Graphical application in a container, then an
>>> user connect to the container with a GUI interface, so that he can see
>>> and operate the application.
>>>      As I want to separate all resources, I think I'll need a system
>>> container. Now I already use "lxc-create -n maverick-lxc-template -t
>>> maverick -f /tmp/maverick-template-network.conf" to create an Ubuntu
>>> template, start it and use lxc-console to get a console of it.
>>>      Now my question is:
>>>      1. If I want to run an application, do I have to install it in the
>>> system container first?
>> no.
> Then how can I run that application, could you show me some examples?
> I mean, in a system container.
>>>      2. How can I connect to the container with a GUI interface?
>> It depends on how you've set up the container's network and where the
>> guest will connect from.
>> If your container were using a veth connected to libvirt's virbr0, and
>> the application is available on port 9999, then your guest could simply
>> ssh -L 9999:container_ip_addr:9999
>> and then connect to port 9999 on his local host.  For instance, if you
>> were opening up vnc on :1 in the container, the container is
> Dose this mean I have to start vncserver in my system container?
> Then I have some troubles on that, my template is a minimum system,
> the lack of a lot of library files make the job difficult.
> Do I need a more powerful template? How can I get that?
> Thank you.

Well, you are the one who said you wanted to run gui apps.
If you don't want gui apps in the container then don't include them.
If you do, the do include them.

I think you need to first go gather basic info about how X11 apps work.

Then once you understand how X11 works you would see that you could run 
an X server on your pc, and have X clients (x apps) in the container 
that use the network to display on your pc's X server.

And along the way you'll discover this is very difficult to do over the 
internet for several reasons, thus you want to add another layer, a 
local X server in the container that does not draw on a physical video 
card but just serves up a vnc (or freenx or rdp etc) connection.

Then when you understand how all that works you can think about trying 
to make it work in the context of a container. But that stuff is all 
general stuff, not special to LXC. It's not really right to take up 
these people's time with that. Google basics of X11 and vnc. They are 
old topics and so there are countless articles.


>>, and your host is, then he would do
>> ssh -L 5951:
>> and then
>> vncviewer :51
>> You can also put the container straight onto your local network, but
>> the above works with how containers creation is usually shown.
>> -serge
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> 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-d2d
> _______________________________________________
> Lxc-users mailing list
> Lxc-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-users

More information about the lxc-users mailing list