If you read my previous post WebEx in Ubuntu LXC containers you’ll have learned how to get Cisco’s Webex running on Ubuntu in a 12.04 container.
I figured it was time to work out how to get it running in the newer LXD containers available in 16.04, here’s how I did it.
Install LXD
apt-get install lxd sudo lxd init
When it asks you about networking, use the existing lxcbr0 bridge, do not let it use a new bridge as by default it will create lxdbr0. We need to stay on lxcbr0 so that networking continues to work in the old containers.
Create the LXD container
lxd init ubuntu:precise webex
This will download a new 12.04 template if you don’t already have one, it will take a while depending on your Internet connection.
Cheat by copying the old rootfs
I’m not going to rebuild my rootfs from scratch, the old one is perfectly usable! So as root, we can copy it from the old LXC area:
cp -rp /var/lib/lxc/webex/rootfs /var/lib/lxd/containers/webex/
Configure the container
The old container rootfs was a privileged container so we need to do the same on this LXD copy:
lxd config set webex security.privileged true
To make the sound device available you need to set up the sound device in the container. Here I am adding all the devices under /dev/snd/ on my own host, note that yours may differ so edit the commands accordingly:
lxc config device add webex /dev/snd/controlC0 unix-char path=/dev/snd/controlC0 lxc config device add webex /dev/snd/hwC0D0 unix-char path=/dev/snd/hwC0D0 lxc config device add webex /dev/snd/hwC0D3 unix-char path=/dev/snd/hwC0D3 lxc config device add webex /dev/snd/pcmC0D0p unix-char path=/dev/snd/pcmC0D0p lxc config device add webex /dev/snd/pcmC0D3p unix-char path=/dev/snd/pcmC0D3p lxc config device add webex /dev/snd/seq unix-char path=/dev/snd/seq lxc config device add webex /dev/snd/timer unix-char path=/dev/snd/timer
You may remember I was using ssh X forwarding in the old container. We don’t need to do that any more as we can get direct access to the video from the container by using this config:
lxc config device add webex /dev/dri/card0 unix-char path=/dev/dri/card0 lxc config device add webex /dev/dri/controlD64 unix-char path=/dev/dri/controlD64 lxc config device add webex /dev/dri/renderD128 unix-char path=/dev/dri/renderD128 lxc config device add webex /dev/dri/fb0 unix-char path=/dev/fb0 lxc config device add webex /dev/video0 unix-char path=/dev/video0 lxc config device add webex X11 disk source=/tmp/.X11-unix path=/tmp/.X11-unix
Again your devices under /dev/dri may differ a little to mine, change accordingly.
Now, start the container and start a bash shell in it:
lxc start webex lxc exec webex bash
You’ll now have a root prompt in the container. You can test that sound is working by doing something like:
sudo -u ubuntu aplay /usr/share/sounds/alsa/Front_Center.wav
In root’s home we need to make a script to start firefox for us, it looks like this:
root@webex:~# cat webex.sh  #!/bin/bash DISPLAY=:0 su -c firefox - ubuntu
Make sure to chmod +x webex.sh
Now, all things being good, you can do this to launch Firefox:
lxc exec webex ./webex.sh
Launch Webex as you normally would and verify that it works. If it’s OK, you can remove the old SSH service as it’s not needed any more.
apt-get remove openssh-server
In my next post, I’ll explain how to convert the configuration into a more handy LXD profile that you can use for any container.
This was a great guide… useful in so many ways.
Thanks
Brian
The video mapping & launching firefox worked fine.
However, the audio setup didn’t seem to work on my ubuntu 16.04 with LXD
ALSA lib confmisc.c:768:(parse_card) cannot find card ‘0’
etc error msgs
I realize your demo scripts on this were about ubuntu 12.04 and I am on ubuntu 16.04.
Have you tried this on 16.04 yet?
I’ve not tried it on 16.04, this was purely an exercise in getting webex to work on a 12.04 container, since it’s too old to work properly on 16.04.
Since I updated my machine to a 16.04 host, my sound is no longer working in the browser so I need to investigate. The aplay example works though, just no browser sound.
aplay worked for me as well. I’ll got back & try the browser (both chromium & firefox). I found that Chromium/Chrome has a “Setting” called “Use Hardware acceleration when available” that has impacted my use in containers in the past & turning if off has made a difference. Not saying that is the cause of your browser issue but trying Firefox will let you know.