Filed under Linux by amida168 on March 9, 2010 at 11:57 am
one comment
There is a problem with Fedora 12 kernel version 2.6.32.9-67 and the VirtualBox 3.1.4 Guest Additions. After you install the Guest Additions and reboot the virtual machine, you can only see a black screen. Usually, I would either press CTRL+ALT+F1 to get to the shell terminal to change settings or edit the Grub menu to boot to a different run level. However, the key combination CTRL+ALT+F1 on VirutalBox does not work. The Grub menu on Fedora 12 is also hidden, and the timeout is set to 0, so you cannot modify it (talk about some nice design!).
After playing around with it for a while, I found a way to work around the problem. This is not a detailed guide, but I will outline what I did to fix it.
- Mount a Linux LiveCD to the CD/DVD devices. I prefer the KDE version of LiveCD.
- Restart the virtual machine. Press F12 immediately when the VM is starting up. Press C to boot to the LiveCD.
- Mount the boot partition of your primary disk.
- Use a text editor to edit the menu.lst file in grub directory of the boot partition. You might need to become superuser (root) to edit it.
- The default is set to 0, which is the latest kernel that doesn’t work with the Guest Additions. Change the value to 1, so the Guest Additions will not be loaded. While you are here, change timeout to 10 and comment out the hiddenmenu. This way, you can get a chance to modify the grub menu without using a LiveCD next time. The result is like the listing.
default=1
timeout=10
#hiddenmenu
- Save the file and reboot.
The system will be booted to the previous kernel without the Guest Additions.

Filed under Linux by amida168 on December 1, 2009 at 4:56 pm
5 comments
To install VirtualBox 3.0 Guest Additions on a Fedora 12 virtual machine, follow these steps.
- In the virtual machine’s menu, click on Devices -> Install Guest Additions .
- The guest additions CD image is mounted. A message pops up asking about autorun. Click on Cancel.

- Click on the Applications -> System Tools -> Terminal to bring up a terminal window.
- Now you do the following steps in the terminal. Enter su and press enter. Enter root’s password to get a root prompt.
- We need two extra packages to install the guest additions. Enter the following commands.
yum -y install gcc kernel-devel
- Now change the directory to the guest additions media. The path is different, if you use a different version of VirtualBox.
cd /media/VBOXADDITIONS_3.0.12_54655/
- Run the guest additions script for 32bit machines. If you use a 64bit VM, use VBoxLinuxAdditions-amd64.run instead.
sh VBoxLinuxAdditions-x86.run
- Reboot the VM and it’s done.
I do not have a full guide on installing Fedora 12 on VirtualBox, but the whole process is very similar to installing Fedora 11. Please see this post for reference.
Filed under Linux by amida168 on November 9, 2009 at 1:30 pm
no comments

I downloaded the ISO image of Ubuntu 9.10 last week. Before I created a new virtual machine in VirtualBox, I realized that I have never upgraded Ubuntu before. So I decided to try upgrading my old installation of 9.04 to 9.10.
The upgrading process is very simple if you have 9.04. There is an official page on UbuntuLinux.org about how to do it. Here are the steps:
- Click on System -> Administration -> Update Manager.
- Click on Check to get all updates for your system.
- Click on Install Updates if there are updates available. Reboot the machine if necessary.
- Once you have all the updates installed. Run the Update Manager again.
- You can see that the new release 9.10 is available. Click on Upgrade and follow the onscreen instructions to start upgrading.

Overall, I am very impressed with the upgrading process. It’s very intuitive even for new Linux users. If you are installing Ubuntu on VirtualBox, remember to install the Guest Additions after upgrading. Please refer to step 30 of this post if you do not know to install the Guest Additions.
Filed under Linux by amida168 on October 16, 2009 at 8:56 am
no comments

A few days ago, I read an article about Google Android is gaining popularity among cellphone makers. One research firm predicts that it will grow to 14 percent of the global smartphone market in 2012. The Android will be the number 2 platform after Symbian.
The popularity of Android has also expanded to other devices. Acer today announced the availability of the Aspire One AOD250 netbook with a dual-boot option including Android and Windows XP. The inclusion of Android gives the system instant-on ability that users can quickly turn on the system and surf the internet in no time.
If you want to try out Android, you can download Live Android, a LiveCD version of Android. Here is a tutorial on how to run the LiveCD on VirtualBox. The version of Live Android used in this tutorial is 0.3 and the VirtualBox version is 3.0.8.
- Download the iso files from this site. There are two files to download: liveandroidv0.3.iso.001 and liveandroidv0.3.iso.002.
- Combine the two files on Windows by using this command in a command prompt.
copy /b liveandroidv0.3.iso.001 + liveandroidv0.3.iso.002 liveandroidv0.3.iso
- Run VirtualBox. Click on File -> Virtual Media Manager. Click on CD/DVD Images tab and then click on Add to add the iso image. Click on OK when you are done.

- Back to the main windows of VirtualBox, click on New to create a new virtual machine.

- Enter a name for the virtual machine and select the OS type. Click on Next to continue.

- Set the memory size. 1024MB is plenty. Set it to 512MB or smaller if you do not have a lot of memory for your machine. Click on Next to continue.

- Uncheck Boot Hard Disk, since we are not using the hard drive for this virtual machine. Click on Next to continue.

- A warning pops up about not having a hard drive. Click on Continue.

- Click on Finish to finish creating the new virtual machine.

- Back to the main window, with Android LiveCD selected, double click on CD/DVD-ROM.

- Check Mount CD/DVD Drive, click on ISO Image File and select the Live Android cd image we added in step 3. Click on OK to continue.

- Back to the main windows. The virtual machine is configured to mount the Live Android.

- Start the virtual machine and select the resolution if you want and press Enter to boot.

- Live Android boots up. You are ready to try it.

Note that this can be adapted to other LiveCD. Use the Virtual Media Manager to add a different iso image and choose the newly added cd image in step 11.
For those who are new to Android, there are some special keys.
Left Windows key: Home
Application key: Menu
ESC key: Back
Here is a pic of Home and Menu keys on your keyboard.

Filed under Linux by amida168 on October 6, 2009 at 4:29 pm
no comments
I wanted to try out Ubuntu Remix 9.04 on VirtualBox, so I went to the official Ubuntu site and downloaded the file. When I first downloaded the file, I didn’t notice the download for Ubuntu Remix is an image file not an ISO file. This makes sense, since most netbooks do not have an optical drive. The IMG file is intended for installing using a USB drive. You are supposed to flash your USB drive using the IMG file.
This is a problem under VirtualBox, because VB cannot mount an IMG file like an ISO file. Fortunately, you can convert the IMG file to VirtualBox’s disk format VDI according to this post. The utility is called VBoxManage.exe which is part of your VirtualBox installation. Open up a command prompt, change directory to VirtualBox and type the command to convert the image.
cd "\Program Files\Sun\VirtualBox"
VBoxManage.exe convertfromraw -format VDI f:\Images\ubuntu-9.04-netbook-remix-i386.img f:\Images\ubuntu-9.04-netbook-remix-i386.vdi
Substitute the file name with the one on your system. If you use Vista or Windows 7, you need to use an elevated command prompt to enter the command. After the conversion is done, you can click on File -> Virtual Media Manager in VirtualBox to mount the converted vdi file.

Note that it’s mounted as a Hard Disk, not a CD/DVD Image. To install from this hard disk, I mounted this disk as IDE Primary Slave.

To start the actual installation, I have to press F12 when the virtual machine boots up and select 2) Primary Slave.
Filed under Linux by amida168 on September 24, 2009 at 4:53 pm
no comments
There is an official quickstart guide for installing nagios on Fedora Linux. However, it’s for Fedora Core 6. A lot of information is not relevant for Fedora 11. I tried to install it on my Fedora 11 virtual machine and here is the guide. Note that you need to issue the following commands as root in a terminal window.
Prerequisites
These packages are required for nagios: Apache web server, PHP, GCC compiler and GD development libraries. You can install them by this yum command.
yum install httpd php gcc glibc glibc-common gd gd-devel
Nagios Installation
We use yum again to install nagios and all the plugins.
yum install nagios nagios-plugins-all
Add Email Notification
There is one file to edit if you want to receive email alerts.
gedit /etc/nagios/objects/contacts.cfg
Create an Account for Web Interface
The next command will create an account nagiosadmin for the web interface.
htpasswd -c /etc/nagios/passwd nagiosadmin
Disable SELinux
The SELinux is enforcing by default. You need to disable it or configure it for nagios.
gedit /etc/selinux/config
Reboot the machine after you modify the settings.
Start the Services
You can now start httpd and nagios services.
service httpd start
service nagios start
On a side note, if you want httpd and nagios to start automatically next time you boot up the system, you can use the following commands.
chkconfig httpd on
chkconfig nagios on
Check Installation
The basic installation is complete. You can open up a browser and visit the nagios site using the user name(nagiosadmin) and password you specified earlier.
http://localhost/nagios/
Filed under Linux by amida168 on September 22, 2009 at 5:16 pm
no comments
As we have more and more machines, we use up the allocated IP addresses quickly. To mitigate the problem, I set up a Linux router for an intranet. I have tried quite a few distributions for Linux router, the one I picked is called floppyfw.
The setup for floppyfw is not difficult. For most people, you only have to modify the config file and you are good to go. When I set it up, I ran into a problem when a machine in the inside network tried to access a Windows share on the outside network. It just did not work. I looked at the firewall.ini file and found that the firewall is dropping packets related to NetBIOS and Samba. To get around this, I just commented the related firwall rules. Here is the part of the firewall.ini file after editing.
#
# We don't like the NetBIOS and Samba leaking..
#
#iptables -t nat -A PREROUTING -p TCP --dport 135:139 -j DROP
#iptables -t nat -A PREROUTING -p UDP --dport 137:139 -j DROP
#iptables -t nat -A PREROUTING -p TCP --dport 445 -j DROP
#iptables -t nat -A PREROUTING -p UDP --dport 445 -j DROP
Filed under Linux by amida168 on September 22, 2009 at 11:30 am
4 comments
I installed Yellow Dog Linux 6.2 on my PS3 this past weekend. The updater yum worked initially, but it stopped working on Sunday. I found that the problem is the server hosting mirrorlist is down. The workaround is to specify the base server manually. By editing the yum repo files, yum is working again.
In order to edit these files, you need to get root privilege first. In a terminal window, type su, press enter key and type the root’s password. Change directory to /etc/yum.repos.d. Use your favorite editor and edit the following 3 files.
yellowdog-base.repo
#generated by system-config-ydlnet
[base]
name=Yellow Dog Linux 6.2 Base
baseurl=http://ftp.yellowdoglinux.com/pub/yellowdog/yum/6.2/base/
#mirrorlist=http://www.terrasoftsolutions.com/resources/yd62-base-mlist
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
yellowdog-extras.repo
#generated by system-config-ydlnet
[extras]
name=Yellow Dog Linux 6.2 Extras
baseurl=http://ftp.yellowdoglinux.com/pub/yellowdog/yum/6.2/extras/
#mirrorlist=http://www.terrasoftsolutions.com/resources/yd62-extras-mlist
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
yellowdog-updates.repo
#generated by system-config-ydlnet
[updates]
name=Yellow Dog Linux 6.2 Updates
baseurl=http://ftp.yellowdoglinux.com/pub/yellowdog/yum/6.2/updates/
#mirrorlist=http://www.terrasoftsolutions.com/resources/yd62-updates-mlist
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
Note that I use the Yellow Dog Linux version 6.2, if you use other versions, you need to modify the files accordingly.
Filed under Linux by amida168 on September 17, 2009 at 4:02 pm
no comments
I often use cron jobs to run tasks on Linux. Cron is suitable for running recurring tasks. For one-time-only tasks, at is a better choice.
I needed to schedule some of our Linux servers to shutdown, so I wanted to use at. However, I have not used the command for a while and I couldn’t figure out the correct time(date) format to use. Finally, I turned to one of my favorite Linux(Unix) books - UNIX in a Nutshell and found some working examples. The following are the correct use of time(date) format.
at 1750 sep 17
at 5:50pm sep 17
at 4 am Sunday
at now + 6 hours
at midnight tomorrow
After you enter the at command, you will see an at prompt (at>). Enter the command(s) you want to run at the scheduled time. When you are done, press Ctrl + D. Here is an example to shutdown the server at 7:30am on 9/18.
# at 7:30am sep 18
at> shutdown -h now
at> <EOT>
job 2 at 2009-09-18 07:30
Note that <EOT> is not what I typed, it’s Ctrl + D.
Filed under Linux by amida168 on August 4, 2009 at 10:16 am
no comments
We use yum as the patching mechanism for our CentOS servers. It has worked smoothly for several years without incidents. I ran into a problem related to yum yesterday. Whenever I tried to update my system using the yum update command, I got a lot of error messages on the screen and it crashed. The last message shown is
TypeError: unsubscriptable object
Using Google, I was able to find this post about how to fix it. The proposed fix is to use this command:
yum clean metadata
. If this does not fix your yum problem, use this command:
yum clean all
.