Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Wednesday, November 28, 2018

Installing pdftk in Ubuntu 18.04 Bionic

The pdftk package is reported missing from Ubuntu 18.04 Bionic. To me, the easiest way to install it out of a few suggested methods is as follows,



sudo snap install pdftk


Read more about snap here.

Tuesday, March 6, 2018

Old Bug in open-vm-tools and Git Commit Problem.

There is a known bug in open-vm-tools that can interference with a number of applications when we operate on a vmhgfs-fuse file system. This bug is documented as issue #90, and there are a few other discussion about this, in particular, a discussion on how to install recent release of open-vm-tools on Ubuntu 16.04 LTS since Ubuntu 16.04 LTS at this moment still ships open-vm-tools version 10.0.7 that carries this bug.

You may check your open-vm-tools version with one of many methods, such as,

vmware-toolbox-cmd -v

or

apt-show-versions open-vm-tools

If the output indicates that you have a version of earlier than 10.1.0, your version of open-vm-tools may have this bug. It causes serious problems in a few rather frequently used applications. In my case, when I use do a git commit, I would observe the following,

$ git commit -m "done something trivial"
error: bad index file sha1 signature
fatal: index file corrupt

After 5 seconds, when I try it again, the git commit is successful. As discussed in issue #90, this is the result that the tools cache file attributes and entries and causes a cache inconsistency. The 5-second delay is the waiting time before the cached items get updated.

Some also observed that this bug causes the npm install to fail.

Perhaps, the more important issue is how we may address this issue before the Linux distributors have a new version of the tools for us to upgrade to. Suggested in the discussions cited is to use a Ubuntu test PPA repository since it does not appear to be problem-free to build the tools from the source. The steps to install from the test PPA are as follows,


sudo add-apt-repository ppa:ci-train-ppa-service/3152
sudo apt-get update
sudo apt-get upgrade open-vm-tools open-vm-tools-desktop open-vm-tools-dkms

In my case, these steps lead to the successful installation of the open-vm-tools version 10.2.0.1608 (build-7253323), and it seems to work fine although some seem to observe some issues, such as, a race condition.

Monday, November 7, 2016

VMWare Unity Mode on Ubuntu 16.04 LTS

Some users want to run Linux desktop guests  "seamlessly" within host operating systems, for which, VMWare Hypervisors  provides a functionality called VMware "Unity" mode.

This post is about how we can enable the Unity mode on Linux desktop guests running Ubuntu 16.04,  well, if you are willing to settle on an older version of WMware Workstation or Player.

In fact,  it becomes difficult to enable the "Unity" mode for Linux guests. If you visit my older post on enabling VMware Unity mode on Ubuntu 14.04, you can see many have encountered difficulties, myself included.  In particular, it is getting more difficult to enable the Unity mode on recent releases of desktop editions of Linux distributions. In my opinion, the difficulties come form the following three sources,

  • Apparently, VMWare has recently dropped the support of Unity mode for Linux guests. You can infer this by comparing the documentation of VMware Workstation Player 12 with that of the previous version of the player, the VMware Player 7. VMware's Workstation Player 12 documentation now states,
    "
    Use Unity Mode
    You can switch virtual machines that have Windows XP or later guest operating systems to Unity mode to display applications directly on the host system desktop.
    "
    On the contrary, VMware Player 7 documentation states,
    "
    Use Unity Mode
    You can switch virtual machines that have Linux or Windows 2000 or later guest operating systems to Unity mode to display applications directly on the host system desktop.
    "
    It is clearly that Linux support has been dropped.

  • Unity mode requires MetaCity or KDE,  which does not appear to be the default and optimization objective for major Linux distributions.

  • VMWare Unity mode's installation software does not know how to interact with systemd that has gradually becomes the default choice of the init service on most Linux distributions.

However, having observed the above, we actually have a solution.
  • Hypervisor. We need to stick to the version of VMware Workstation or Player that supports the Unity mode. The newest version of Player that supports the Unity mode is actually VMWare Player 7.1.4. You can download it from VMware

  • Linux Guest Dekstop  Environment. We need to stick to Gnome 2 MetaCity or KDE. 

For Ubuntu 16.04, we can enable Unity mode using VMware Player  by following the steps below,
  • Download and install VMware Player 7.1.4. Note that neither any version older than 7.1.4 nor any version newer than VMware Player, such as VMware Workstation 12 will work.

  • In Ubuntu 16.04, install Gnome Flashback as follows,
    
    sudo apt-get install gnome-flashback gnome-session-flashback
    

  • From the menu of VMware Player, choose "Player", "Manage", and "Install VMware Tools" (or Reinstall VMware Tools"). Make sure that you are installing VMwareTools 9.9.5. Earlier version would crash the vmtools library at the Ubuntu guest when you attempt to switch to Unity mode.

  • In the Ubuntu Linux guest, extract the mounted VMwareTools image, and run "vmware-install.pl" to install the VMware Tools.

  • Upon successfully installation of the VMware Tools, log out.
  • When you log in, on the screen of the Display Manager, make sure that you select "GNOME Flashback (Metacity)" as shown below.


  • Upon log in, you should be able to switch to the VMware Unity mode.


Saturday, November 5, 2016

Setting up Jekyll on Ubuntu 16.04

I recently set up Jekyll 3 on Ubuntu 16.04. The procedure is simple, works on Ubuntu 14.04, and perhaps also works on other versions of Ubuntu and other Linux distributions.


  1. Create a directory for your Jekyll site. For instance, let us call it "mysite".
    
           mkdir mysite
        
  2. Go to the site directory, and create a file called "Gemfile". The file defines Ruby applications dependencies. Since Jekyll is a Ruby application. This file defines the dependencies for Jekyll. It is quite simple, and the following shell command will create the file with sufficient content.
    
           cd mysite
           echo "source 'https://rubygems.org'" > Gemfile
           echo "gem 'execjs'" >> Gemfile
           echo "gem 'therubyracer'" >> Gemfile
           echo "gem 'github-pages', group: :jekyll_plugins" >> Gemfile
        
  3. Now install Ruby and other necessary packages.
    
           sudo apt-get install ruby ruby-dev ruby-bundler zlib1g-dev build-essential
        


  4. Finally, install Jekyll and its dependencies. On the site directory where Gemfile is, do the following,
    
           bundle install
        
  5. To build the Jekyll site, do the following on the site directory,
    
           bundle exec jekyll build
        
  6. You can serve the site by the following command,
    
           bundle exec jekyll serve --host=127.0.0.1 --port=4000
        

Friday, November 4, 2016

Installing Ruby 2.3 on Ubuntu 14.04 or Older

Ubuntu 14.04 comes with the version 1.9 of Ruby. I need a new version of Ruby. To install any version of 2.0 - 2.3, we can use the brightbox repository as follows,

$ sudo apt-add-repository ppa:brightbox/ruby-ng
$ sudo apt-get update
$ sudo apt-get install ruby2.3  # or ruby2.2
$ sudo apt-get install ruby2.3-dev 

Monday, September 5, 2016

Switching Back to Upstart on Ubuntu 16.04 LTS

Ubuntu 16.04 LTS has adopted systemd as its default system and service manager, i.e., the init manager. Although systemd offers many benefits, such as, aggressively starting services concurrently, you may sometimes want to switch back to upstart, the older system and service manager for Ubuntu because some services that you still have to run depend on it. Below are the steps that you can play with to switch to back upstart. However, since Ubuntu 16.04 is now designed with systemd as default system and service manager, many other services and applications are not designed to work without systemd. As a result, the following steps, as a few readers have noticed, may render your Ubuntu installation unusable. To run a Linux system without using systemd, the best approach is, to select and set up a Linux distribution that does not rely on systemd. See the Without-Systemd Wiki for more information and a list of Linux distributions.

  1. Install upstart-sysv and remove systemd-sysv.
    
    sudo apt-get install upstart-sysv
    

  2. Update Ubuntu to reflect the change that you just made.
    
    sudo update-initramfs -u
    

  3. Now you need to remove a few remaining systemd package in the system. This step removes package including libpam-systemd.
    
    sudo apt-get purge systemd
    

    If you do not perform this step, you will see an error message as follows after you reboot the system and log back in.
    
    [   26.664057] systemd-logind[4445]: Failed to start user service, ignoring: Unknown unit: user@1000.service
    

  4. Now reboot and log back in. You should see your system with a clean bill of health with upstartd back at the helm.

Friday, August 5, 2016

Installing Adobe Reader in Ubuntu 16.04 LTS

For those who like Adobe Reader to read PDF files, you may find it difficult to install Adobe Reader on Ubuntu 16.04 LTS systems. Assembling information from a few posts, here is the solution that worked for me,
 

sudo apt-get clean all
sudo add-apt-repository "deb http://archive.canonical.com/ precise partner"
sudo apt-get update
sudo apt-get install adobereader-enu
sudo add-apt-repository -r "deb http://archive.canonical.com/ precise partner"
sudo apt-get clean all
sudo apt-get update

If you are on a x64 system, you may see many annoying warning messages when you run acroreader, such as,

......
(acroread:19366): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",
......
Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "gail"
Gtk-Message: Failed to load module "atk-bridge"


To get rid of the warning messages, install these four packages gtk2-engines-murrine, libcanberra-gtk-module, libatk-adaptor, and libgail-commonfor i386 as follows,

sudo apt-get install gtk2-engines-murrine:i386 libcanberra-gtk-module:i386 libatk-adaptor:i386 libgail-common:i386

If you are running Gnome like I do, then the last step is to set up default application for open PDF files. This is to edit the /etc/gnome/defaults.list file.

sudo gedit /etc/gnome/defaults.list
The editing is to find and replace the line

application/pdf=evince.desktop

by

application/pdf=acroread.desktop
and add the following lines to the end of the file,

application/fdf=acroread.desktop
application/xdp=acroread.desktop
application/xfdf=acroread.desktop
application/pdx=acroread.desktop

Finally, run nautilus to apply change if you do not wish to log out and log back in.

nautilus -q


Tuesday, February 24, 2015

Installing lineno.sty in Ubuntu and Fedora Linux

When we prepare a document using LaTeX, sometimes we want to include line numbers in an article. In many peer reviewed journals, it is a requirement to include line numbers in the output.

For instance, Elsevier LaTeX instructions has a LaTeX template whose LaTeX template file starts with

\documentclass[review]{elsarticle}

\usepackage{lineno,hyperref}

You system has not had the lineno package installed, if you encounter the following error when you compile your LaTex file that uses package lineno,

! LaTeX Error: File `lineno.sty' not found.

Type X to quit or  to proceed,
or enter new name. (Default extension: sty)

Enter file name:

Although you can download and install it from CTAN, you may be better off by installing the appropriate package provided by your system and let your system manage it. For instance, on Ubuntu Linux, we can install the textlive-humanities package,

sudo apt-get install texlive-humanities

For instance, on Fedora Linux, we can install the texlive-collection-humanities package,

sudo yum install texlive-collection-humanities 

The solution comes from the posts at here and here.

Friday, October 3, 2014

Querying Package Status in Linux Systems

I am interested in querying the status of packages on Linux systems. Of course, you can query the status using a number of GUI applications, such as, the "Synaptic Package Manager" on Ubuntu Linux and "GNOME Software" on Federa Linux. However, I am more interested a command line approach.

For Linux systems using APT, such as, Ubuntu Linux, we can use the utilities that comes with APT, for instance, use dpkg-query, as pointed out in this post. In addition, this post gives a few more elaborated queries.

Here are a few examples.
  • To query if a package is installed, i.e, to report status of specified package,

    
    $ dpkg-query -s gnome-shell
    dpkg-query: package 'gnome-shell' is not installed and no information is available
    ......
    

    
    $ dpkg -s gnome-session-flashback
    Package: gnome-session-flashback
    Status: install ok installed
    ......
     
  • To List packages matching given pattern,
    
    $ dpkg-query -l gnome-shell
    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
    +++-==============-============-============-=================================
    un  gnome-shell    <none>       <none>       (no description available)
    
    
    $ dpkg-query -l gnome-session-flashback
    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
    +++-==============-============-============-=================================
    ii  gnome-session- 1:3.8.0-1ubu all          GNOME Session Manager - GNOME Fla
    
    
    $ dpkg-query -l gnome*
    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
    +++-==============-============-============-=================================
    un  gnome          <none>       <none>       (no description available)
    ii  gnome-accessib 3.10.0-1ubun all          Accessibility themes for the GNOM
    ii  gnome-applets  3.5.92-0ubun i386         Various applets for the GNOME pan
    ......
    
For Linux systems using RPM, such as, Fedora Linux, we can use yum and rpm. These two pages, on yum and on rpm respectively provide a few good examples of the two.

Thursday, September 18, 2014

Creating Small Footprint Linux Virtual Machine

Although it may be easier to download a Linux virtual appliance, it can be fun to create linux virtual machines yourself. In particular, we may be interested in creating small footprint Linux virtual machines -- it would be easy to put it on a USB drive or let other people to download it. This post documents the process that I use to create Ubuntu 14.04 (Trusty) Linux virtual machines and reduce the image size of the virtual machines. The key idea is (1) to remove non-essential packages as much as possible; (2) to increase the compression of virtual machine images by zeroing virtual disks; and (3) to compact and compress the virtual machine image.
  1. Download 32-bit Ubuntu 14.04 (Trusty) ISO file and install it as a guest operating system under VMware Player or VirtualBox.  
  2. To make copy & paste instructions easier, install VMware Tools.  
    1. Install Linux headers and the build essential packages

      sudo apt-get install linux-headers-generic build-essential

    2. Then install VMware Tools
    3. Restart the virtual machine.
  3. By default, Ubuntu 14.04 runs the Ubuntu Unity desktop environment. It prevents us from entering the VMware Unity mode. I now get rid of the Ubuntu Unity desktop environment. I learned the command from this post.
    
    sudo apt-get purge \
         unity unity-common unity-services \
         unity-lens-\* unity-scope-\* unity-webapps-\* \
         gnome-control-center-unity \
         hud libunity-core-6\* libunity-misc4 \
         libunity-webapps\* appmenu-gtk \
         appmenu-gtk3 appmenu-qt\* overlay-scrollbar\* \
         activity-log-manager-control-center \
         firefox-globalmenu thunderbird-globalmenu \
         libufe-xidgetter0 xul-ext-unity \
         xul-ext-webaccounts webaccounts-extension-common \
         xul-ext-websites-integration \
         gnome-control-center gnome-session

  4. Then, install GNOME 3.
    
    sudo apt-get install gnome-session-fallback
    

  5. Now, remove the default games.
    
    sudo apt-get game\* purge ace-of-penguins gnome-mahjongg gnome-mines \
                 berusky biniax2 gnurobbo groundhog gtkballs hitori \
                 four-in-a-row gnect gbrainy gnome-sudoku chess\* \
                 nibbles\* solitaire\* iagno\* klotski\* tetravex\* \
                 drascula gtkboard oneisenough openyahtzee ri-li \
                 scribble swell-foop quadrapassel\* lightsoff \
                 five-or-more gnome-robots gtali
    

  6. Remove a few network applications.
    
    sudo apt-get purge webbrowser-app thunderbird\*
    

  7. Remove Libre Office. This can save a few hundred megabytes.
    
    sudo apt-get purge libreoffice\*
    

  8. Now get rid of the "Ubuntu Software Center".
    
    sudo apt-get purge software-center\*
    

  9. The /var/cache directory can easily have a few hundred megabytes data. We can trim it down.
    
    sudo apt-get clean
    

  10. Do an automove,
    
    sudo apt-get autoremove
    

  11. Now remove GNOME and Ubuntu documentation.
    
      sudo apt-get purge yelp\*
      

  12. Now, you can install whatever important software you want to include in the virtual machine, e.g., I am installing Octave,

    
    sudo apt-get install octave
    

  13. We would probably want to compress the virtual machine image before we pass it to someone. We need to replace every byte of free space on the disk by 0's.
    
    dd if=/dev/zero of=zerofile; \
       sleep 5; sync; \
       sleep 5; sync; \
       sleep 5; sync; \
       rm -f zerofile;
    

  14. I am using VMware Player. Using it, I do a "defragment" and then "compact" the virtual disk. The guest system must be off before you can do it. Of course, you can do the same using VirtualBox.
  15. Finally, I compress the folder of the virtual machine. The zip archieve file is about 1 GB. 
In addition, you may save a few megabytes, by removing all log and temporary files. The tool bleachbit can help. Before you zero the hard disk, install and run the tool.


sudo apt-get install bleachbit; sudo bleachbit

Sunday, September 7, 2014

Ubuntu 14.04 (Trusty) and VMWare Unity Mode

Unity mode is a nice feature of VMWare's virtualization software. However, you will find that you cannot switch to VMWare Unity mode once you install the most recent release of Ubuntu including Ubuntu 14.04 (Trusty) and its predecessor (Ubuntu 13.10 or Saucy).

It turns out that VMWare does not like Ubuntu's default desktop environment called Ubuntu Unity. It could be confusing that the Ubuntu Unity desktop environment and the VMWare Unity mode share the same word "Unity", and it has created a difficulty  for us who try to find an answer  on the web since depending on what search terms you enter, web searches can give you answers related to both and it becomes a diffcult task to find a solution that may help you.

Since VMWare cannot switch to Unity mode is a result that VMWare does not like Ubuntu's default desktop environment called Ubuntu Unity, the solution becomes to find a Desktop Environment that VMWare can work with.

On Ubuntu 13.10 (Saucy), I found that Gnome 3 works with the VMWare Unity mode. Therefore, the solution is to install Gnome 3 and to use Gnome 3. To install Gnome 3, you may issue command below,
sudo apt-get update; sudo apt-get install gnome-session-fallback

I have been happily running Ubuntu 13.10 (Sauncy) as a guest operating system and using it in VMWare Unity mode for a quite while, well, until I upgrade it to Ubuntu 14.04 (Trusty). What is the problem? I checked the versions of Gnome 3 before and after the upgrade from Ubuntu 13.10 (Sauncy) to Ubuntu 14.04 (Trusty), they are the same,

$ gnome-session --version
gnome-session 3.9.90

I believe that it is still the issue with the Desktop environment that Ubuntu is running -- not VMWare tries not to support such a feature. Then, the task is to find out which desktop environment works with the VMWare Unity mode on Ubuntu 14.04 (Trusty). I found the list of Desktop environments that I may try from this post, 
I did not try all of them. However, I am happily to report that the following Desktop environments that work with VMWare Unity mode on Ubuntu 14.04 (Trusty),

  • Xfce
    To install it. Run
          sudo apt-get install xfce4
      
    or if you want more bells & whitsles, 
          apt-get install xubuntu-desktop
          
  • LXDE
    To install it. Run
          sudo apt-get install lxde
      
    or if you want the full desktop environment,
          apt-get install lubuntu-desktop
          
  • Mate
    To install it. Run
    sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
    sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install --no-install-recommends \
                        ubuntu-mate-core ubuntu-mate-desktop
    
    At this point, you can switch to VMware Unity mode. However, the application menu of the VMWare Unity mode is empty. This is the result that the VMware tools at present only recognoizes three desktop environments, Gnome, KDE, and Xfce -- if you run vmware-xdg-detect-de in your Ubuntu guest, you will see that the output of the script is empty. I made one minor change to the script,  and the VMWare Unity mode menu appeared. Below is the diff result on the script before and after the revision.
    diff \
      /usr/bin/vmware-xdg-detect-de \
      $HOME/vmware-tools-distrib/lib/bin32/vmware-xdg-detect-de
    63,67d62
    <   elif `dbus-send --print-reply --dest=org.freedesktop.DBus \
    <       /org/freedesktop/DBus \
    <       org.freedesktop.DBus.GetNameOwner \
    <       string:org.mate.SessionManager > /dev/null 2>&1` ; \
    <       then DE=gnome; # pretent to be gnome
    

    The complete script is at GitHub.
  • GNOME Flashback/Fallback

    As described before, to install it, run,
    sudo apt-get update; sudo apt-get install gnome-session-fallback
        
    Initially, I thought GNOME Flashback/Fallback stopped working with VMware Unity mode on Ubuntu 14.04. However, once I investigated further, I discovered that Ubuntu 14.04 reports the value of environmental variable XDG_CURRENT_DESKTOP as Unity. The solution is still to let vmware-xdg-detect-de return gnome. What I did is shown in this diff result,
    diff /usr/bin/vmware-xdg-detect-de \
         $HOME/vmware-tools-distrib/lib/bin32/vmware-xdg-detect-de
    58,60d57
    < DE=gnome
    < xdgDE=gnome
    

    The complete script using the approach described above (although not identical) is at GitHub. It is worth noting that when I manually set the environmental variable to GNOME in the user profile, e.g., adding the following line to $HOME/.profile, VMware Unity mode remains NOT working. 
    export XDG_CURRENT_DESKTOP=GNOME
    
    It begins to work only after I made the revision to vmware-xdg-detect-de as described above.

    A new problem I have encountered is that once VMware enters the Unity mode, in some of my Ubuntu virtual machines, the application menu is empty -- if you always launch programs from command line, it may not be too much of a problem. A further investigation indicates that this problem only occurs on the Ubuntu virtual machines that are upgraded from previous revision. I reinstalled the gnome-session-flashback and the problem went away. To reinstall the package, do,
    
    sudo apt-get install --reinstall gnome-session-flashback
    

    Just be aware that when you have GNOME Flashback/Fallback installed, you will have two options on the login screen, "GNOME Flashback (compwiz)" and "GNOME Flashback (metacity)". VMware Unity mode only works with the latter. In fact, VMware lists "a modern version of Metacity or KDE" as a prerequist to use the Unity mode on its website.

To conclude, below is what I have tried.


Testing Result of Desktop Environment for VMWare Unity Mode on Ubuntu 14.04 (Trusty)
Desktop EnvironmentDisplay Name in Login ScreenVMWare Unity Mode Works?
Ubuntu UnityUbuntu DefaultNo
GNOME 3GNOMENo
GNOME 3GNOME Flashback (Compwiz)No
GNOME 3GNOME Flashback (Metacity)Yes (See the note on Gnome above and
download vmware-xdg-detect-de)
XfceXfceYes
XfceXUbuntuYes
LXDELXDEYes
LXDELUbuntuYes
MateMateYes (See the note on Mate above and
download vmware-xdg-detect-de)
AwesomeAwesomeNo

However, if you try a different desktop envionment on Ubuntu 14.04 (Trusty) and it works or does not work with the VMWare Unity mode, please share it with me. I will update this post to include your result.


Thursday, January 30, 2014

Default Desktop Crashes in Ubuntu 13.10 (Saucy) as a VM VirtualBox Guest

I created a guest instance using Ubuntu 13.10 (Saucy) in Oracle VM VirtualBox. When I log in using the default Ubuntu Desktop environment, what I got was a nearly blackscreen after a "compiz crashed" message. My suspicion was that the video card is too  primitive and did not have a reasonable OpenGL support.

To fix the issue, I installed Gnome desktop and logged without any problem in using the Gnome Desktop environment. Since the default desktop environment crashes and I could not get a terminal window to do anything, I had to exit to the console to do the installation. The steps are as follows,


1. Press CTRL-ALT-F1 to switch to the console screen
2. Log in on the console screen
3. Install Gnome desktop environment, by running
         $ sudo apt-get install gnome
4. Kill and restart X or simply reboot the machine, by running
         $ sudo reboot
5. When the Graphical Login screen appears, click on the little
   icon to the right of the user name, and choose any of Gnome
   desktop environment, (Gnome Classic, Gnome Classic ...)
6. Then log in. 
You should be in without any problem.

Monday, December 9, 2013

VMWare Tools Failed to Load on Ubuntu 13.10 (Saucy)

I am running a Ubuntu guest OS using VMWare Player. I upgraded my guest Ubuntu to Ubuntu 13.10 through "do-release-upgrade" and upgraded my VMWare player to 6.01. When I was upgrading the VMWare Tools, I encountered a problem that the VMWare Tools cannot be loaded. I did a quite a few web searches and many suggested to disable the vmware-tools-thinprint service. On my guest, it did not help by disabling the vmware-tools-thinprint service. What actually helped was to upgrade vmxnet to vmxnet3, which can be accomplished by directly editing the virtual machine's configuration file. To edit the configuration file, in my case the Ubuntu.vmx file, add a line to the file, e.g.,


ethernet0.virtualDev = "vmxnet3"


The solution was hinted by the error message when I ran vmware-install.pl,


The vmxnet driver is no longer supported on kernels 3.3 and greater. Please 
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)

In some case, as indicated by the comment below, you may also need to uninstall (by running vmware-uninstall-tools.pl that should have been installed, by default at the /usr/bin directory) and reinstall VMWare tools.

Wednesday, October 23, 2013

Remove Old Linux Kernel Images in Ubuntu from Command Line

As you upgrade your Ubuntu Linux, the number of different versions of Linux kernel images grow. The Linux kernel images can occupy quite some disk space. Your /boot file system may be short of space for future upgrades of Linux kernels. It may look for a method to remove the old Linux kernel images. The following discussion suggests that we remove old kernel images using "Synaptic Package Manager",


However, it requires a graphical user interface. I am more interested in removing the old Linux kernel images using command line tools only, as sometimes, I simply do not have the luxury of running a GUI. However, the discussion above indeed a good guide. I simply follow the steps below,

  1. Find the versions of Linux kernel images and their packages.

    You may first list the content of the /boot directory, which gives you an idea what kernel images are installed. Then you can use dpkg to find out the package names. Here is an example,
    userfoo@ubuntu:~$ dpkg -l | grep linux | grep 3.0
    ii linux-image-3.0.0-12-generic 3.0.0-12.20 i386 Linux kernel image for version 3.0.0 on x86/x86_64
    userfoo@ubuntu:~$

    In the above, I am looking for "3.0" because I figured from listing the content of the /boot directory that I have a Linux image of version of 3.0.0 installed. The above tells me that the corresponding package of the Linux image is "linux-image-3.0.0-12-generic".
  2. Remove the Linux image package.

    I remove the above Linux image package using apt-get.
    userfoo@ubuntu:~$ sudo apt-get remove linux-image-3.0.0-12-generic
Repeat the above steps for other versions of old Linux images. Typically, as suggested by many other people, you want to keep at least one or two old Linux image to fall back on in case there is an issue with your newest Linux kernel image.

Similar method can be applied to CentOS and Fedora Linux. You can accomplish it using yum alone.