ustuehler / lxc-desktop

Multiple desktop environments on a single machine with Linux containers
84 stars 10 forks source link

Any thought to updating for LXD use #12

Open bmullan opened 8 years ago

bmullan commented 8 years ago

Title asks the question Thanks

bmullan commented 8 years ago

Uwe..

I tried to find an email to send this to you but failed to locate a working one so I will post it here as part of this "issue"...

I happened on your GitHub repo for: https://github.com/ustuehler/lxc-desktop

As you are probably aware by now although it uses LXC the new LXD has a totally new/different CLI syntax and a JSON api to manage/provision LXD containers both locally & remotely.

Your LXC-DESKTOP appears to be formed around the older style LXC syntax & config info (I called that "legacy" lxc).

Have you given any thought to updating lxc-desktop for LXD?

I learned quite a bit about PulseAudio when building some of my own scripts for LXD and learned about the many challenges with getting it to work in LXD/LXC containers.

I end up using PulseAudio's TCP module capability.

I was wondering if you were still interested in pursuing your LXC Desktop capability but modernizing it to LXD ?

If so I could try to help. I am not much of a programmer anymore (some python & bash) but more of an integrator. However, I think you can see from the Scripts etc on my GitHub (https://github.com/bmullan/CIAB-Guacamole-Remote-Desktop) that I might be able to help collaborate with you on the effort. Let me know (bmullan.mail@gmail.com)

I've just recently found 2 bits of information that I think could solve your lxc-desktop sticking point regarding "device cloning script which runs at container startup" in the new LXD environment.

#1 was this post by someone named - Simon Poirier (simpoir): https://github.com/lxc/lxd/issues/2003

I tried Simon's LXD "lxc launch" example using "-c raw.lxc="lxc.hook.pre-start" and it worked on LXD as his post indicated !

So I thought perhaps that was a good example of how to solve the problem of getting a pre-start script to run on LXD.

#2 was a blog I ran across https://bigjools.wordpress.com/2016/07/13/webex-using-ubuntu-lxd-containers/

Although "bigjools" blog post use-case was about getting webex to work in LXD his 2 examples of how to map Host audio/sound and video devices into LXD worked for me on my system using aplay & vlc to test audio/video.

The only additional step I had to take on my system for the audio/sound to work was mentioned in a previous post on "legacy" lxc by bigjools (the author) where he said:

Now, we can test the sound to make sure that the config worked, try something like this:

aplay /usr/share/sounds/alsa/Front_Center.wav

If you hear the test sound, then it’s all good. If you don’t hear it, and get an error, then you’ll have to Google. In my case, the command was working without any error but there was no sound. I fixed this by adding a custom .asoundrc in the ubuntu user’s home directory:

pcm.!default { type plug slave.pcm { type hw card 1 device 0 } }

defaults.ctl.card 1

It’s highly likely you may have to edit this for your sound hardware, but then again it may work. I’m not an ALSA expert, do some Googling if there’s still no sound, you just need to find the right device. You can test more quickly with a line like this:

aplay -D plughw:1,0 /usr/share/sounds/alsa/Front_Center.wav

Vary the device numbers of 1,0. Hopefully you’ll get it working eventually.

So I just created a ~/.asoundrc for my userID (or use it in /etc/asound.conf) in the LXD container and coupled with his steps in the above LXD blog post (modified to match my system;s /dev/snd devices) ... sound worked well!

Anyway... I think using the combination of info in #1 and #2 above coupled with an updated for LXD version of your lxc-desktop should be workable.

That would only leave the effort of creating an lxd template for it which I have no experience with but I would think someone from the lxc-users@lists.linuxcontainers.org might be interested in assisting?

FYI... I started a new sub-reddit /r/lxd dedicated to LXD as it enabled separation from the "legacy" lxc topics posted in the older sub-reddit /r/lxc

naisanza commented 8 years ago

This has been my major push for making LXD a viable "virtualization" option. Let us containerize our desktop environment!

LXD claims it's just like a virtual machine, but to me, it only covers half the use-cases of an actual real virtual machine; the other half needing to use KVM for full virtualization (i.e. desktop virtualization)

bmullan commented 8 years ago

Eric there are many solutions to using lxd for remote desktops. Most just require a port forward to the container. I've used x2go (www.x2go.org), xpra and guacamole to implement different methods. All work great. Uwe's solution for legacy lxc migrated to lxd just adds another nice solution..!

On Sep 3, 2016 10:23 AM, "Eric" notifications@github.com wrote:

This has been my major push for making LXD a viable "virtualization" option. Let us containerize our desktop environment!

LXD claims it's just like a virtual machine, but to me, it only covers half the use-cases of an actual real virtual machine; the other half needing to use KVM for full virtualiztion (i.e. desktop virtualization)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ustuehler/lxc-desktop/issues/12#issuecomment-244549282, or mute the thread https://github.com/notifications/unsubscribe-auth/ABmtp1INiTqZZs71g2bZ6g3aIFRODFdUks5qmYL1gaJpZM4Juo6f .

naisanza commented 8 years ago

But does it work without an X server installed onto the host?

On September 3, 2016 5:42:19 PM EDT, bmullan notifications@github.com wrote:

Eric there are many solutions to using lxd for remote desktops. Most just require a port forward to the container. I've used x2go (www.x2go.org), xpra and guacamole to implement different methods. All work great. Uwe's solution for legacy lxc migrated to lxd just adds another nice solution..!

On Sep 3, 2016 10:23 AM, "Eric" notifications@github.com wrote:

This has been my major push for making LXD a viable "virtualization" option. Let us containerize our desktop environment!

LXD claims it's just like a virtual machine, but to me, it only covers half the use-cases of an actual real virtual machine; the other half needing to use KVM for full virtualiztion (i.e. desktop virtualization)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub

https://github.com/ustuehler/lxc-desktop/issues/12#issuecomment-244549282, or mute the thread

https://github.com/notifications/unsubscribe-auth/ABmtp1INiTqZZs71g2bZ6g3aIFRODFdUks5qmYL1gaJpZM4Juo6f .

You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/ustuehler/lxc-desktop/issues/12#issuecomment-244571767

bmullan commented 6 years ago

@naisanza - x2go can be installed on a "server" as it has its own x-server if one doesn't exist for the x2goserver "component". I think you may still need to install some kind of DE in the container (mate, xfce, lxde etc) I know that works but I guess I've never tried just installing something like firefox in the container w/out a DE installed and launching firefox?