[lxc-users] Graphics and sound with LXD

zztest at openmailbox.org zztest at openmailbox.org
Thu Mar 31 07:51:35 UTC 2016


On 2016-03-29 23:03, efersept wrote:
> I was able to get graphics working fairly easily by "mounting" the
> necessary devices via the 'lxc config device add  <container> ...'
> tool, however the following:
> 
>  lxc.hook.pre-start =
> /home/USERNAME/.local/share/lxc/precise-gui/setup-pulse.sh
> 
>   still has me mystified.
> 
>  First off I can not find documentation of how to create hooks in an
> LXD configuration. Secondly I do not have enough knowledge of what
> this script is doing, other than to change the paths and user names,
> to alter it properly. Thirdly, there is no equivalent directories that
> I am aware of that are used by lxd.
> 
>  I have looked at flockport's documentation and they mention several
> alternative ways to implement this but all seem to have some legacy
> lxc dependency of some kind.
> 
>  I did create a /tmp/.lxc directory then ran the script changing the
> path to /tmp/.lxc/.pulse_socket and the user name and this seemed to
> be successful. Also successfully 'export
> PULSE_SERVER=/tmp/.lxc/.pulse_socket', also without error. But when I
> tried 'lxc config device add <container> /tmp/.lxc/.pulse_socket
> unix-char /tmp/.lxc/.pulse_socket' it returned the following error:
> 
>  error: Failed to setup device: Failed to get device attributes: Not a
> device
> 
>  perhaps this is obvious to some of you but I could really use help
> with this.
> 
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


I don't know if you got the script from  Stéphane's LXC article 
(https://www.stgraber.org/2014/02/09/lxc-1-0-gui-in-containers/), but in 
it he say's it is used to "tell pulseaudio on the host to bind 
/home/ubuntu/.pulse_socket in the container, checking that it’s not 
already setup."

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?

Could you please post an example of the lxd config commands you used to 
make your graphics work?

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?





More information about the lxc-users mailing list