Another way to manually install VMware tools on Linux

Today I tried to install the VMware tools on a fresh new Fedora 17 VM, so I made sure that the VM CD drive was linked to a physical drive in “Auto detect” mode:

Then I started the VM and chosed the “Virtual Machine > Install VMWare tools” option from VMware player:

This standard message was then displayed:

And then… nothing ! (I was expecting the Linux file manager to automatically popup, which usually happens when the “automount” feature is activated).

So I tried to follow the instructions to manually install the tools, with no success:

[root@localhost mnt]# mkdir /mnt/mycdrom
[root@localhost mnt]# mount -t iso9660 /dev/cdrom /mnt/mycdrom
mount: no medium found on /dev/sr0

Well, if you have the same problem, then this is easy to fix since it turns out that when you choose the “Virtual Machine > Install VMWare tools” option, VMware player tries to mount the [VMWARE_PLATER_HOME]\linux.iso image. On my Windows 7 laptop, this file is located in C:\Program Files (x86)\VMware\VMware Player\linux.iso.

So all you need to do is to configure your VM so that the CD drive uses this image:

Then, stop and start the VM (rebooting didn’t work for me: I had to shutdown and restart it completely) and you should be good to go:

Laurent KUBASKI

Connecting to a Windows Shared Drive from LXDE using Gigolo

When using Ubuntu or/and GNOME, there are many ways to connect to a Windows shared drive… but how can we do this from LXDE ?

Well, you don’t need to install samba, you just need to use Gigolo:

Once Gigolo is started, it will happily sit in your taskbar: this is important to know since closing the application by clicking on the X icon will not really close it, but will put it back in the taskbar. You need to use the “File > Quit” option to correctly close it.

Using the “Help > Supported protocols” option will display the list of supported protocols. The only we are interested in is called “Windows Share (smb)”. If you don’t see it, then you need to install the gvfs-smb package using yum.

From there, click on “Connect”, choose “Windows Share” as the service type and enter your username/password/credentials:

Et voilà: just right-click on the newly established connection and choose the “Open” option to see the files in the shared drive:

If you want to re-use your connection after closing and re-opening Gigolo, you need to create a bookmark:

The next time you open Gigolo, click on the bookmark dropdown list to display the list of existing bookmarks:

Laurent KUBASKI

Adding LXDE start menu entries and desktop shortcuts

Update: this post has been viewed more than 2,000 times, but no-one left a comment. It took me 2 hours to write it and it will only take you 2 minutes to leave a comment… what are you waiting for ?

Note: if you want to instead create a new start menu section or sub-sections (ie: “sub-menus”), check this post.

First, a screenshot to explain what I mean by “desktop shortcut”, “start menu section” and “start menu sub-section” (click on the image if you want to correctly see it):

menu_3

Adding start menu entries and/or desktop shortcuts (launchers) in LXDE is certainly not as easy as under Windows.

I’ve recently installed the cool hardinfo tool which is an application that lists all your computer hardware. Unfortunately, the hardfo installer doesn’t add any menu entry in the LXDE start menu (I’m talking about the one that is displayed when you click on the button located at the bottom left of your desktop).

OK, let’s add a menu entry for hardinfo by ourselves.

1. Adding a new menu entry

All menu entries correspond to a .desktop file, and these .desktop files can be in one of the following locations:

  • /usr/share/applications
  • /usr/local/share/applications
  • ~/.local/share/applications (note that this folder may not exist on a brand new LXDE installation, but you can create it manually)
[laurent@localhost applications]$ ll /usr/share/applications
total 460
-rw-r--r--. 1 root root  9693 Feb 18 20:18 authconfig.desktop
-rw-r--r--. 1 root root   177 Apr 20 05:11 eekboard.desktop
-rw-r--r--. 1 root root  1699 Feb 27 22:31 fedora-abiword.desktop
-rw-r--r--. 1 root root  6001 May 10 15:07 fedora-abrt.desktop

Creating a new menu entry simply means creating a new .desktop file. The format is detailed here or there, but you can choose to use the existing .desktop files that you have as a template.

Since .desktop files can be located in 3 different folders, which one should you use ? I suggest that you create your .desktop file in the ~/.local/share/applications folder. This way, the shortcuts that you create will not impact other users.

LXDE ships with a .desktop file editor called LXShortcut. It’s the application that is launched when you right click on a menu entry and choose the “Properties” option:

However, I think that this tool sucks for creating new menu entries. Here is why:

  • There is no way to create a .desktop file from the LXShortcut GUI: you need to specify the filename on the command line (“-o” option)
  • It uses different command line options to create (-o) and to edit (-i) .desktop files.
  • There is no way to edit the category name (ie: “where the entry is going to be located in the menu”).

For all these reasons, it’s just easier to use a text editor to create your .desktop file.

Here is mine:

[laurent@localhost applications]$ cat ~/.local/share/applications/hardinfo.desktop

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Hardware info
Name[en_US]=Hardware info
Exec=/usr/bin/hardinfo
Comment[en_US]=Hardware info
StartupNotify=true

As you can see, the ‘Exec’ property contains the location of the ‘hardinfo’ application.

Now launch “lxpanelctl restart” so that LXDE picks up your changes:

[laurent@localhost applications]$ lxpanelctl restart

Et voilà:

By default, your new menu entry is part of the ‘Other’ category.

What if you want to put in another category ? That’s where the ‘Categories’ property comes into play: valid values for this property are listed here.

Note that the ‘freedesktop’ categories do not directly map to the LXDE category names, so here is the mapping between LXDE categories and freedesktop categories:

  • Accessories <-> Utility
  • Graphics <-> Graphics
  • Internet <-> Network
  • Office <-> Office
  • Sound & Video <-> AudioVideo
  • System Tools <-> System

So if you want your shortcut to be part of the LXDE ‘Accessories’ category, you need to add the ‘Categories=Utility’ property:

[laurent@localhost applications]$ cat ~/.local/share/applications/hardinfo.desktop

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Hardware info
Name[en_US]=Hardware info
Exec=/usr/bin/hardinfo
Comment[en_US]=Hardware info
StartupNotify=true
Categories=Utility

2. Adding an application shortcut on your desktop

To add a shortcut on your desktop, right click on an existing menu entry and choose the ‘Add to desktop’ option.

In practice, this simply puts a copy of an existing .desktop file in the $HOME/Desktop folder:

[laurent@localhost ~]$ ll $HOME/Desktop
total 4
-rw-------. 1 laurent laurent 165 Jun 28 17:53 hardinfo.desktop

This means that if you want to create a desktop shortcut for an application that is not in your start menu, you just need to create a .desktop file in $HOME/desktop, as explained in the previous chapter.

Alternatively, you can right-click anywhere on your desktop and choose the “Shortcut” option: this will launch the “LXShortcut” tool.

3. Adding a folder shortcut on your desktop

This time, right clicking on your desktop and choosing “Create new > Shortcut” will not work since this can only be used to create application shortcut.

To create a folder shortcut, you need to manually create a .desktop file in the ~/Desktop folder.

For example, a shortcut for the /home/laurent/Documents folder would look like this:


[laurent@localhost Desktop]$ cat ~/Desktop/myOtherShortcut.desktop

[Desktop Entry]
Encoding=UTF-8
Type=Application
Icon=system-file-manager
Name=My Folder Shortcut
Exec=pcmanfm /home/laurent/Documents

Comment[en_US]=

Basically, we are are just asking pcmanfm to open the “/home/laurent/Documents” folder. Also, I’m using the pcmanfm “system-file-manager” icon, but you can choose to use any icon that you want.

3. Changing the shorcut icon

OK, one more LXDE madness: it looks like the icons can either be located in /usr/share/pixmaps or in /usr/share/icons.

I guess I need to study this and create a new post… stay tuned 😉

Laurent KUBASKI

Compiling glib on CentOS

Do you get this error message while compiling glib on CentOS ?

checking for LIBFFI... no
configure: error: Package requirements (libffi >= 3.0.0) were not met:

No package 'libffi' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

First, let’s check if libffi is installed:

[laurent@new-host]/usr/lib/pkgconfig> rpm -qa | grep libffi
libffi-3.0.5-3.2.el6.i686

[laurent@new-host]/> sudo find . -name *libffi*
./usr/share/doc/libffi-3.0.5
./usr/lib/libffi.so.5
./usr/lib/libffi.so.5.0.6
./var/lib/yum/yumdb/l/61825035e703e1d6d36e2c2f67e195b58eaf7475-libffi-3.0.5-3.2.el6-i686

OK, it is installed, so this certainly means that pkg-config doesn’t know about it. For more information concerning pkg-config, check this link.

 

[laurent@new-host]/usr/lib/pkgconfig> pkg-config --print-errors libffi
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found

OK: why am I missing the /usr/lib/pkgconfig/libffi.pc file ?

That’s because it’s part of the ‘libffi-devel’ package that is not installed by default !

Install it using yum and you’ll get everything you need:

[laurent@new-host]/usr/lib/pkgconfig> rpm -ql libffi-devel-3.0.5-3.2.el6.i686
/usr/lib/libffi-3.0.5
/usr/lib/libffi-3.0.5/include
/usr/lib/libffi-3.0.5/include/ffi.h
/usr/lib/libffi-3.0.5/include/ffitarget.h
/usr/lib/libffi.so
/usr/lib/pkgconfig/libffi.pc
/usr/share/info/libffi.info.gz
/usr/share/man/man3/ffi.3.gz
/usr/share/man/man3/ffi_call.3.gz
/usr/share/man/man3/ffi_prep_cif.3.gz

Laurent KUBASKI

Listing a Yum package content

First, let’s check if glib2 is installed:

[laurent@new-host]/usr/lib> yum list installed | grep glib2
glib2.i686 2.22.5-6.el6 @base/$releasever

OK, now what is the exact RPM package name for glib2 ?

[laurent@new-host]/usr/lib> rpm -qa | grep glib2
glib2-2.22.5-6.el6.i686

Great, let’s now see what is inside this RPM package:

[laurent@new-host]/usr/lib> rpm -ql glib2-2.22.5-6.el6.i686
/etc/profile.d/glib2.csh
/etc/profile.d/glib2.sh
/lib/libgio-2.0.so.0
/lib/libgio-2.0.so.0.2200.5
/lib/libglib-2.0.so.0
/lib/libglib-2.0.so.0.2200.5
/lib/libgmodule-2.0.so.0
/lib/libgmodule-2.0.so.0.2200.5
/lib/libgobject-2.0.so.0
/lib/libgobject-2.0.so.0.2200.5
/lib/libgthread-2.0.so.0
/lib/libgthread-2.0.so.0.2200.5
...

Laurent KUBASKI

Fixing the “non appearing files” issue when sharing files with SAMBA on CentOS

OK, I easily lost 8 hours trying to fix this issue:

  • installed SAMBA on CentOS
  • correctly configured smb.conf (security=user, writable=yes)
  • created a user account and declared it using smbpasswd
  • made sure that this user had full read/write access to the shared folder
  • made sure that the firewall was allowing SAMBA traffic

Then, from a Windows 7 PC, I used the ‘Map network drive” option, connected to my SAMBA shared drive, entered my SAMBA user name and password… and then what ?

  • only read-only access to the shared drive
  • only folders were visible, no files whatsoever

Do you know why ? Because SELinux is activated by default on CentOS.

To check if this is the case for you, use the ‘sestatus’ command: if you get an ‘enabled’ result, then you may want to disable it by following the procedure detailed here.

Laurent KUBASKI

Installing Gnome on CentOS and make it launch at boot


First install Gnome (use ALT F2 to switch to the shell if needed and 'loadkeys fr' if you want to change the default keyboard locale) : yum groupinstall "GNOME Desktop Environment"

Alternatively, do a 'yum grouplist' to see the list of groups and run for example 'yum groupinstall Desktop'

Then run 'startx' to make sure it starts.
Then edit /etc/inittab and replace the last line with id:5:initdefault:

Laurent KUBASKI