Tag Archives: Ubuntu

Docker with OverlayFS on Ubuntu 15.10

As of today, the default storage for Docker on (K)Ubuntu 15.10 is AUFS. I want to switch it to OverlayFS. Personally, I’m still new to Docker, but I did hear that OverlayFS is better than AUFS. You can read more about OverlayFS here.

Anyway, the purpose of this post is how to switch OverlayFS and avoid head-scratching.

On Ubuntu 15.10 (wily), one can start/stop services either using Upstart or systemd. Since I want to get more accustomed to using systemd, I’ve been trying to use it anywhere possible. For example, here’s the command to start docker:

$ sudo systemctl start docker

To verify what storage driver used:

$ docker info 
Containers: 0
Images: 0
Server Version: 1.9.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 0
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.2.0-19-generic
Operating System: Ubuntu 15.10
CPUs: 4
Total Memory: 7.663 GiB
Name: f9470m

Okay, let’s begin to change the storage driver from AUFS to OverlayFS.

Lots of tutorials online including this one and this one, suggest to provide an option in /etc/default/docker.

DOCKER_OPTS="-s overlay"

or

DOCKER_OPTS="--storage-driver=overlay"

Unfortunately, it didn’t work for me. But when I started docker using upstart command as the following:

$ sudo service docker start

the storage driver has changed to “overlay” correctly!

$ docker info | grep -i driver
WARNING: No swap limit support
Storage Driver: overlay

It took me awhile to figure out that the option provided to /etc/default/docker is only for Upstart.

Well, now I at least know which direction; or questions I should ask Google. Docker has an article explaining how to control docker with systemd. With that, I was able to adapt it to pass an option to systemd docker.service to use OverlayFS.

Here’s how I did it.

First, I ensure that docker is not running.

$ sudo systemctl stop docker

If docker was started with Upstart use ($ sudo service docker stop instead.)

In my case, since I just started running Docker on this machine, I didn’t have any images or useful files. So I took an extra step to remove old AUFS files. You may need to think twice before running the following command. You might lose your important data!

If you’re unsure, don’t run it. You’ve been warned!

$ sudo rm /var/lib/docker -rf

Then create a directory, if not yet exist, /etc/systemd/system/docker.service.d. Create a file, call it whatever you like. I named it overlay.conf with the content:

[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver overlay

Now, start docker service with systemd again:

$ sudo systemctl start docker

We can verify it by running ‘docker info’:

$ docker info
Containers: 0
Images: 0
Server Version: 1.9.1
Storage Driver: overlay
 Backing Filesystem: extfs
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.2.0-19-generic
Operating System: Ubuntu 15.10
CPUs: 4
Total Memory: 7.663 GiB
Name: f9470m

It’s working! Oh, if you’re wondering why I can just run docker command without prefix with sudo; it’s because my user account is docker group.

Happy dockering!

ERROR: could not insert ‘nvidia_352’: Unknown symbol in module, or unknown parameter (see dmesg)

This is my third time having problem installing Nvidia drivers on Ubuntu (14.04). What’s worse is that I could not remember how I fixed them last time.

Hope this blog post will prevent me from pulling my hair out for the 4th time.

So, I installed Nvidia driver as usual:

# apt-get install nvidia_352

After it’s finished, I tried to load the module:

# modprobe nvidia
modprobe: ERROR: could not insert 'nvidia_352': Unknown symbol in module, or unknown parameter (see dmesg)

Well, it turned out that I need to also install another linux-image package: linux-image-extra-3.13.0-70-generic. If you try to install this package on your machine, ensure that you match the version of the kernel too; i.e. 3.13.0-70 in my case.

# apt-get install linux-image-extra-3.13.0-70-generic 
# modprobe nividia
# lsmod | grep nvidia
nvidia               8642880  33 
drm                   303102  2 nvidia

Thanks to people in this link: https://devtalk.nvidia.com/default/topic/547588/error-installing-nvidia-drivers-on-x86_64-amazon-ec2-gpu-cluster-t20-gpu-/

Installing Code Composer Studio 6 on Ubuntu 14.10 (64-bit)

As of today, Code Composer Studio (ccs) 6 is only available for 32-bit Linux platform.  The good news is that it can be installed on a 64-bit version of Ubuntu and Fedora.

ccs6

In this blog post, I’m going to show a few issues I came across and how to fix them on Ubuntu 14.10 64-bit.

Issue 1:

After the installation, when I ran the ccs, it produces some warning and error messages then quit.

...
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
    /home/kenno/apps/ti/ccsv6/eclipse/configuration/org.eclipse.osgi/bundles/244/1/.cp/libswt-pi-gtk-4333.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
    no swt-pi-gtk in java.library.path
    /home/kenno/.swt/lib/linux/x86/libswt-pi-gtk-4333.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
    Can't load library: /home/kenno/.swt/lib/linux/x86/libswt-pi-gtk.so

The fix [1]:

$ sudo apt-get install libgtk2.0-0:i386

Issue 2:

Now that ccs can be launched, but there are still some warnings.

ccstudio:23614): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
Gtk-Message: Failed to load module "canberra-gtk-module"

The fix:

$ sudo apt-get install libcanberra-gtk-module:i386

Issue 3:

Here is another warning, which we can get rid of.

(ccstudio:28693): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

The fix [2]:

$ sudo apt-get install gtk2-engines-pixbuf:i386

Issue 4:

This one is similar to the issue #3.


(ccstudio:28917): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

The fix:

$ sudo apt-get install gtk2-engines-murrine:i386

Issue 5:

This one is something to do with the App Center which only shows a blank page. According to the information found in reference [3], the internal web browser, chromium, could not launch because of missing libudev.so.0.

The fix:

 
$ sudo apt-get install libudev1:i386
$ sudo ln -s /lib/i386-linux-gnu/libudev.so.1 /usr/lib/libudev.so.0

Note that you must use libudev.so.1 provided by the 32 bit package.

References:

  1. http://askubuntu.com/questions/356605/ubuntu-13-10-64-bit-machinarium-error-while-loading-shared-libraries-libgtk-x1
  2. http://askubuntu.com/questions/66356/gdk-gtk-warnings-and-errors-from-the-command-line
  3. http://tools1105.rssing.com/chan-14792965/all_p238.html

Gtk-Message: Failed to load module “overlay-scrollbar”

On Ubuntu distro, if you see the error message in console as the following

Gtk-Message: Failed to load module "overlay-scrollbar"

whenever you run a Gnome-based applications, chances are you had ‘overlay-scrollbar’ package previously installed but now removed. However, the configuration file which came with that package remained on your system.

We can verify this with this command:

$ dpkg -l overlay-scrollbar
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                         Version             Architecture        Description
+++-============================-===================-===================-================
rc  overlay-scrollbar            0.2.16+r359+14.04.2 all                 Scrollbar overlay

rc : remove but config file still presents.

On my Ubuntu desktop, this config file resides at /etc/X11/Xsession.d/81overlay-scrollbar.

To correct this problem, we can purge ‘overlay-scrollbar’ package with this command:

# apt-get purge overlay-scrollbar

You would need to log out and log back in of your current X session (KDE, or Gnome) for the change to take effect.

moserial – a serial terminal for Linux

The real tag line for moserial is “a serial terminal for the GNOME desktop”. However, since it’s installed just fine on my KDE desktop, hence the name. (It probably works on servers as well.)

moserial

So what is this moserial? It’s a terminal which allows you to connect to view or send data to a serial port. For example, a lot of mbed device or micro controllers, such as Arduino, can be configured to send/receive data via serial port. Before I found out about this program, I normally open up Arduinio IDE and connect to the Arduino via Serial Monitor function. Now, I never look back after using moserial.

moserial should be available on most Linux distributions, and on Ubuntu based distros, it can be installed as easy as:

$ sudo apt-get install moserial

Puppet agent hangs after loading facts

At my current work place, we use Puppet to manage desktop machines. Recently, I need to prepare an new image based on Ubuntu 14.04 LTS.

To prepare an image, in brief, first thing is to install a fresh Ubuntu on a machine, compile and package lots of applications, and make change to configuration such as look and feels, etc. As mentioned earlier, I use Puppet to manage machine, so I store all customed configuration on the Puppet server.

While working on this image, I came across a problem with Puppet agent, the software running on each desktop. The issue is that it took very long to execute the code. Here is an example:

matht336:~# puppet agent -vt -l console
Info: Loading facts in /var/lib/puppet/lib/facter/sku.rb
Info: Loading facts in /var/lib/puppet/lib/facter/users.rb
Info: Loading facts in /var/lib/puppet/lib/facter/zid.rb
Info: Loading facts in /var/lib/puppet/lib/facter/videocard.rb
Info: Caching catalog for matht336
Info: Applying configuration version '1398116230'
Notice: Finished catalog run in 1.09 seconds

According to the above output, it only took 1.09 seconds to run the catalog. Well the truth is it took way longer than that, approximately about 20 minutes. I re-ran puppet agent with -d flag for debug, but none of the output information gave me any clues of what could possibily go wrong.

One clue that I’ve been missing and should have noticed much earlier is that puppet agent got stuck after loading the facts.

So I modified /etc/puppet/puppet.conf on the node (not the server), to not receiving custom facts from the server:

[main]
...
pluginsync=false

Then, I removed the custom facts one by one from /var/lib/puppet/facter and re-run puppet agent on the node. Suprisingly, zid.rb was the source of the puppet agent slowness. zid.rb is a fact written by my colleague to keep track of who last logged in to a machine.

I’ve been wondering why noone on the Internet has the same issue as me. At first I thought maybe Ubuntu 14.04 is too and not many people have been running puppet on it. Now I know, it the problem is unique to my environment.

So if you experience the same problem as me, I would suggest that the first thing to check out is openning up thos custom facts and see what they’re doing.

E: Internal Error, No file name for libapt-pkg4.12

When I tried to update an Ubuntu (12.04) machine with the usual apt-get command, this error message came up:

Do you want to continue [Y/n]? Y
E: Internal Error, No file name for libapt-pkg4.12

Reading this post (http://ubuntuforums.org/showthread.php?t=2045321), one way to fix it is to download liapt-pkg4.12 and re-install it:

# apt-get download libapt-pkg4.12/precise-security
# dpkg -i libapt-pkg4.12_0.8.16~exp12ubuntu10.10_amd64.deb

This seems did the trick.

បញ្ចូល C/C++ plugin (or CDT) ក្នុង Eclipse

សំណាង​ល្អ អ៊ូប៊ុនធូ មាន​កញ្ចប់មួយ​ឈ្មោះ eclipse-cdt​ ។

យើង​អាច​បញ្ចូល​វា​ដោយ ខំម៉ានដូច​នេះ

sudo apt-get install eclipse-cdt

ពេល​បើក​ Eclipse លើកក្រោយ​ ហើយ​បង្កើត project ថ្មី យើងនឹងឃើញ​ស្រដៀងនេះ

Fix: (K)ubuntu doesn’t play Audio CD

On Kubuntu 11.10, we have KsCD program installed to play audio CD. The problem I’m having is that some machines could play audio cd and some couldn’t. All machines run Kubuntu 11.10.

To fix this issue, check that /dev/cdrom is a sym link to /dev/sr0 (credit: http://www.kubuntuforums.net/archive/index.php/t-57655.html).

In my case, machines which couldn’t play audio CD don’t have ‘/dev/cdrom’:

# ls -l /dev/cd*
ls: cannot access /dev/cd*: No such file or directory

Let’s create one:

# ln -s /dev/sr0 /dev/cdrom
# ls -l /dev/cd*
lrwxrwxrwx 1 root root 8 2012-07-11 11:38 /dev/cdrom -> /dev/sr0

After this, I can play audio CD.