VirtualBox 3.0.2 released!

VirtualBox 3.0.2 has been released. This is a maintenance release, but it solves a lot of problems. For example, 3D accleration works way better now if you have Desktop Effects enabled. A definite recommended upgrade.

How to install a Dynamic DNS client for Fedora Linux

Many people use dynamic dns for different purposes. I use it to give my home machine a public presence. I choose DynDNS for my needs. Its a leader in this segment and have been around for a long time.

First, you’ll need to register for a free account at their site. Once you’ve chosen a domain name and setup your details, you’ll need a dynamic dns client to update your IP, which probably changes every time you sign on to your ISP.

I use inadyn, a free dynamic dns update client that works in linux.

The Inadyn package name is inadyn-mt. Install inadyn using yum:

yum install inadyn-mt

Then edit the /etc/inadyn.conf file with your details.

Then turn on the service.

service inadyn start

Check /var/log/messages. you should get some entires showing whether you edited the config file properly, and the update was successful.

Jul 10 22:50:43 atom INADYN[8251]: Fri Jul 10 22:50:43 2009: I:INADYN: Alias 'your-hostname.dyndns.org' to IP '12.34.56.78' updated successfully.

Once you know the client works, dont forget to turn it on permanently on startup.

chkconfig inadyn on

How to enable the Windows Key in Linux

After installing Fedora, or most linuxes, you may realise that the Windows key that you used during the unenlightened days doesnt work anymore. Even worse, you cannot seem to use it as part of you Keyboard shortcuts. Gives some weird irony when reading about Dead Keys.

Enabling the Windows Key is easy, Just go to System -> Preferences -> Keyboard.

You will get the Keyboard Preferences window up. Choose the Layouts tab.

The Keyboard type used

The Keyboard type used

Then choose Layout Options. A new Keyboard Layout Options window comes out.

Keyboard Layout Options

Keyboard Layout Options

Expand the Alt/Win Key Behavior menu, and choose Super is mapped to Win Keys Then close all the menus. You know have a functional Windows key.

Choose the Super is mapped to Win Keys

Choose the Super is mapped to Win Keys

You can now assign shortcuts using the Keyboard Shortcuts menu. In this screenshot, I assigned Windows key + R to opening a new terminal.

A Sample Shortcut Using the Windows Key

A Sample Shortcut Using the Windows Key

Pretty handy for me. I’m sure you will be able to think of other shortcuts that suite your fancy.

How to print usernames with a userid greater than 500

Occasionally, you need to print out a list of usernames, greater than a certain user id. This is usually useful an a slightly larger setup, or when you want to chain more commands to certain users.

Use the awk command.

awk -F":" ' $3 > 200  {print $1} '  /etc/passwd

2 CLI ways to determine which rpm package has a program you wish to install in Fedora Linux

There are 2 ways I know of to search for a particular program to install in Linux. As usual, I’ll be focusing on the Command Line Interface (CLI).

So, you’ve heard about the versatile port scanning tool called nmap and want to install it in Fedora Linux. The only problem is, you don’t know if it has been pre-packaged and is available as an rpm binary. No worries, all you need to do is search for using yum.

Use the yum search command.

yum search nmap

Based on its output, you know there are packages available, and all you need to do is yum install nmap

[raja@atreides ~]$ yum search nmap
Loaded plugins: fastestmirror, presto, refresh-packagekit
================================ Matched: nmap =================================
nmap.i586 : Network exploration tool and security scanner
nmap-frontend.i586 : the GTK+ frontend for nmap
onesixtyone.i586 : An efficient SNMP scanner
perl-Nmap-Parser.noarch : Parse nmap scan data with perl
psad.i586 : Port Scan Attack Detector (psad) watches for suspect traffic

Or, you might know that its called nmap, and want to search through you yum repositories to find if any of the available rpms have a file called nmap. To do that, use the yum provides */ command. e.g.

yum provides */nmap

Look at what it gives:

[raja@atreides ~]$ yum provides */nmap
Loaded plugins: fastestmirror, presto, refresh-packagekit
2:nmap-4.76-4.fc11.i586 : Network exploration tool and security scanner
Repo        : fedora
Matched from:
Filename    : /usr/share/nmap
Filename    : /usr/bin/nmap

From this, you know that the nmap-4.76-4.fc11.i586 rpm contains these files, and by installing it, you get nmap.

How to use a download accelerator with a Rapidshare Premium Account in Fedora Linux

After reading my previous post, the next question that’s bound to crop up is How do I use a download accelerator with my premium rapidshare share account in linux?

Being a command line junkie, I prefer using the terminal for my downloading needs. Let me introduce you to Aria2. As from the website.

aria2 is a multi-protocol & multi-source, cross platform download utility. The supported protocols are HTTP(S), FTP, BitTorrent (DHT, PEX, MSE/PE), and Metalink.

Using Fedora, my favourite distro of choice, you first have to install it via yum.

yum install aria2

Next, you’ll need to have your cookies saved. Refer to the previous post for more details.

Now comes the fun part, actually downloading the files.

Here’s a file which I uploaded, a movie trailer for a recent movie:-

http://rapidshare.com/files/207110649/terminatorsalvation-tlr1_h1080p.mov

To download with aria2, type in the following command:-

aria2c -s 5 -j 1 -c --load-cookies=/home/raja/cookies.txt http://rapidshare.com/files/207110649/terminatorsalvation-tlr1_h1080p.mov

The switches for this explained:-

  • -s 5 Split the download into 5 connections
  • -j 1 How many files to download at once.
  • -c Continue any paused / cancelled downloads
  • –load-cookies /path/to/cookie The rapidshare cookie file that was created earlier. This has to be an absolute path
  • And finally the actual URL of the file

If you have a list of files to download, you can enter them in to a text file, and pass them to aria2 for batch downloading via the -i list_file_name option. e.g.

aria2c -s 5 -j 1 -c --load-cookies=/home/raja/cookies.txt -i lists.txt

Happy batch downloading!!!

How to enable USB Devices for VirtualBox Guests in Fedora 11

By default, guest hosts running in VirtualBox on Fedora 11 cannot mount or see usb devices plugged into your machine. A few tweaks are necessary for USB support to work.

  1. Edit your /etc/rc.sysinit file, change line no 26 from
    mount -n -t usbfs /proc/bus/usb /proc/bus/usb

    to

    mount -t usbfs -o remount,devgid=$(awk -F: '/^vboxusers:/{print $3}' /etc/gr    oup),devmode=664 /proc/bus/usb /proc/bus/usb

    So, your /etc/rc.sysinit should change from:

     23 if [ ! -d /proc/bus/usb ]; then
     24         modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb     /proc/bus/usb
     25 else
     26        mount -n -t usbfs /proc/bus/usb /proc/bus/usb
     27 fi

    to

     24         modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb     /proc/bus/usb
     25 else
     26 #       mount -n -t usbfs /proc/bus/usb /proc/bus/usb
     27 mount -t usbfs -o remount,devgid=$(awk -F: '/^vboxusers:/{print $3}' /etc/gr    oup),devmode=664 /proc/bus/usb /proc/bus/usb
     28 fi
  2. Next, edit your /etc/udev/rules.d/10-vboxdrv.rules. Change line number 1 from
    KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0600"

    to

    KERNEL=="vboxdrv", NAME="vboxdrv", OWNER="root", GROUP="root", MODE="0660"
  3. Reboot your machine. You should now be able to mount you usb devices.

The following screenshot shows some of the USB devices can allow my guest machine to view.

The USB devices available for VirtualBox Guests

The USB devices available for VirtualBox Guests

Devices like my USB Flash Drive are still blurred out. In order to get them to work, I need to install the VirtualBox Guest Additions first.

Source:

VirtualBox Community Forum

How to install Virtual Box 3.0 in Fedora 11 32 bit

When trying to install VirtualBox 3.0 in Fedora 11 32bit, you may encounter this error:-

[root@atreides ~]# rpm -ivh VirtualBox-2.2.4_47978_fedora11-1.i586.rpm
Preparing...                ########################################### [100%]
   1:VirtualBox             ########################################### [100%]
 
Creating group 'vboxusers'. VM users must be member of that group!
 
No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.
 
Compilation of the kernel module FAILED! VirtualBox will not start until this
problem is fixed. Please consult /var/log/vbox-install.log to find out why the
kernel module does not compile. Most probably the kernel sources are not found.
Install them and execute
 
  /etc/init.d/vboxdrv setup
 
as root.

This happens even when you have the kernel-devel rpm package installed already.

The short:-
Your kernel is most probably a PAE kernel, so just yum install kernel-PAE-devel.i686 and then run /etc/init.d/vboxdrv setup. You can then run VirtualBox as usual.

The long:-

Further investigating, I tailed the /var/log/vbox-install.log file, which gave this error :-

[root@atreides ~]# tail /var/log/vbox-install.log
** Compiling vboxdrv
Makefile:145: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.  Stop.
</directory>

I found it kind of weird, since I have already installed the kernel-devel rpm. So I decided to check my kernel version with this command:-

[root@atreides ~]# uname -a
Linux atreides.dune 2.6.29.5-191.fc11.i686.PAE #1 SMP Tue Jun 16 23:19:53 EDT 2009 i686 i686 i386 GNU/Linux

After reading up further, I saw this in the Fedora 11 Release Notes:-

3.1. x86 Specifics for Fedora
By default, the PAE kernel is used on 32-bit hardware, where supported by the hardware.

My CPU supports PAE, so by default the kernel-PAE rpm is installed. I checked this by using the following command:-

[root@atreides ~]# rpm -qa | grep kernel
kernel-PAE-2.6.29.4-167.fc11.i686
kernel-firmware-2.6.29.5-191.fc11.noarch
kernel-PAE-2.6.29.5-191.fc11.i686
kernel-devel-2.6.29.5-191.fc11.i586
kerneloops-0.12-5.fc11.i586
kernel-headers-2.6.29.5-191.fc11.i586

You can see that kernel-PAE-2.6.29.4-167.fc11.i686 and kernel-PAE-2.6.29.5-191.fc11.i686 is installed.

Doing a yum search kernel-PAE shows this:-

[raja@atreides ~]$ yum search kernel-PAE
Loaded plugins: fastestmirror, presto, refresh-packagekit
========================================= Matched: kernel-PAE =========================================
kmod-iscsitarget-PAE.i686 : Metapackage which tracks in iscsitarget kernel module for newest kernel-PAE
kernel-PAE.i686 : The Linux kernel compiled for PAE capable machines
kernel-PAE-devel.i686 : Development package for building kernel modules to match the PAE kernel
kernel-PAEdebug.i686 : The Linux kernel compiled with extra debugging enabled for PAE capable machines
kernel-PAEdebug-devel.i686 : Development package for building kernel modules to match the PAEdebug
                           : kernel
kmod-VirtualBox-OSE-PAE.i686 : Metapackage which tracks in VirtualBox-OSE kernel module for newest
                             : kernel-PAE
kmod-blcr-PAE.i686 : Metapackage which tracks in blcr kernel module for newest kernel-PAE
kmod-em8300-PAE.i686 : Metapackage which tracks in em8300 kernel module for newest kernel-PAE
kmod-kqemu-PAE.i686 : Metapackage which tracks in kqemu kernel module for newest kernel-PAE
kmod-ndiswrapper-PAE.i686 : Metapackage which tracks in ndiswrapper kernel module for newest kernel-PAE
kmod-nvidia-173xx-PAE.i686 : Metapackage which tracks in nvidia-173xx kernel module for newest
                           : kernel-PAE
kmod-nvidia-PAE.i686 : Metapackage which tracks in nvidia kernel module for newest kernel-PAE
kmod-open-vm-tools-PAE.i686 : Metapackage which tracks in open-vm-tools kernel module for newest
                            : kernel-PAE
kmod-rt2860-PAE.i686 : Metapackage which tracks in rt2860 kernel module for newest kernel-PAE
kmod-rt2870-PAE.i686 : Metapackage which tracks in rt2870 kernel module for newest kernel-PAE
kmod-rt3070-PAE.i686 : Metapackage which tracks in rt3070 kernel module for newest kernel-PAE
kmod-slmodem-PAE.i686 : Metapackage which tracks in slmodem kernel module for newest kernel-PAE
kmod-sysprof-PAE.i686 : Metapackage which tracks in sysprof kernel module for newest kernel-PAE
kmod-wl-PAE.i686 : Metapackage which tracks in wl kernel module for newest kernel-PAE

Now you know that the kernel-sources for the PAE kernel is kernel-PAE-devel.i686. So, I’d hav to install that instead.

[root@atreides ~]# yum install kernel-PAE-devel.i686
Loaded plugins: fastestmirror, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: mirror.oscc.org.my
 * rpmfusion-free: mirror.transact.net.au
 * rpmfusion-free-updates: mirror.transact.net.au
 * rpmfusion-nonfree: mirror.transact.net.au
 * rpmfusion-nonfree-updates: mirror.transact.net.au
 * updates: mirror.oscc.org.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kernel-PAE-devel.i686 0:2.6.29.5-191.fc11 set to be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
=======================================================================================================
 Package                      Arch             Version                       Repository           Size
=======================================================================================================
Installing:
 kernel-PAE-devel             i686             2.6.29.5-191.fc11             updates             6.2 M
 
Transaction Summary
=======================================================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
 
Total download size: 6.2 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 6.2 M
kernel-PAE-devel-2.6.29.5-191.fc11.i686.rpm                                     | 6.2 MB     08:33
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : kernel-PAE-devel-2.6.29.5-191.fc11.i686                                         1/1
 
Installed:
  kernel-PAE-devel.i686 0:2.6.29.5-191.fc11
 
Complete!

Once done, run /etc/init.d/vboxdrv setup as root, and your done.

root@atreides ~]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module                          [  OK  ]
Recompiling VirtualBox kernel module                       [  OK  ]
Starting VirtualBox kernel module                          [  OK  ]

You can now run VirtualBox. :)

How to install Google Chrome in Fedora 10 or Fedora 11

Google has its open source version of its Chrome browser, currently under heavy development. The open source version is called Chromium.

Tom ‘Spot’ Callaway, the Fedora Engineering Manager, has created a rpm repository with precompiled versions of the chromium browser.

To install chromium, create a chromium.repo file in your /etc/yum.repos.d directory.

vim /etc/yum.repos.d/chromium.repo

Then fill it up with this:-

[chromium]
name=Chromium Test Packages
baseurl=http://spot.fedorapeople.org/chromium/F$releasever/
enabled=1
gpgcheck=0

After that, just yum install chromium

[root@atreides ~]# yum install chromium
Loaded plugins: fastestmirror, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: mirror.oscc.org.my
 * rpmfusion-free: mirror.transact.net.au
 * rpmfusion-free-updates: mirror.transact.net.au
 * rpmfusion-nonfree: mirror.transact.net.au
 * rpmfusion-nonfree-updates: mirror.transact.net.au
 * updates: ftp.riken.jp
chromium                                                 | 1.2 kB     00:00
chromium/primary                                         | 2.4 kB     00:00
chromium                                                                    7/7
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package chromium.i586 0:3.0.191.0-0.1.20090628svn19474.fc11 set to be updated
--> Processing Dependency: libv8.so.0 for package: chromium-3.0.191.0-0.1.20090628svn19474.fc11.i586
--> Running transaction check
---> Package v8.i586 0:1.2.9-1.20090626svn2284.fc11 set to be updated
--> Finished Dependency Resolution
 
Dependencies Resolved
 
================================================================================
 Package     Arch    Version                                  Repository   Size
================================================================================
Installing:
 chromium    i586    3.0.191.0-0.1.20090628svn19474.fc11      chromium     11 M
Installing for dependencies:
 v8          i586    1.2.9-1.20090626svn2284.fc11             chromium    858 k
 
Transaction Summary
================================================================================
Install      2 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
 
Total download size: 12 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 12 M
(1/2): chromium-3.0.191.0-0.1.20090628svn19474.fc11.i586 |  11 MB     01:11
(2/2): v8-1.2.9-1.20090626svn2284.fc11.i586.rpm          | 858 kB     00:06
--------------------------------------------------------------------------------
Total                                           149 kB/s |  12 MB     01:19
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : v8-1.2.9-1.20090626svn2284.fc11.i586                     1/2
  Installing     : chromium-3.0.191.0-0.1.20090628svn19474.fc11.i586        2/2
 
Installed:
  chromium.i586 0:3.0.191.0-0.1.20090628svn19474.fc11
 
Dependency Installed:
  v8.i586 0:1.2.9-1.20090626svn2284.fc11
 
Complete!

And walla!! Chromium for Fedora !!!

Here’s a screenshot of Chromium running on my machine:
chromium
Sources:-