Discussion:
[lxc-users] Desktop Environment in LXD
Rahul Rawail
2016-06-17 10:02:47 UTC
Permalink
Hi,

We have read some posts in LXC-Users group, honestly we are not very
proficient with ubuntu or linux itself but we know a bit.

We have been able to start the LXD container but we have a simple
requirement, if we can run complete linux in an LXD container then why
can't we bring a GUI desktop for each container if we install desktop
environment for it, is there a way we can do it for each container.

Our idea is to use LXD container as a VM hence the next logical step with
which we need your help would be to take each container's desktop to
multiple clients.

LXD is the choice because its lightest, fastest and secure but going over
internet through tons of information has seriously messed up everything. We
hope that by starting a desktop and using it as VM we will not defeat the
purpose of having a bare metal performance.

If you think there is any other approach to achieve this easily and still
have bare metal performance the please suggest that as well.

Thanks in advance.
Simos Xenitellis
2016-06-17 12:07:34 UTC
Permalink
Post by Rahul Rawail
Hi,
We have read some posts in LXC-Users group, honestly we are not very
proficient with ubuntu or linux itself but we know a bit.
We have been able to start the LXD container but we have a simple
requirement, if we can run complete linux in an LXD container then why can't
we bring a GUI desktop for each container if we install desktop environment
for it, is there a way we can do it for each container.
Our idea is to use LXD container as a VM hence the next logical step with
which we need your help would be to take each container's desktop to
multiple clients.
LXD is the choice because its lightest, fastest and secure but going over
internet through tons of information has seriously messed up everything. We
hope that by starting a desktop and using it as VM we will not defeat the
purpose of having a bare metal performance.
If you think there is any other approach to achieve this easily and still
have bare metal performance the please suggest that as well.
Most modern desktops require hardware acceleration for the driver of
the graphics
card, therefore if you had to use an accelerated desktop, you would need
a graphics card per desktop. It is possible to do this, though it is
not available out of the box.
See, for example,
https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/ and
https://www.flockport.com/apps/lxc-gui/

Alternatively, if there is no requirement for a dedicated graphics
card (i.e. no hardware accelerated desktop),
it could be possible to run X servers (like "Xnest")
and configure the containers to display the desktop on those
additional displays.
They appear as separate windows on your Ubuntu desktop.
Such a thing should be feasible with distributions like Lubuntu and Xubuntu.
I just tried with Lubuntu and here is a screenshot,
Loading Image...

Simos
Rahul Rawail
2016-06-17 14:44:59 UTC
Permalink
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence if I
will create 100 containers then all of them will have access to all the
host hardware including video and audio.

I have tried https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/
and http://ghanima.net/doku.php?id=wiki:lxc:deinlxc

I am stuck at xf86OpenConsole: Cannot open /dev/tty0 (no such file
found) when trying to start dektop environment in both lxc and lxd
container or startx.

After creation of unprivileged containers I got stuck with
lxc_container: The container failed to start. failed to spawn
<container name>.


I do not want to use TTY switching solution as that limits use to 7
virtual terminals.


Also, I thought that container should be able to use host os X server
and there should not be any need of another X server.


Can the container desktop environment be called from another remote
machine for remote access.


Thanks




On Fri, Jun 17, 2016 at 10:07 PM, Simos Xenitellis <
Post by Rahul Rawail
Post by Rahul Rawail
Hi,
We have read some posts in LXC-Users group, honestly we are not very
proficient with ubuntu or linux itself but we know a bit.
We have been able to start the LXD container but we have a simple
requirement, if we can run complete linux in an LXD container then why
can't
Post by Rahul Rawail
we bring a GUI desktop for each container if we install desktop
environment
Post by Rahul Rawail
for it, is there a way we can do it for each container.
Our idea is to use LXD container as a VM hence the next logical step with
which we need your help would be to take each container's desktop to
multiple clients.
LXD is the choice because its lightest, fastest and secure but going over
internet through tons of information has seriously messed up everything.
We
Post by Rahul Rawail
hope that by starting a desktop and using it as VM we will not defeat the
purpose of having a bare metal performance.
If you think there is any other approach to achieve this easily and still
have bare metal performance the please suggest that as well.
Most modern desktops require hardware acceleration for the driver of
the graphics
card, therefore if you had to use an accelerated desktop, you would need
a graphics card per desktop. It is possible to do this, though it is
not available out of the box.
See, for example,
https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/ and
https://www.flockport.com/apps/lxc-gui/
Alternatively, if there is no requirement for a dedicated graphics
card (i.e. no hardware accelerated desktop),
it could be possible to run X servers (like "Xnest")
and configure the containers to display the desktop on those
additional displays.
They appear as separate windows on your Ubuntu desktop.
Such a thing should be feasible with distributions like Lubuntu and Xubuntu.
I just tried with Lubuntu and here is a screenshot,
http://i.imgur.com/HqOnwDc.png
Simos
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
Fajar A. Nugraha
2016-06-17 20:48:54 UTC
Permalink
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence if I
will create 100 containers then all of them will have access to all the host
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.

One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.
Post by Rahul Rawail
I have tried https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/
That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server and
there should not be any need of another X server.
correct for the second way.
Post by Rahul Rawail
Can the container desktop environment be called from another remote machine
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)

Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.
--
Fajar
Rahul Rawail
2016-06-18 01:32:41 UTC
Permalink
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence if I
will create 100 containers then all of them will have access to all the host
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.

One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.


----> The reason I asked this question was to understand that in LXD
presentation they said that LXD has the capability to replace all existing
VM's as they run complete OS but if you can't put a DE on it then its not
of much use.
Sorry for this but when you said Yes and No what do you mean, I guess Yes
means as you explained "to give containers access to the hardware directly,
often meaning that only one of them can use the hardware at the same time."
I understand that but like VM do we have the capability to put the drivers
again in container or have virtual drivers so that all containers can use
hardware in parallel rather than only one using it at any one point of
time.If they are replacement for VM then they should work like VM, am i
wrong with my expectation?
Post by Rahul Rawail
I have tried
https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/


That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually

---------> what will happen in this case, will they all work in parallel
and have access to all the hardware of host machine at the same time???
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server and
there should not be any need of another X server.
correct for the second way.

-------> I am assuming all containers have access to same X server in
parallel and the hardware in parallel.
Post by Rahul Rawail
Can the container desktop environment be called from another remote machine
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)

Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.

-------------> I have not tried this but I am assuming if I am not able to
get the DE up in container due to "xf86OpenConsole: Cannot open /dev/tty0
(no such file found) " error then xrdp or x2go are just going to show me
the terminal on the client side and not desktops, am I right with my
assumption?

All I want to do in the first stage is bring up an LXD container and then
bring up a new window on the current desktop like any other VM and have
another desktop environment in it for container and I should be able to do
this for every container and hence have multiple desktops on my current
desktop with all having access to host hardware in parallel, at the same
time maintaining the same bare metal performance without adding any
performance overhead. Will xrdp or x2go still reap the same benefit as LXD
or add performance overhead. Next stage is then I want to take it to remote
client which you already explained before, is there any other option, why I
am asking this because I read somewhere that LXD by default have the
ability to connect to another LXD or LXD server.

One last request to you or to anyone, if possible can someone please give
their half an hour to one hour over the phone (we will call) just to help
us out please, we have been struggling for weeks and asking for help
everywhere and the most help has come out of this forum, your expertise in
this area and one hour of time can save our weeks effort in future and help
us make decision that if this is the right way to go for us. We will be
highly indebted. Please share your number, you can send direct emails with
number.
Post by Rahul Rawail
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence if I
will create 100 containers then all of them will have access to all the
host
Post by Rahul Rawail
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.
One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.
Post by Rahul Rawail
I have tried
https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/
That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server and
there should not be any need of another X server.
correct for the second way.
Post by Rahul Rawail
Can the container desktop environment be called from another remote
machine
Post by Rahul Rawail
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)
Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.
--
Fajar
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
Saint Michael
2016-06-18 03:04:01 UTC
Permalink
I did this long ago but only using XVNC on the containers. It works, but
performance is bad, since you have many Xservers and many Xvnc servers.
I don't think you can share the same graphics hardware from multiple
containers. That would be possible only a very powerful card made by
Nvidia, designed specifically to have 3D computing on virtual machines.
Post by Fajar A. Nugraha
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence if I
will create 100 containers then all of them will have access to all the
host
Post by Rahul Rawail
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.
One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.
----> The reason I asked this question was to understand that in LXD
presentation they said that LXD has the capability to replace all existing
VM's as they run complete OS but if you can't put a DE on it then its not
of much use.
Sorry for this but when you said Yes and No what do you mean, I guess Yes
means as you explained "to give containers access to the hardware directly,
often meaning that only one of them can use the hardware at the same time."
I understand that but like VM do we have the capability to put the drivers
again in container or have virtual drivers so that all containers can use
hardware in parallel rather than only one using it at any one point of
time.If they are replacement for VM then they should work like VM, am i
wrong with my expectation?
Post by Rahul Rawail
I have tried
https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/
That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually
---------> what will happen in this case, will they all work in parallel
and have access to all the hardware of host machine at the same time???
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server and
there should not be any need of another X server.
correct for the second way.
-------> I am assuming all containers have access to same X server in
parallel and the hardware in parallel.
Post by Rahul Rawail
Can the container desktop environment be called from another remote
machine
Post by Rahul Rawail
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)
Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.
-------------> I have not tried this but I am assuming if I am not able to
get the DE up in container due to "xf86OpenConsole: Cannot open /dev/tty0
(no such file found) " error then xrdp or x2go are just going to show me
the terminal on the client side and not desktops, am I right with my
assumption?
All I want to do in the first stage is bring up an LXD container and then
bring up a new window on the current desktop like any other VM and have
another desktop environment in it for container and I should be able to do
this for every container and hence have multiple desktops on my current
desktop with all having access to host hardware in parallel, at the same
time maintaining the same bare metal performance without adding any
performance overhead. Will xrdp or x2go still reap the same benefit as
LXD or add performance overhead. Next stage is then I want to take it to
remote client which you already explained before, is there any other
option, why I am asking this because I read somewhere that LXD by default
have the ability to connect to another LXD or LXD server.
One last request to you or to anyone, if possible can someone please give
their half an hour to one hour over the phone (we will call) just to help
us out please, we have been struggling for weeks and asking for help
everywhere and the most help has come out of this forum, your expertise in
this area and one hour of time can save our weeks effort in future and help
us make decision that if this is the right way to go for us. We will be
highly indebted. Please share your number, you can send direct emails with
number.
Post by Rahul Rawail
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence if
I
Post by Rahul Rawail
will create 100 containers then all of them will have access to all the
host
Post by Rahul Rawail
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.
One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.
Post by Rahul Rawail
I have tried
https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/
That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server
and
Post by Rahul Rawail
there should not be any need of another X server.
correct for the second way.
Post by Rahul Rawail
Can the container desktop environment be called from another remote
machine
Post by Rahul Rawail
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)
Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.
--
Fajar
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
Rahul Rawail
2016-06-18 04:05:15 UTC
Permalink
Thanks for your answer, but again can someone who knows inside out of this,
help us understand the options and concept over the phone please.
Post by Saint Michael
I did this long ago but only using XVNC on the containers. It works, but
performance is bad, since you have many Xservers and many Xvnc servers.
I don't think you can share the same graphics hardware from multiple
containers. That would be possible only a very powerful card made by
Nvidia, designed specifically to have 3D computing on virtual machines.
Post by Fajar A. Nugraha
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence if
I
Post by Rahul Rawail
will create 100 containers then all of them will have access to all the
host
Post by Rahul Rawail
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.
One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.
----> The reason I asked this question was to understand that in LXD
presentation they said that LXD has the capability to replace all existing
VM's as they run complete OS but if you can't put a DE on it then its not
of much use.
Sorry for this but when you said Yes and No what do you mean, I guess Yes
means as you explained "to give containers access to the hardware directly,
often meaning that only one of them can use the hardware at the same time."
I understand that but like VM do we have the capability to put the drivers
again in container or have virtual drivers so that all containers can use
hardware in parallel rather than only one using it at any one point of
time.If they are replacement for VM then they should work like VM, am i
wrong with my expectation?
Post by Rahul Rawail
I have tried
https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/
That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually
---------> what will happen in this case, will they all work in parallel
and have access to all the hardware of host machine at the same time???
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server
and
Post by Rahul Rawail
there should not be any need of another X server.
correct for the second way.
-------> I am assuming all containers have access to same X server in
parallel and the hardware in parallel.
Post by Rahul Rawail
Can the container desktop environment be called from another remote
machine
Post by Rahul Rawail
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)
Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.
-------------> I have not tried this but I am assuming if I am not able
to get the DE up in container due to "xf86OpenConsole: Cannot open
/dev/tty0 (no such file found) " error then xrdp or x2go are just going to
show me the terminal on the client side and not desktops, am I right with
my assumption?
All I want to do in the first stage is bring up an LXD container and then
bring up a new window on the current desktop like any other VM and have
another desktop environment in it for container and I should be able to do
this for every container and hence have multiple desktops on my current
desktop with all having access to host hardware in parallel, at the same
time maintaining the same bare metal performance without adding any
performance overhead. Will xrdp or x2go still reap the same benefit as
LXD or add performance overhead. Next stage is then I want to take it to
remote client which you already explained before, is there any other
option, why I am asking this because I read somewhere that LXD by default
have the ability to connect to another LXD or LXD server.
One last request to you or to anyone, if possible can someone please give
their half an hour to one hour over the phone (we will call) just to help
us out please, we have been struggling for weeks and asking for help
everywhere and the most help has come out of this forum, your expertise in
this area and one hour of time can save our weeks effort in future and help
us make decision that if this is the right way to go for us. We will be
highly indebted. Please share your number, you can send direct emails with
number.
Post by Rahul Rawail
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence
if I
Post by Rahul Rawail
will create 100 containers then all of them will have access to all
the host
Post by Rahul Rawail
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.
One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.
Post by Rahul Rawail
I have tried
https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/
That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server
and
Post by Rahul Rawail
there should not be any need of another X server.
correct for the second way.
Post by Rahul Rawail
Can the container desktop environment be called from another remote
machine
Post by Rahul Rawail
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)
Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.
--
Fajar
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
Ron Kelley
2016-06-18 11:18:57 UTC
Permalink
Perhaps your best option is to open a support ticket with Canonical? I am sure someone (Stephen, etc) would be happy to help you over the phone.



On Jun 18, 2016, at 12:05 AM, Rahul Rawail <***@gmail.com> wrote:

Thanks for your answer, but again can someone who knows inside out of this, help us understand the options and concept over the phone please.

On Sat, Jun 18, 2016 at 1:04 PM, Saint Michael <***@gmail.com <mailto:***@gmail.com>> wrote:
I did this long ago but only using XVNC on the containers. It works, but performance is bad, since you have many Xservers and many Xvnc servers.
I don't think you can share the same graphics hardware from multiple containers. That would be possible only a very powerful card made by Nvidia, designed specifically to have 3D computing on virtual machines.
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence if I
will create 100 containers then all of them will have access to all the host
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.

One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.


----> The reason I asked this question was to understand that in LXD presentation they said that LXD has the capability to replace all existing VM's as they run complete OS but if you can't put a DE on it then its not of much use.
Sorry for this but when you said Yes and No what do you mean, I guess Yes means as you explained "to give containers access to the hardware directly, often meaning that only one of them can use the hardware at the same time." I understand that but like VM do we have the capability to put the drivers again in container or have virtual drivers so that all containers can use hardware in parallel rather than only one using it at any one point of time.If they are replacement for VM then they should work like VM, am i wrong with my expectation?
Post by Rahul Rawail
I have tried https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/ <https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/>
That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually

---------> what will happen in this case, will they all work in parallel and have access to all the hardware of host machine at the same time???
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server and
there should not be any need of another X server.
correct for the second way.

-------> I am assuming all containers have access to same X server in parallel and the hardware in parallel.
Post by Rahul Rawail
Can the container desktop environment be called from another remote machine
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)

Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.

-------------> I have not tried this but I am assuming if I am not able to get the DE up in container due to "xf86OpenConsole: Cannot open /dev/tty0 (no such file found) " error then xrdp or x2go are just going to show me the terminal on the client side and not desktops, am I right with my assumption?

All I want to do in the first stage is bring up an LXD container and then bring up a new window on the current desktop like any other VM and have another desktop environment in it for container and I should be able to do this for every container and hence have multiple desktops on my current desktop with all having access to host hardware in parallel, at the same time maintaining the same bare metal performance without adding any performance overhead. Will xrdp or x2go still reap the same benefit as LXD or add performance overhead. Next stage is then I want to take it to remote client which you already explained before, is there any other option, why I am asking this because I read somewhere that LXD by default have the ability to connect to another LXD or LXD server.

One last request to you or to anyone, if possible can someone please give their half an hour to one hour over the phone (we will call) just to help us out please, we have been struggling for weeks and asking for help everywhere and the most help has come out of this forum, your expertise in this area and one hour of time can save our weeks effort in future and help us make decision that if this is the right way to go for us. We will be highly indebted. Please share your number, you can send direct emails with number.
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence if I
will create 100 containers then all of them will have access to all the host
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.

One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.
Post by Rahul Rawail
I have tried https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/ <https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/>
That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server and
there should not be any need of another X server.
correct for the second way.
Post by Rahul Rawail
Can the container desktop environment be called from another remote machine
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)

Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.

--
Fajar
_______________________________________________
lxc-users mailing list
lxc-***@lists.linuxcontainers.org <mailto:lxc-***@lists.linuxcontainers.org>
http://lists.linuxcontainers.org/listinfo/lxc-users <http://lists.linuxcontainers.org/listinfo/lxc-users>

_______________________________________________
lxc-users mailing list
lxc-***@lists.linuxcontainers.org <mailto:lxc-***@lists.linuxcontainers.org>
http://lists.linuxcontainers.org/listinfo/lxc-users <http://lists.linuxcontainers.org/listinfo/lxc-users>
Rahul Rawail
2016-06-20 14:43:33 UTC
Permalink
Hi All,
I tried using X2go and could get desktop environment working, thanks to
Brian.
I only have one issue now even the full hd video is not smooth, Is there a
way to get vgpu, hardware acceleration or 3d support in LXD containers,
some of my users are going to use autocad.
Also, I don't want to install the separate X server in the container
instead I still want to use the host X server but get the containers
Desktop Environment in a new window like x2go.
Post by Ron Kelley
Perhaps your best option is to open a support ticket with Canonical? I am
sure someone (Stephen, etc) would be happy to help you over the phone.
Thanks for your answer, but again can someone who knows inside out of
this, help us understand the options and concept over the phone please.
Post by Saint Michael
I did this long ago but only using XVNC on the containers. It works, but
performance is bad, since you have many Xservers and many Xvnc servers.
I don't think you can share the same graphics hardware from multiple
containers. That would be possible only a very powerful card made by
Nvidia, designed specifically to have 3D computing on virtual machines.
Post by Rahul Rawail
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence
if I
Post by Rahul Rawail
will create 100 containers then all of them will have access to all
the host
Post by Rahul Rawail
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.
One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.
----> The reason I asked this question was to understand that in LXD
presentation they said that LXD has the capability to replace all existing
VM's as they run complete OS but if you can't put a DE on it then its not
of much use.
Sorry for this but when you said Yes and No what do you mean, I guess
Yes means as you explained "to give containers access to the hardware directly,
often meaning that only one of them can use the hardware at the same time."
I understand that but like VM do we have the capability to put the drivers
again in container or have virtual drivers so that all containers can use
hardware in parallel rather than only one using it at any one point of
time.If they are replacement for VM then they should work like VM, am i
wrong with my expectation?
Post by Rahul Rawail
I have tried
https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/
That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually
---------> what will happen in this case, will they all work in parallel
and have access to all the hardware of host machine at the same time???
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server
and
Post by Rahul Rawail
there should not be any need of another X server.
correct for the second way.
-------> I am assuming all containers have access to same X server in
parallel and the hardware in parallel.
Post by Rahul Rawail
Can the container desktop environment be called from another remote
machine
Post by Rahul Rawail
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)
Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.
-------------> I have not tried this but I am assuming if I am not able
to get the DE up in container due to "xf86OpenConsole: Cannot open
/dev/tty0 (no such file found) " error then xrdp or x2go are just going to
show me the terminal on the client side and not desktops, am I right with
my assumption?
All I want to do in the first stage is bring up an LXD container and
then bring up a new window on the current desktop like any other VM and
have another desktop environment in it for container and I should be able
to do this for every container and hence have multiple desktops on my
current desktop with all having access to host hardware in parallel, at the
same time maintaining the same bare metal performance without adding any
performance overhead. Will xrdp or x2go still reap the same benefit as
LXD or add performance overhead. Next stage is then I want to take it to
remote client which you already explained before, is there any other
option, why I am asking this because I read somewhere that LXD by default
have the ability to connect to another LXD or LXD server.
One last request to you or to anyone, if possible can someone please
give their half an hour to one hour over the phone (we will call) just to
help us out please, we have been struggling for weeks and asking for help
everywhere and the most help has come out of this forum, your expertise in
this area and one hour of time can save our weeks effort in future and help
us make decision that if this is the right way to go for us. We will be
highly indebted. Please share your number, you can send direct emails with
number.
Post by Rahul Rawail
Post by Rahul Rawail
Thanks Simos for your answer, Just few questions and they may be dumb
questions, if LXD is running on top of a host OS and host machine has
graphic card I thought that it will be able to give it a call and I
understand that since LXD still uses core functions of host OS hence
if I
Post by Rahul Rawail
will create 100 containers then all of them will have access to all
the host
Post by Rahul Rawail
hardware including video and audio.
Yes, and no. Depending on what you want, and how you setup the containers.
One way to do it is to give containers access to the hardware
directly, often meaning that only one of them can use the hardware at
the same time.
Post by Rahul Rawail
I have tried
https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/
That's another way to do it: give containers access to host resources
(e.g. X, audio) via unix sockets by setting bind mounts manually
Post by Rahul Rawail
Also, I thought that container should be able to use host os X server
and
Post by Rahul Rawail
there should not be any need of another X server.
correct for the second way.
Post by Rahul Rawail
Can the container desktop environment be called from another remote
machine
Post by Rahul Rawail
for remote access.
... and that's the third way. Treat containers like another headless
server, and setup remote GUI access to it appropriately. My favorite
is xrdp, but vnc or x2go should work as well (I haven't tested sound
though, didn't need it)
Note that if you need copy/paste and file transfer support in xrdp,
your containers need to be privileged with access to /dev/fuse
enabled. If you don't need that feature, the default unpriv container
is fine.
--
Fajar
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
_______________________________________________
lxc-users mailing list
http://lists.linuxcontainers.org/listinfo/lxc-users
brian mullan
2016-06-18 14:34:12 UTC
Permalink
I do this using 3 different methods.
using xnest
using xRDP & Guacamole
and using x2go.

For me the most easiest & most full featured approach is x2go.

Guacamole & xRDP works great & only requires an HTML5 bBrowser but there is
alot to the setup and some capabilities of Guacamole (cut & paste,
printing) are still a bit cumbersome to accomplish.

The following is going to assume Ubuntu 16.04 and x2go...

## Create an LXD container using say Ubuntu 16.04

## enter the container:

lxc exec container_name bash

## add some repositories for xenial (re 16.04)

echo "deb http://archive.canonical.com/ubuntu xenial partner" | sudo tee -a
/etc/apt/sources.list
echo "deb-src http://archive.canonical.com/ubuntu xenial partner" | sudo
tee -a /etc/apt/sources.list
echo "deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main
restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main
restricted universe multiverse" | sudo tee -a /etc/apt/sources.list

apt install software-properties-common -y

## add the ubuntu-mate repository

sudo add-apt-repository ppa:ubuntu-mate-dev/xenial-mate -y

## add the x2go repository

add-apt-repository ppa:x2go/stable

## update & upgrade the container

apt update && apt upgrade -y

## install ubuntu-mate dekstop or xubuntu-desktop or lubuntu-desktop (this
will take upto 30 min or more depending on PC/HD etc)

sudo apt install lightdm ubuntu-mate-core ubuntu-mate-desktop -y

## set things up so all future user accounts you create in this container
default to the Ubuntu-Mate desktop

sudo update-alternatives --set x-session-manager /usr/bin/mate-session

## install the x2go server side software

apt install x2goserver x2goserver-xsession

## create user accounts for your "users" as you normally would

## then depending on whether you want to use login/password or a key based
login edit the /etc/ssh/sshd_config and set it up appropriately
## adn when done configuring the container... reboot the container
sudo apt install software-properties-common -y

## add the x2go repository

sudo add-apt-repository ppa:x2go/stable

sudo apt install x2goclient

= = = = = = =

Finally make sure you container is started & get its IP address

Start the x2go client (Click the DASH icon and type "x2go") then click on
the x2go icon that comes up

In the x2go client gui create a Profile (upper left corner icon of the x2go
gui) for the container

1. enter some Profile "name" at the top to ID what that profile is for
say "My Ubuntu-Mate Desktop)
2. input the container's HOST IP,
3. click the drop down menu and select which Desktop Environment (re
Session Type) you installed (Mate in the case)
4. Save that profile.

You will see that there will appear a new square icon on the right side of
the x2go GUI.

Then execute that Profile by clicking on it & login using one of the login
ID's you created in the container.

Audio/Printing etc should also all just work.

If you can't login the usual problem are authentication is not setup right
(login ID + password vs key based) remember to do that in container.

Note:
Once you've created the 1st container like this you can just clone/copy it
to create more.
On the Host just create a different x2go Login Profile for each
container/IP & give each Profile a different TItle. You can also have diff
containers with different desktops (xubuntu, lubuntu, ubuntu-mate etc)

If you leave the x2go Profile LOGIN field empty any valid user can click on
the Profile Icon and just fill in their ID and Password in order to log
into the container.

Brian
Rahul Rawail
2016-06-22 09:14:35 UTC
Permalink
Thanks Brian it worked better, now I am trying to do a passthrough of LXD
container but there is no .conf file in LXD, where do I add mount entries?
Rahul
If you are talking x2go.. there currently is no way to do 3D or hw
acceleration, as I said previously I don't know of ANY remote desktop
solution outside of commercial ones line PCoIP from Teradici that do that
or perhaps "maybe" NoMachine's commercial version of NX.
Now I do know that the x2go team has been working for quite some time on a
much more advanced x2go that "perhaps" would let you do that but they have
not said anything yet about when that might be finished.
also..
In x2go ... edit your PROFILE again.
Click on the CONNECTION tab and notice that SLIDER.
Its not intuitive BUT the farther you slide it to the RIGHT the LESS
compression is done.
The farther you slide it to the LEFT the MORE compression is done.
If you have a fast Internet connection ... try sliding it all the way to
the right to LAN (re no compression) and try that.
Also, on your Client and on the x2go server... check to see if
libjpeg-turbo8 is installed. libjpeg-turbo replaces the original libjpeg
library and the "turbo" version is about 250% faster.
Brian
Hi Brian,
Thanks a ton, that worked flawlessly.
I only have one issue now even the full hd video is not smooth, Is there
a way to get vgpu, hardware acceleration or 3d support in LXD, some of my
users are going to use autocad.
no... neither x2go nor guacamole will do 3d or hw rendering.
I'm not aware of ANY remote desktop solution that does that other unless
you go with PCoIP which requires a HW card purchase for the server & each
client & is pretty pricey.
PCoIP is not open source its a proprietary software/hardware solution
from Teradici...
http://www.teradici.com/pcoip-technology
Brian, just another quick one, does this approach allows hardware
acceleration and can all containers work on graphic intensive application
like 3d rendering at the same time using host's single GPU.
Thanks
Thanks a lot Brian, I will give it a shot tomorrow, the reason asked
you this was because I have to implement it for over 100 people and then
connect each of them remotely to their container.
Rahul
Whether you use KVM or LXD you still need to install an OS & a
Desktop Environment.
The LXD approach will give you alot of scalability over KVM because
there is no HW virtualization required ... and ... every container is
sharing the Host's Kernel.
So there is much less overhead with LXD than with KVM and much less
memory utilization.
x2go will be using the xserver in the container provided by the
ubuntu-desktop (xubuntu-desktop, lubuntu-desktop, ubuntu-mate etc) desktop
environment you install in the container.
Try it and see if it suits your needs. Its really simple to install
if you follow the steps I gave you.
Brian
Thanks Ron and Brian.
Brian,
I have a question, I am happy to follow the x2go approach but does
it add to performance overhead for the container or the container performs
as it should be, because the main reason to go to LXD over KVM is to get
high density, faster performance and less resource intensive.
Other question is does this approach use host x server and all the
host drivers, in case I have graphic card so will all the containers have
access to GPU in parallel.
Thanks again for detailed steps.
On Sun, Jun 19, 2016 at 12:34 AM, brian mullan <
Post by brian mullan
I do this using 3 different methods.
using xnest
using xRDP & Guacamole
and using x2go.
For me the most easiest & most full featured approach is x2go.
Guacamole & xRDP works great & only requires an HTML5 bBrowser but
there is alot to the setup and some capabilities of Guacamole (cut & paste,
printing) are still a bit cumbersome to accomplish.
The following is going to assume Ubuntu 16.04 and x2go...
## Create an LXD container using say Ubuntu 16.04
lxc exec container_name bash
## add some repositories for xenial (re 16.04)
echo "deb http://archive.canonical.com/ubuntu xenial partner" |
sudo tee -a /etc/apt/sources.list
echo "deb-src http://archive.canonical.com/ubuntu xenial partner"
| sudo tee -a /etc/apt/sources.list
echo "deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports
main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://us.archive.ubuntu.com/ubuntu/
xenial-backports main restricted universe multiverse" | sudo tee -a
/etc/apt/sources.list
apt install software-properties-common -y
## add the ubuntu-mate repository
sudo add-apt-repository ppa:ubuntu-mate-dev/xenial-mate -y
## add the x2go repository
add-apt-repository ppa:x2go/stable
## update & upgrade the container
apt update && apt upgrade -y
## install ubuntu-mate dekstop or xubuntu-desktop or
lubuntu-desktop (this will take upto 30 min or more depending on PC/HD etc)
sudo apt install lightdm ubuntu-mate-core ubuntu-mate-desktop -y
## set things up so all future user accounts you create in this
container default to the Ubuntu-Mate desktop
sudo update-alternatives --set x-session-manager
/usr/bin/mate-session
## install the x2go server side software
apt install x2goserver x2goserver-xsession
## create user accounts for your "users" as you normally would
## then depending on whether you want to use login/password or a
key based login edit the /etc/ssh/sshd_config and set it up appropriately
## adn when done configuring the container... reboot the container
sudo apt install software-properties-common -y
## add the x2go repository
sudo add-apt-repository ppa:x2go/stable
sudo apt install x2goclient
= = = = = = =
Finally make sure you container is started & get its IP address
Start the x2go client (Click the DASH icon and type "x2go") then
click on the x2go icon that comes up
In the x2go client gui create a Profile (upper left corner icon of
the x2go gui) for the container
1. enter some Profile "name" at the top to ID what that profile
is for say "My Ubuntu-Mate Desktop)
2. input the container's HOST IP,
3. click the drop down menu and select which Desktop
Environment (re Session Type) you installed (Mate in the case)
4. Save that profile.
You will see that there will appear a new square icon on the right
side of the x2go GUI.
Then execute that Profile by clicking on it & login using one of
the login ID's you created in the container.
Audio/Printing etc should also all just work.
If you can't login the usual problem are authentication is not
setup right (login ID + password vs key based) remember to do that in
container.
Once you've created the 1st container like this you can just
clone/copy it to create more.
On the Host just create a different x2go Login Profile for each
container/IP & give each Profile a different TItle. You can also have diff
containers with different desktops (xubuntu, lubuntu, ubuntu-mate etc)
If you leave the x2go Profile LOGIN field empty any valid user can
click on the Profile Icon and just fill in their ID and Password in order
to log into the container.
Brian
Loading...