June 24, 2009

Registered Linux User

I just visited the website http://counter.li.org and registered there. Now I am a registered Linux User with user number 492391.

June 9, 2009

Installing Eclipse IDE

Eclipse IDE is an open-source integrated development environment for developin software and applications, usually in Java. To install Eclipse IDE in a computer running on Ubuntu, install first Java Runtime 5(or later). Run the following in the terminal:

sudo apt-get install sun-java5-jre sudo apt-get install sun-java5-jdk

Download the latest release of Eclipse in the Eclipse downloads page.

Extract the downloaded file and move the eclipse directory into /opt/.

Take care of the permissions:

sudo chmod -R +r /opt/eclipse sudo chmod +x /opt/eclipse/eclipse

Create an executable in your path:

sudo touch /usr/bin/eclipse sudo chmod 755 /usr/bin/eclipse sudoedit /usr/bin/eclipse

Copy the following content and save the file:

#!/bin/sh #export MOZILLA_FIVE_HOME="/usr/lib/mozilla/" export ECLIPSE_HOME="/opt/eclipse" $ECLIPSE_HOME/eclipse $*

Let's also make eclipse executable everywhere by creating a symlink:

sudo ln -s /usr/bin/eclipse /bin/eclipse

Create the menu icon:

sudoedit /usr/share/applications/eclipse.desktop

Type in this content and save:

[Desktop Entry] Encoding=UTF-8 Name=Eclipse Comment=Eclipse IDE Exec=eclipse Icon=/opt/eclipse/icon.xpm Terminal=false Type=Application Categories=GNOME;Application;Development; StartupNotify=true

Run for the first time:

eclipse -clean

After following the said steps, Eclipse IDE can now be started by simply typing eclipse in the terminal or from the GNOME menu Applications -> Programming -> Eclipse.

Aside from this, you can download the ZIP file and just extract it. After that, you can create a launcher or shortcut to it.

June 4, 2009

Sharing Folders on VirtualBox

Most of the times, we need to share files and folders from our home machine to the virtual machine. To do this, follow the following steps:

  1. On the main VirtualBox window, click the Devices menu then select Shared Folders.
  2. Click the button at the upper right of the Shared Folders dialog box to add a shared folder. For example, share the /home/username/SharedFolder.
  3. Browse the path to the folder you would like to share.
  4. Type in a folder name for it (like SharedFolder) then click the OK button.
  5. Click the OK button in the Shared folders dialog box.
  6. Go to the virtual OS. On a Windows virtual OS, click the Start button then click Run.
  7. Type in cmd to open up the command-line terminal.
  8. Type net use x: \\vboxsvr\SharedFolder where SharedFolder is the name of the shared folder and x: is the drive name you want to assign to the shared folder.
  9. Press the Enter key and then exit the command prompt. After the above steps, you will see the shared folder as a network drive under My Computer.

Sharing the mouse on VirtualBox

When you run the virtual machine on VirtualBox and you click on virtual OS, the virtual machine automatically captures your keyboard and mouse as if it is being used only in that OS. This makes the keyboard and mouse unavailable to any other application on the host machine. If this is not what you wanted, follow the tips below:

To get the control back to the home machine, you can press the host key(Normally this is the CTRL key on the right side of the keyboard). This will return the keyboard and mouse(whatever is already captured) to normal operation. If you want to share your mouse between the virtual OS and your home OS without pressing the right control key, you must install the Guest Additions from the virtualbox menu.

After starting the virtual OS, press the right control key to get the mouse out of the virtual OS control and click on the Devices menu. Select Install Guest Additions. This will install Guest Additions software in the Windows virtual box. Follow the prompts and once installed, reboot the virtual box and login. You'll get a warning message about the mouse control. Click the OK button and continue.

Once you have installed the guest addition, you can now move the mouse in and out of the box without pressing the host key.

June 3, 2009

Installing Guest OS on VirtualBox

VirtualBox will be useless if there is no operating system/s installed in it. To install operating systems in VirtualBox, follow these steps:

  1. Start Sun Virtualbox by going to Applications -> Systems Tools -> Sun VirtualBox.
  2. Click on the New button. A Create New Virtual Machine dialog box will appear. Click the Next button. Enter a name for the virtual machine and select the OS type you want to install. In my unit, I installed Windows XP and I named the virtual machine "WindowsXP" to be descriptive.
  3. The next dialog box prompts you for the memory to be allocated to the virtual machine. After entering the memory, click the Next button.
  4. In the next dialog, you will be prompted to create a new virtual hard drive or use an existing one, if there is already one. Select your choice then click the Next button.
  5. Click the Next button in the Create New Virtual Hard Drive dialog box.
  6. You will then be asked for the hard disk storage type. The first option is to dynamically expand the space and the second one is to create a fixed size. I chose the first option. Click the Next button after selecting your choice.
  7. Now, the disk location will be asked. You can just choose the default filename(same as the hard drive name). Also, you can specify the capacity of the hard disk. After selecting, click the Next button.
  8. In the summary dialog, verify your chosen settings then click the Finish button. In the confirmation dialog, click the Finish button.
  9. Click on virtual machine and then click on the Settings button at the top. Under the General setting, you can resize the RAM and video settings. Click CD/DVD-ROM on the left side. Check Mount CD/DVD drive. Select your CD/DVD drive. If you choose Host CD/DVD Drive, select your drive from the drop down box while if you choose ISO Image File, select the location of your ISO file.
  10. Click on Audio on the left side. Check Enable Audio and select your Audio Driver. Click on the USB option. Check Enable USB Controller. Click on the tiny USB cable icon with small green dot on the right. It'll show you all available USB devices. Add those to the filter.
  11. Click the OK button. To start the virtual machine, click the Start button on the top. Before you can use the virtual machine, you must first install a virtual operating system. Installing an OS on the virtual machine is much like installing on a real hard disk.

Installing VirtualBox

VirtualBox is an x86 virtualization software package, originally created by German software company Innotek, now developed by Sun Microsystems as part of its Sun xVM virtualization platform. It is installed on an existing host operating system; within this application, additional operating systems, each known as a Guest OS, can be loaded and run, each with its own virtual environment.

To install VirtualBox, go to Virtualbox download site and download the binary file for your operating system. My unit runs on Ubuntu 8.10(Intrepid) so I downloaded the binary file for it.

Before you start using Virtualbox, go to System -> Administration -> Users and Groups. Click the Unlock button in the User Settings dialog box. Type in your password then click the Authenticate button.

Click on Manage Groups button. Scroll down until you see vboxusers. Click vboxusers then click on the Properties button. Check the users to whom you want to give access to Virtualbox. Click the OK button and close the boxes.

Once you attach the Vboxusers group to the users, you need to change the permission to access USB devices. Open a terminal and type:

gksudo gedit /etc/init.d/mountdevsubfs.sh

Add the following lines at the end of the do_start() function:

# #Magic to make /proc/bus/usb work # mkdir -p /dev/bus/usb/.usbfs domount usbfs "" /dev/bus/usb/.usbfs usbfs -obusmode=0700,devmode=0600,listmode=0644 ln -s .usbfs/devices /dev/bus/usb/devices mount --rbind /dev/bus/usb /proc/bus/usb

Then, run the script that you just edited by typing in the terminal:

sudo /etc/init.d/mountdevsubfs.sh start

In order to give users in the vboxusers group write permissions to the devices in /proc/bus/usb, you'll need to edit some rules in /etc/udev/rules.d. Open a terminal and type:

gksudo edit /etc/udev/rules.d/40-permissions.rules

Edit to have the following:

# USB devices (usbfs replacement) SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664", GROUP="vboxusers" SUBSYSTEM=="usb_device", MODE="0664", GROUP="vboxusers"

Then, restart the udev service by typing in the terminal:

sudo /etc/init.d/udev res

Once everything has been done, you can start the Virtualbox by going to Applications -> Systems -> Sun Virtualbox.