Showing posts with label debian. Show all posts
Showing posts with label debian. Show all posts

Monday, December 2, 2013

VBox Virtual Networks Quick Guide

While I'm writing this post, VirtualBox 4.3.4 "NAT networks" (Network Address Translation Service) don't work properly (still experimental), so to have an internal network where VMs are accessible by Host but NOT from outside, and VMs are able to access networks outside host (as internet), I had to:

1) on Host VirtualBox Manager > file > preferences >  network > host-only networks > add; on the (guest) VM settings > network > attached to > host-only adapter > set proper name

2) on Host, enable routing on the kernel:
$ sudo vi /etc/sysctl.conf
uncomment "net.ipv4.ip_forward=1"

3) on Host, enable NAT outside:
$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$ sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

To make it persistent under a Debian/Linux Mint host, create a new ifup rule:

$ sudo vi /etc/network/if-up.d/iptables_NAT_vboxnet_out

#!/bin/sh
#
# Don't bother to do anything for lo or VBoxNets.
IFTYPE=$(echo "$IFACE" | cut -c1-2)
if [ "$IFTYPE" = lo -o "$IFTYPE" = vb ]; then
    exit 0
fi
# Only run from ifup.
if [ "$MODE" != start ]; then
    exit 0
    else
    iptables -t nat -A POSTROUTING -o "$IFACE" -j MASQUERADE
fi

$ sudo chmod ugo+x /etc/network/if-up.d/iptables_NAT_vboxnet_out

Reestart the Host to test.

Thursday, November 14, 2013

Keeping Firefox + Java up-to-date on a Linux Mint

1) UPDATE FIREFOX

Copy the link of updated Firefox from ftp://ftp.mozilla.org/pub/firefox/releases/ (navigate through the right version / platform /  language)

$ cd /opt
$ sudo wget FIREFOX_DOWNLOAD_LINK
$ sudo tar xjf firefox-VERSION.tar.bz2
$ sudo mv firefox firefox-VERSION
$ sudo rm firefox-VERSION.tar.bz2
$ sudo ln -sf /opt/firefox-VERSION/firefox /usr/bin/firefox

(ref: # ln -sf TARGET LINK)


2) UPDATE JAVA

Copy the link of updated Java from http://www.java.com/en/download/manual.jsp list (Debian like users should choose "Linux" or "Linux x64")

$ sudo wget JAVA_DOWNLOAD_LINK
$ sudo mv DOWNLOAD_FILENAME java.tar.gz
$ sudo tar xzf java.tar.gz
$ sudo rm java.tar.gz

You should have a new /opt/jreVERSION

Now update the Java sym links:

$ sudo ln -sf /opt/jreVERSION/bin/java /etc/alternatives/java
$ sudo ln -sf /opt/jreVERSION/bin/java_vm /etc/alternatives/java_vm
$ sudo ln -sf /opt/jreVERSION/bin/javaws /etc/alternatives/javaws


3) UPDATE USER FIREFOX JAVA PLUGIN LINK

And last update the user Firefox Java plugin sym link:

$ ln -sf /opt/jreVERSION/lib/amd64/libnpjp2.so ~/.mozilla/plugins/libnpjp2.so

(if the platform is 64bits)

Restart Firefox and... voilá!



Refs:
http://www.libre-software.net/how-to-install-firefox-on-ubuntu-linux-mint