<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
>I don't know if you got the script from Stéphane's LXC article
(<a class="moz-txt-link-freetext"
href="https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/">https://www.stgraber.org/2014/02/09/lxc1-0-gui-in-containers/</a>),
but in it he say's it is used to "tell pulseaudio on the host to
bind <i class="moz-txt-slash"><span class="moz-txt-tag">/</span>home/ubuntu<span
class="moz-txt-tag">/</span></i>.pulse_socket in the container,
checking that it’s not already setup."
<br>
<br>
Well initially I got the script from flockport but went back to
Stéphane's LXC article (<a class="moz-txt-link-freetext"
href="https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/">https://www.stgraber.org/2014/02/09/lxc1-0-gui-in-containers/</a>)
and did realize that I was using a script for privileged containers.
Fixed the script and it is still having problems. The script when
executed manually does not return any errors however pulse still
does not export in the container and the .pulse_socket is not
created in /home/ubuntu directory of the container and yes I
specified the entire correct path in the script.<br>
I believe the problem may be id mapping as described in the
aforementioned blog series. The following would be added to the lxc
config file:<br>
<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<pre style="border: 0px; margin: 0px 0px 24px; padding: 1.5em; vertical-align: baseline; font-family: 'Courier 10 Pitch', Courier, monospace; overflow: auto; color: rgb(34, 34, 34); line-height: 21px; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background: rgb(247, 247, 247);">lxc.id_map = u 0 100000 1000
lxc.id_map = g 0 100000 1000
lxc.id_map = u 1000 1000 1
lxc.id_map = g 1000 1000 1
lxc.id_map = u 1001 101001 64535
lxc.id_map = g 1001 101001 64535
</pre>
the user ubuntu in the container needs to be mapped to the same user
id as the normal user in the host. I am unaware of how this can be
done in the LXD config file or if an equivalent configuration can
even be made with LXD.<br>
<br>
I think that if someone knows how this can be done in the LXD config
file, and also how hooks can be implemented, that sound could be
quickly enabled. If someone has any ideas please feel free to share
them.<br>
<br>
>Unfortunately I do not know how to translate that to LXD. As far
as I can tell (by looking at the lxc-to-lxd script) hooks are not
supported yet. Perhaps there is a workaround?
<br>
<br>
>Could you please post an example of the lxd config commands you
used to make your graphics work?<br>
<br>
As I mentioned this was surprisingly easy. I found the following
commands that someone had posted in an old lxc-users mailing. Sorry,
I can not remember who it was.<br>
<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<p style="margin-bottom: 0in; font-variant: normal; letter-spacing:
normal; font-style: normal; font-weight: normal; line-height:
0.22in; widows: 1">
<font color="#444444"><font face="Calibri, sans-serif"><font
style="font-size: 11pt" size="3">lxc
config device add qt5-development /dev/nvidia0 unix-char
path=/dev/nvidia0 <br>
<br>
lxc config device add
qt5-development /dev/nvidiactl unix-char path=/dev/nvidiactl
<br>
<br>
lxc
config device add qt5-development /dev/nvidia-uvm unix-char
path=/dev/nvidia-uvm <br>
<br>
lxc config device
add qt5-development /dev/video0 unix-char path=/dev/video0
<br>
lxc
config device add qt5-development /dev/tty0 unix-char
path=/dev/tty0
<br>
<br>
lxc config device add
qt5-development /dev/tty7 unix-char path=/dev/tty7 <br>
<br>
lxc
config device add qt5-development /dev/tty8 unix-char
path=/dev/tty8
<br>
<br>
lxc config device add qt5-development /dev/fb0
unix-char path=/dev/fb0 <br>
e99dd6437665<br>
lxc
config device add qt5-development /dev/dri unix-char
path=/dev/dri
<br>
<br>
lxc config device add qt5-development
/dev/dri/card0 unix-char path=/dev/dri/card0<br>
</font></font></font></p>
<p style="margin-bottom: 0in; font-variant: normal; letter-spacing:
normal; font-style: normal; font-weight: normal; line-height:
0.22in; widows: 1">I replicated everything except the nvidia lines
as they do not apply to me. Also I found that I was not able to
"mount" directories with this command like /dev/dri and /dev/snd.
I had to execute a line for each device in these directies such as
/dev/dri/card0 and so on. After this the config file looked like
the following:</p>
<p style="margin-bottom: 0in; font-variant: normal; letter-spacing:
normal; font-style: normal; font-weight: normal; line-height:
0.22in; widows: 1">name: gc1<br>
profiles:<br>
- default<br>
config:<br>
volatile.base_image:
e99dd64376651ed3b81bf312d2cfde1ef0a58ecd296a9ae4b654bda733f832ee<br>
volatile.eth0.hwaddr: 00:16:3e:0f:6d:36<br>
volatile.last_state.idmap:
'[{"Isuid":true,"Isgid":false,"Hostid":500000,"Nsid":0,"Maprange":458752},{"Isuid":false,"Isgid":true,"Hostid":500000,"Nsid":0,"Maprange":458752}]'<br>
devices:<br>
/dev/dri/card0:<br>
path: /dev/dri/card0<br>
type: unix-char<br>
/dev/dri/controlD64:<br>
path: /dev/dri/controlD64<br>
type: unix-char<br>
/dev/dri/renderD128:<br>
path: /dev/dri/renderD128<br>
type: unix-char<br>
/dev/fb0:<br>
path: /dev/fb0<br>
type: unix-char<br>
/dev/snd/controlC0:<br>
path: /dev/snd/controlC0<br>
type: unix-char<br>
/dev/snd/hwC0D0:<br>
path: /dev/snd/hwC0D0<br>
type: unix-char<br>
/dev/snd/hwC0D3:<br>
path: /dev/snd/hwC0D3<br>
type: unix-char<br>
/dev/snd/pcmC0D0c:<br>
path: /dev/snd/pcmC0D0c<br>
type: unix-char<br>
/dev/snd/pcmC0D0p:<br>
path: /dev/snd/pcmC0D0p<br>
type: unix-char<br>
/dev/snd/pcmC0D3p:<br>
path: /dev/snd/pcmC0D3p<br>
type: unix-char<br>
/dev/snd/pcmC0D7p:<br>
path: /dev/snd/pcmC0D7p<br>
type: unix-char<br>
/dev/snd/pcmC0D8p:<br>
path: /dev/snd/pcmC0D8p<br>
type: unix-char<br>
/dev/snd/seq:<br>
path: /dev/snd/seq<br>
type: unix-char<br>
/dev/snd/timer:<br>
path: /dev/snd/timer<br>
type: unix-char<br>
/dev/tty0:<br>
path: /dev/tty0<br>
type: unix-char<br>
/dev/tty7:<br>
path: /dev/tty7<br>
type: unix-char<br>
/dev/tty8:<br>
path: /dev/tty8<br>
type: unix-char<br>
/dev/video0:<br>
path: /dev/video0<br>
type: unix-char<br>
root:<br>
path: /<br>
type: disk<br>
ephemeral: false<br>
</p>
<p style="margin-bottom: 0in; font-variant: normal; letter-spacing:
normal; font-style: normal; font-weight: normal; line-height:
0.22in; widows: 1">Then launched gc1 and ssh -X <a class="moz-txt-link-abbreviated" href="mailto:ubuntu@10.0.1.16">ubuntu@10.0.1.16</a>
and launched a browser and chromium-bsu. Both worked flawlessly
but without sound.<br>
<br>
</p>
>I wonder why more people are not asking/answering questions
about LXD GUI containers; information on the subject is very scarce.
Even Stéphane's new series of LXD articles does not cover it. Is LXD
not recommended for GUI use?
<br>
<br>
Me as well. it seems like an important use case. My guess is the
developers are avoiding their creation getting labeled as yet
another application container system. <br>
<br>
<div class="moz-cite-prefix">On 03/31/2016 01:17 AM,
<a class="moz-txt-link-abbreviated" href="mailto:lxc-users-request@lists.linuxcontainers.org">lxc-users-request@lists.linuxcontainers.org</a> wrote:<br>
</div>
<blockquote
cite="mid:mailman.26.1459412269.1698.lxc-users@lists.linuxcontainers.org"
type="cite">Re: [lxc-users] Graphics and sound with LXD</blockquote>
<br>
</body>
</html>