Saturday, September 4, 2010

initramfs update error

Duringa ubuntu linux system update an initramfs error sometimes come up:


update-initramfs: Generating /boot/initrd.img-x.x.x.x-generic
.: 4: Can't open /scripts/functions

Often this results in broken update, and many other issues.
If the system is unable to boot to the new updated kernel, select the older version from the boot menu and try updating initramfs again.

Then try the following:

1, Delete only broken files in /var/lib/initramfs-tools/. (Be careful, delete onlt if you are sure of what you are doing, else you may try the other steps skipping this.)
2, sudo dpkg --configure -a
3, sudo dpkg --configure initramfs-tools (make sure no errors, otherwise repeat step 1 & 2).
4, sudo update-initramfs -u (Maybe not neccessary).

Thursday, August 5, 2010

tun module fails in Ubuntu 10, install fake tun

Problem: In Ubuntu 10.04, tun fails. while running the command
$ sudo modprobe tun
results into
tun module failed

The tun module is used in several VPN softwares like hamachi

Resolution:

Install fake tun in Ubuntu. Then run the command 'sudo modprobe tun'
Note: You need to be one of the admins (in sudo group).

To install fake tun, copy/paste and then run each command (below) separately. Make sure there is no line-breaks within a command

$ sudo apt-get install build-essential linux-headers-`uname -r`
$ mkdir faketun
$ cd faketun
$ echo -e "#include \nstatic int start__module(void) {return 0;}\nstatic void end__module(void){return;}\nmodule_init(start__module);\nmodule_exit(end__module);">tun.c
$ echo -e "obj-m += tun.o\nall:\n\tmake -C /lib/modules/\$(shell uname -r)/build/ M=\$(PWD) modules\nclean:\n\tmake -C /lib/modules/\$(shell uname -r)/build/ M=\$(PWD) clean\nclean-files := Module.symvers">Makefile
$ make
$ sudo install tun.ko /lib/modules/`uname -r`/kernel/net/tun.ko
$ sudo depmod -a
$ sudo modprobe tun
Incase, you get an  error, check tun.c and Makefile files (in the faketun folder) are created correctly. You may download the files from the address below, into the faketun folder, and then start from the 'make' command again:

File: tun.c download link


File: Makefile download link

Installing Guest Additions in VirtualBox

VirtualBox has made it pretty easy to install the Guest Additions for improved integration between guest and host. Some of these benefits are mouse-capture improvements and improved video resolution. The mouse capture improvements now allow you to control your virtual machine when the mouse is over the window, and seamlessly return to your host when it is not. Improved video resolution should allow you to customize a better resolution for your guests.

What we need to do to install the Guest Additions is select the option from the VirtualBox menu. You’ll want to do this after your guest is running (the guest-additions are installed to the guest, not the host). Select:
Devices > Install Guest Additions...

This sometimes takes a minute so don’t worry if you don’t see anything right away. This should then prompt you and say something along the lines of:
The Guest Additions image is not found on your host. Would you like to download this image now?

We’ll select YES and let it download the image. The image is downloaded to the host machine and then mounted within the guest. This way it can be shared with future guests without needing to download multiple times. It should also prompt you whether or not you’d like to mount the image. Again, select YES.

At this point you should see a disk image mounted on your desktop. What we’ll do here is run a script that will generate the proper modules to allow for guest additions. In my preferred method we’ll do this:
  1. Open a terminal by pressing ALT-F2 and enter “gnome-terminal” on gnome or “konsole” on KDE.
  2. cd /media/cdrom
    The Guest Addition iso file do not mount automatically sometimes. In the case if you do not see a cdrom, run sudo mount /dev/scd0 /media/cdrom
  3. sudo bash ./VBoxLinux*
    OR
    sudo sh ./VBoxLinuxAdditions-x86.run
    OR
    sudo sh ./VBoxLinuxAdditions-amd64.run

This will grind away at generating the proper modules and then prompt you to restart your guest machine. Once this has finished and you’ve rebooted your guest operating system you should have the guest improvements ready to go. No additional configuration for the mouse integration should be needed, but you may have to manually update to a better resolution as wanted.

Hopefully I’ll have the tutorial for building proper network bridging soon as well. Until then, enjoy your virtualization with VirtualBox!

_____________________________________

This article is taken from http://ubuntu-tutorials.com

Keyboard stops working in Virtualbox guest

Problem: Sometimes the keyboard would stop working in Virtualbox guest. The mouse works. The issues temporarily disappears on rebooting the guest.

Suggested solution: If you are in Ubuntu host, install the packages scim-bridge-client
sudo apt-get install scim-bridge-client-qt scim-bridge-client-gtk

Reboot the host.

The issue should be fixed by now.

Friday, April 30, 2010

Quick Opera install in Linux

In my opinion Opera is a very light weight, no-nonsense software. While opinions may vary, here is a easy way to install Opera in your Ubuntu/ Debian system.

Open to edit the apt sources.list file
sudo nano /etc/apt/sources.list
add the opera repo in a new line
deb http://deb.opera.com/opera/ stable non-free
Add the Opera GPG key with the command (recommended)
wget -O - http://deb.opera.com/archive.key | sudo apt-key add -
If you get authentication warnings, you may try (optional)
sudo apt-get install debian-archive-keyring
Run aptitude update
sudo apt-get update
Finally install Opera browser
sudo apt-get install opera

Tuesday, April 27, 2010

How to Set a Static IP in Linux Ubuntu Debian

We may require to configute a static IP address in our linux system. It is the easiest if you arterunning Ubuntu / debian distro.

Open up terminal and edit the 'interfaces' file in sudo mode
sudo nano /etc/network/interfaces

You would see the following lines
auto lo
iface lo inet loopback

replace the contents with the following:
auto lo eth0
iface lo inet loopback

iface eth0 inet static
address xxx.xxx.xxx.xxx(your static ip address)
netmask xxx.xxx.xxx.xxx(your network netmask)
gateway xxx.xxx.xxx.xxx(the gateway ip)

Save the file (Ctrl+O) and exit (Ctrl+X)

The ethusually the default network adapter. In a few cases it may be eth1.

I usually also change the nameservers to OpenDNS nameservers
sudo nano /etc/resolv.conf

replacing the contents with:
nameserver 208.67.222.222
nameserver 208.67.220.220

After that it is time to restart networking
sudo /etc/init.d/networking restart

Reboot your PC and check the ip with the command
ifconfig

Wednesday, April 14, 2010

Virtualbox Windows guest LAN Ethernet driver

In case you have a Windows guest in Virtualbox (Windows XP or Windows server), and the guest does not find the software of the Ethernet (LAN) card, you may download the drivers from here

AMD PCNet drivers

Intel PRO driver

You may download the drivers from the host OS, in a Shared Folder and install it from there.