Running Skype in a chroot on Ubuntu

Created 19th October, 2013 07:12 (UTC), last edited 3rd November, 2013 11:17 (UTC)

I just upgraded my laptop to Saucy Salamander, and just about the only thing that broke was Skype, which had been pretty flaky already. I think that Skype isn't particularly happy with a 64 bit runtime, even the multi-architecture version is just the 32 bit code wrapped in some way.

What I wanted to do was to be try to run it inside the Lucid 32 bit runtime as I figured that's what they've been targetting and ideally I'd also have a very clean install with nothing else in there. I've been playing around with the tools schroot and debootstrap for some other work, and have written mkschroot as a way to make the building of these environments totally reproducible. I hoped getting Skype to run was going to be easy, and it turned out to be trivial.

Pre-requisites

You'll need to install a few packages:

sudo apt-get install python-setuptools schroot debootstrap

The python-setuptools is just so you can install mkschroot and the other two packages are needed to get the schroot working.

Now install mkschroot:

sudo easy_install mkschroot

You may want to substitute that with a pip command and maybe a virtual environment too, but if you know about that sort of thing you don't need me to tell you the commands.

The configuration file

Below is the configuration file:

There are a couple of things you may need to change:

  • The root item is where mkschroot will create the schroot. On my system the total environment size (including Skype installation) is 438MB.
  • source points to a download mirror. A list of Ubuntu mirrors can be found here, or you can look in your /etc/apt/sources.list file to find what you're using already.
  • The http-proxy should point to your apt-cacher. If you don't have one then remove that line. For quickest results also make sure that your /etc/apt/apt.conf contains the right apt-cacher configuration.

You need to create a local file with a copy of this configuration file with appropriate changes for your environment in order to use it.

Building the schroot and installing Skype

Create the lucid runtime using this command (skype.json is the file name you saved the configuration file to):

mkschroot skype.json

The first time you run this it will need to ask for sudo rights in order to create the configuration file for you in /etc/schroot/chroot.d/.

If you ever want to update to newer lucid packages in the schroot (for example, when security patches are released) you can simply re-run this command.

The schroot that is created will automatically mount your home directory and have a user with the same permissions as you, so if you already have a Skype configuration on your machine it will be picked up by the version inside the chroot.

Now to install Skype. Download the 10.04 32 bit version. At the time of writing I got skype-ubuntu-lucid_4.2.0.11-1_i386.deb:

schroot -c skype -u root -- dpkg -i Downloads/skype-ubuntu-lucid_4.2.0.11-1_i386.deb

The required packages that Skype needs should already be installed.

Running Skype

To run Skype start it from a command line like this:

schroot -c skype -p /usr/bin/skype &

Doing this allowed Skype to run without segfaulting. schroot also ensured that the mic and webcam were properly available for Skype to use and because schroot also mounted my home directory for me inside the chroot jail Skype had access to my existing configuration and history etc.

Now I just have to keep using it to see if it's more stable in its preferred environment than it was when running under raring…


Categories: