Virtual Box Internet Issue

The problem:
unable to connect to internet
$ ping google (doesnt work)

What might cause the problem:
Added the ‘Host-only Adapter’ network to the virtual box

Solution:
remove static ip from /etc/network/interfaces (changed it back to dynamic)

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

#auto eth0
#iface eth0 inet static
#       address 192.168.0.108
#       netmask 255.255.255.0
#        network 192.168.0.0
#        broadcast 192.168.0.255
#        gateway 192.168.0.1

remove the 2nd network and only stayed with the 1st one (Bridged Adapter)

reflesh the MAC address (not sure if this help)

reboot

edit /etc/network/interfaces changed back to static ip address

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp

auto eth0
iface eth0 inet static
        address 192.168.0.108
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1

OR
edit using the GUI
http://askubuntu.com/questions/338442/how-to-set-static-ip-address#answer-338855

operating system:
Linux cowboy 3.12-kali1-686-pae #1 SMP Debian 3.12.6-2kali1 (2014-01-06) i686 GNU/Linux

ssh timeout

Working with putty and winscp these programs would timeout/freezes and have to reconnect. Here is how I fixed it.

On the server, have a look in /etc/ssh/sshd_config and see if you have these variables set. If not, add them:

TCPKeepAlive yes
ClientAliveInterval 190

Or on the client edit ~/.ssh/config and add this line

ServerAliveInterval 60

In putty setup under category Connection there is “Seconds between keepalives” option. It was “0” and I changed to 90.

The same option is also in WINSCP program.
winscp keepalive

resource:
http://ubuntuforums.org/archive/index.php/t-1100454.html