Showing posts with label virtualbox. Show all posts
Showing posts with label virtualbox. Show all posts
Tuesday, December 3, 2013
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.
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.
Wednesday, November 27, 2013
Installing VirtualBox (Bin Package)
Go to
https://www.virtualbox.org/wiki/Linux_Downloads
download "All distributions" (runs a bin installer)
$ sudo sh VirtualBox-VERSION-SYSTEM.run
After installing, go to https://www.virtualbox.org/wiki/Downloads
then click on "VirtualBox 4.3.2 Oracle VM VirtualBox Extension Pack"
choose open download directly on VirtualBox
To make VM fit on host screen etc:
running VM > devices > insert guest additions cd image
execute cd installer via SO
To update/upgrade VirtualBox, just make the same process; you'll need to reinstall Extension Pack
https://www.virtualbox.org/wiki/Linux_Downloads
download "All distributions" (runs a bin installer)
$ sudo sh VirtualBox-VERSION-SYSTEM.run
After installing, go to https://www.virtualbox.org/wiki/Downloads
then click on "VirtualBox 4.3.2 Oracle VM VirtualBox Extension Pack"
choose open download directly on VirtualBox
To make VM fit on host screen etc:
running VM > devices > insert guest additions cd image
execute cd installer via SO
To update/upgrade VirtualBox, just make the same process; you'll need to reinstall Extension Pack
Subscribe to:
Posts (Atom)