You are not logged in.
Hi community,
After months researching i face a wall trying to understand/setup a nice and contained user environment. Therefore this mail is an appeal for a gentle soul willing to spread some knowledge.
Intro
My idea was to create as simple archlinux host as possible and many lxc containers to isolate the different functionalities i used to "compromise" every time I have an idea. I succeed in creating X inside a container, even communicating a containerized GUI app with the host's Xorg. But that was by following other's tutorials and a lot of trial and error and never going too away from the path as I really lack the deep knowledge of what is going on internally.
My findings
This will be a really long and incoherent list, but summarizing. As you may see not really related to LXC but to Xorg/pulse/bluez and DM
- Pulseaudio works better in user mode
- Bluetooth only works with admin rights (or with DBUS tweaking, but never achieved). Therefore the PA user will never be able to enable a bluetooth headset
- Xorg can (through DBUS?) combine both above.
- Xorg can be started manually, but to get the DBUS magic the use of a root-DM is mandatory (i used gdm and it was magical, gdm enable > months of manual work ).
-TDM y XDM are hard beast to tame (at least for my proposes)
What i think is the best way to proceed:
I think the best way is to let the host handle the Xorg, Pulseaudio and Bluetooth, providing their respective sockets to the LXC guest. And then create LXC with GNOME, other with KODI, other with chrome, vlc,...
For what would I need some guideance.
How to start an Xserver (without apps, only black screens) to let pulseaudio, bluetooth and inputs communicate to each other. Maybe some DBUS related examples.
But i dont really want to be a help vampire, some links, references or tips will be awesome. Also, very important... best practices!!!! how to structure the project
Last edited by wikavalier (2016-09-15 12:20:38)
Offline
Your question is vague. I am not sure what exactly you are trying to do. Please describe directly your problem and one one problem by post. I think you mistake the X server and a full Desktop environment like Gnome. The X server (Xorg) have nothing to do with pulseaudio or bluetooth. Just starting a blank X server won't have any effect on them. I guess what you want is to somehow assemble yourself some components of a Deskop environment. You will need Xorg (for the graphic) and a windows manager (some of them can be run without additional component like fluxbox or icewm or the minimal desktop Lxde. The other components like pulseaudio, dbus, etc. are optional; see the wiki for each of them in order to know how they work or ask a specific question about them if you need it.
As an example, install Xorg (and the needed driver for your graphic card) and icewm. Set the default target as the multi-user.target; copy /etc/X11/xinit/xinitrc to ~/.xinirtc and make it executable; then edit it and replace twm by "exec icewm-session". Now login in the console and type startx. This will give you the minimum necessary to have a graphical environment. You can of course replace icewm by another windows manager if you prefer.
Last edited by olive (2016-09-15 13:00:30)
Offline
- Xorg can be started manually, but to get the DBUS magic the use of a root-DM is mandatory
What on earth gave you this idea? This is totally and completely false. DMs are completely useless. They serve no purpose but aesthetics and are often the cause of problems.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
What on earth gave you this idea? This is totally and completely false. DMs are completely useless. They serve no purpose but aesthetics and are often the cause of problems.
While I agree that the use of a so called root-DM has nothing to do with dbus. I cannot agree with the fact that DM's are "completely useless". You need some kind of "display manager " when you login locally. You can use the traditional text based agetty if you prefer. A display manager is just the equivalent of agetty but is using X instead. Now I can agree that some display manager are bloated.
Last edited by olive (2016-09-15 13:19:30)
Offline
Thanks for your replies, really appreciated.
Yes you are right, I have no idea what are my problems or where to look to know what is happening, that is why I am asking for guidance ![]()
@Trilby,
I managed to make pulseaudio in system mode to work with bluez. But I wasnt able to make pulseaudio (in user mode) communicate with bluez until I enabled gdm. I tried everything in the web (of course without too much criterion), including setting some dbus rules.
That is why I understood that they way the (G)DM starts the X server (as a root as i can read in the logs) makes possible the communication between pulse and bluez.
@Olive,
Yes I want to assemble some parts but is really hard for me to tell which ones. I will try to enumerate my thoughts in order:
- as minimal arch linux "host" as possible [done]
- make pulseaudio start in systemctl --user mode. (I never managed to startup pulse by socket when using LXC'ed applications) [done]
- make pulseaudio work with bluetooth. (without X or gnome, or whatever). I think that can be done with dbus but dont know how.
- start a simple Xserver. By simple I mean with intel drivers and probably vaapi (but I think this one isnt necessary, only in the LXC). And by simple I also mean without anything, because if i just xinit (with ie. xterm), and then start a gnome over the X0 socket the xterm will remain, and if i close it, it will close the Xserver.
Again thanks
Last edited by wikavalier (2016-09-15 14:09:10)
Offline
You need some kind of "display manager " when you login locally. You can use the traditional text based agetty if you prefer.
Feel free to argue against my admittedly bold claim that DMs are useless. There are actually reasonable counter arguements as they do server a purpose in some cases - but for a vast majority of users these situations do not apply. However, claiming that a DM is needed is quite plainly false. As is the claim that agetty is a text-based DM. It is not.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
@Olive,
Yes I want to assemble some parts but is really hard for me to tell which ones. I will try to enumerate my thoughts in order:- as minimal arch linux "host" as possible [done]
According to the claim that follow, you don't want a "minimal Archlinux". You can have a miniaml console based archlinux without Xorg, pulseaudio, etc. So you want something. Let's try to define what you require.
- make pulseaudio start in systemctl --user mode. (I never managed to startup pulse by socket when using LXC'ed applications) [done]
- make pulseaudio work with bluetooth. (without X or gnome, or whatever). I think that can be done with dbus but dont know how.
First question, if you want something minimal are you sure you want pulseaudio? Usually it is only some bloated stuff that goes between alsa and the software. But almost all software that I know are able to work without it and it is usually more trouble free. If you want it, read the pulseaudio wiki. You might indeed need it if you want audio support in bluetooth, see the bluetooth wiki that explain everything you need to know to have bluetooth working.
- start a simple Xserver. By simple I mean with intel drivers and probably vaapi (but I think this one isnt necessary, only in the LXC). And by simple I also mean without anything, because if i just xinit (with ie. xterm), and then start a gnome over the X0 socket the xterm will remain, and if i close it, it will close the Xserver.
As I said, don't just launch an xterm but a standalone windows manager like icewm or fluxbox. You need an ~/.xinitrc if you use startx/xinit (see my previous post). Don't launch Gnome that is not something minimal. vaapi is a library that will be used by software to hardware accelerate video playback.
We cannot know what you needs are. For example, I don't use pulseaudio nor bluetooth, yet I do not consider I use something minimal (I use XFCE). As I said start with a standalone windows manager or a very light desktop like lxde and add the components you need. If you have problems ask a precise question about the component that gives you trouble.
Offline
Thanks a lot Olive,
First of all i would like to rephrase "minimal". I was trying to mean easy/auto configure. I dont really care about the cpu consumption or memory as (at the moment) i have plenty. Also, something that I said that is leading into confusion is my usage of LXC, as all my test are too biased by this.
I like pulseaudio because of its socket. It is really handy for containers as it will save a lot of configuration. But you are right, pulseaudio is fantastic when it works, but when it is not it is a real pain to debug.
I will try to run Xorg by copying xinitrc and pointing to icewm.
Regards,
Offline