Youtube video doesn’t play in VirtualBox Ubuntu guest

October 25, 2016

I run 64-bit Ubuntu 16.04 as a guest OS in VirtualBox 5.1.8 on Windoiws 10.

Both Chrome and FireFox won’t playback any video on Youtube. Only a message to the effect of restarting device is shown.

I did the following to solve the problem:

  • Changed the VM Audio Controller from ICH 97 to Intel HD [link]
  • Increased the Video Memory from 16MB to the maximum, 128 MB [link]

 

Flash Redmi Note 4 ROM

October 12, 2016

The Xiaomi Redmi Note 4 mobile phone appears to offer great value for money based on its specification alone. It lacks scratch-resistant screen and stereo speakers though.

Well, I was foolish enough to order from GearBest without realizing that the set comes with a ROM intended for the Chinese market where Google is banned. In short, the phone is 90% Xiaomi and 10% Android. All apps are to be downloaded not from Google Play Store but MiStore, and the keyboard is quite insistent in wanting Chinese input despite having selected English in the phone setting. Enough reasons to force me to take drastic measures to replace the ROM to the one intended for international market at the risk of bricking my new phone. I did brick the phone once in the process of trying out various methods.

Bottom line, I succeeded with the help of plenty of indispensable advice on the web. Phew! Here’s how I did it. A Windows PC is necessary because all the software are for Windows only.

Foot note

  • The MIUI web site offers three methods of replace the ROM but both System Update and Recovery Update methods did not work for me.
  • System Update simply aborted with “Cound’t verify update package” error. I don’t know if it was because the version on the phone was 8.0.9 while the global ROM was 8.0.3.
  • The phone won’t boot into recovery mode. It displayed this instead.
  • If you live in South Africa, do not buy from GearBest unless they switch their courier service provider from ARAMEX. I paid GearBest about R3200 for the phone but ARAMEX made me paid additional R2200 for dubious custom levy and they won’t show me the official invoice.issued by the custom department.

Upgraded Windows 10 version 1511 slow

March 16, 2016

I recently (free) online-upgraded a HP ProBook 450 G2 with Intel Core i7, 16 GB RAM from OEM Windows 7 Pro to Windows 10 Pro version 1511.

With Win 7, booting up and logging in were a breeze; system ready in less than 15 seconds.

After upgrade, the same process took over 3 minutes, extremely slow both in booting to the login screen and getting desktop ready after login.😦

I googled and tried the most promising approach suggested by Joe on AskWoody but it didn’t help.

Then I noticed that my login account (carried over from the upgrade) strangely belonged to “Device Administrators” and not “Administrator”. I changed the group membership to the latter and rebooted. Voila, problem solved.

I don’t know enough about Windows to understand the underlying causes. So, your mileage may vary.🙂

Ubuntu 14.04.01 desktop kernel panic during install

January 21, 2015

I tried to install Ubuntu 14.04.1 LTS desktop from a bootable USB flash drive on a brand new PC with Intet iCore i5 processor on Asus H97M-E motherboard.

Within a minute of booting, the console displayed

drm_kms_helper: panic occurred, switching back to text console

There’re some suggestions on the net about upgrading the linux-image or BIOS, or trying different combination of advanced linux boot options.

My workaround

  1. Install using the Ubuntu server ISO instead of desktop
  2. Follow these instructions to switch from server to desktop

Bug in ubuntu 12.04 incrond 0.5.9

July 24, 2014

When you use ‘incrontab -e’ to define directories to monitor, your entries are saved in a file /var/spool/incrond/{username} where {username} is your current login user.

The bug is that the file is assigned the wrong permission (file mode) of 0600 instead of 0660.

If left uncorrected, when incrond service starts up, you will find error log entry as follows in /var/log/syslog

incrond[17723]: cannot read directory for user tables (/var/spool/incron): (13) Permission denied

Tomcat7 fails to start with empty catalina.out

March 4, 2014

A colleague asked me to investigate why his previously healthy Tomcat7 instance suddenly failed to start up silently. The usually helpful and verbose log file /var/log/tomcat7/catalina.out existed but was empty.

When this happens, check all the Tomcat and Java environment setting files specific to your installation. I.e. on Ubuntu, you will want to examine the following files:

  • /etc/default/tomcat7
  • /usr/share/tomcat7/bin/setenv.sh

Run them by hand in bash to check their sanity, e.g. dangling quotes, etc.

24 Jul 2014 update

If you have specified -Xmx or -Xms parameters in JAVA_OPTS which exceeds the RAM capacity of the server (or virtual machine), tomcat will also abort almost immediately.

 

Blank screen with a single non-blinking cursor after upgrading to Ubuntu 12.10

February 12, 2014

Using the graphical update-manager on 32-bit Ubuntu 12.04 LTS Desktop, I performed a release upgrade.

After upgrading, I rebooted the PC and got the Ubuntu splash screen and then the screen went blank with a single non-blinking cursor at the top-left corner.😦

Here is what I did to recover from it:

  1. Make sure the network cable is plugged in and access to Internet is possible
  2. In boot menu, select Advanced boot option and then select the latest kernel in recovery mode
  3. In the recovery menu, select Enable networking. This takes a couple of minutes and returns to the recovery menu.
  4. In recovery menu, select Drop to shell
  5. apt-get install –reinstall xserver-xorg-core xserver-xorg
  6. dpkg-reconfigure xserver-xorg
  7. Exit bash and return to the recovery menu, select Resume normal boot

[2015-10-13 update]

If there were pending updates for X11/xorg packages or video driver, e.g. nvidia, etc. along with some other packages e.g. nodejs, etc., bear in mind that any problem encountered by ‘apt-get upgrade’ on the other packages could prevent X11/xorg, video driver post-install tasks to complete resulting in this kind of issue.

How to sudo + rsync files

January 29, 2014

Ubuntu systems, by default, disable direct root login and require ‘sudo’ to run privileged commands, e.g. apt-get, etc.

The lack of direct root login presents an extra hurdle when one needs to non-interactively copy files to which ordinary users have no permission, e.g. /var/lib/postgresql/, etc.

This how-to is based on the following scenario:

  1. You have the login credentials of foo@bar
  2. foo@bar has unrestricted sudo privilege, i.e. a member of admin group on Ubuntu systems

The objective is to allow you to use rsync non-interactively to copy files from server bar.

  • Log in as foo@bar and run ‘sudo -s’. Keep this session open as safety precaution in case you need root privilege to undo anything.
  • Open another login session to foo@bar
  • sudo visudo
  • Review the file /etc/sudoers and append the following line to the end of the file if it is not present already. The leading ‘#’ is required. /etc/sudoers format is unconventional hence the need of ‘visudo’ to ensure you don’t accidentally lock yourself out due to a badly formatted fie
    • #includedir /etc/sudoers.d
  • Create a file, /etc/sudoers.d/99-foo containing a single line:
    • foo ALL=(ALL) NOPASSWD:ALL
  • sudo chown -R root.root /etc/sudoers.d/
  • sudo chmod -R go-rwx /etc/sudoers.d/
  • To test, start a fresh connection to foo@bar and run ‘sudo whoami’. The output should be ‘root’ without prompt for sudo password.
  • Back on your own computer (not foo@bar), create a SSH keypair if you do not have it already using ‘ssh-keygen’. Enter blank passphrase if you intend the key to be used non-interactively.
  • Assuming your SSH public key is $HOME/.ssh/id_rsa.pub, run ssh-copy-id foo@bar
  • To test, still on your own computer, ssh foo@bar. It should connect successfully without prompt for foo’s password. NOTE: If your SSH keypair is protected with a passphrase, you will be prompted to enter it.

At this point, you can ssh foo@bar using your SSH private key without the need to enter foo’s password, and you can execute any ‘sudo’ command without being prompted for password.

The final rsync command is just this:

rsync -e 'ssh -l foo' --rsync-path='sudo rsync' -av foo@bar:/var/lib/postgresql/ /postgresql-backup/

For further reading, go to this cookbook

Ubuntu 13.10 Unity compiz crashes or freezes frequently

January 3, 2014

My DELL notebook docking station comes with NVIDIA G98M video card. Since upgrading from Ubuntu 13.10 with unity desktop, I have been experiencing frequent crashes or freezing of compiz while I am working, and almost every time when I resume from the power-saving inactivity blank screen.

Other people have similar complaints about compiz but it cannot be uninstalled because it is an essential part of Unity (Ubuntu desktop). Disabling the visual effects did not help.

As a last resort, I upgraded the proprietary NVIDIA video driver from nvidia-304 to nvidia-319. Voila, problem solved.

Dash -> Software Updates -> Additional Drivers (tab)

If this doesn’t help you, check out http://wiki.compiz.org/Troubleshooting and http://askubuntu.com/questions/211458/ubuntu-12-10-crashing-compiz-unity-not-nvidia-related

Automatically start up application after login in Linux graphical desktop environment

December 18, 2013

Gnome desktop

  • gnome-session-properties

Ubuntu Unity (decorated Gnome)

  • Dash -> startup # runs gnome-session-properties

KDE desktop

  • System Settigns -> System Administration – Startup and Shutdown

On a separate note, if you want a non-interactive job to run every time the system boots up without user login, use cron. It works even in non-desktop environment.

crontab entry

@reboot /path/to/program arg1 arg2

/etc/cron.d/startup

@reboot username /path/to/program arg1 arg2