top of page

MEHUL'S SPACE

Access VirtualBox Guest Network From Outside

Writer's picture: Mehul VedMehul Ved

I have been looking for a way to enabling network inside virtualbox so that I can access it from anywhere thus being able to run various services inside virtual environment, trying out anything without any worries.

Here’s a simple how-to borrowed from archlinux wiki

Install bridge utils for creating bridge and uml_utilities for creating a tun device

pacman -S bridge-utils uml_utilities

Open the file /etc/udev/rules.d/60-vboxdrv.rules and add the following line to it

KERNEL==”tun”, OWNER=”root”, GROUP=”vboxusers”, MODE=”0660″

Then type the following command to load the tun module

modprobe tun

Now, let’s setup a bridge device to bridge network from your physical network interface to the virtual one

  1. Create a bridge interface

brctl addbr br0
  1. Set your interface in promiscous mode so it can accept packets from any interface

ifconfig <interface name> 0.0.0.0 promisc
  1. Now, bridge the bridge interface with the real network interface

brctl addif br0 <interface name>
  1. Now set the bridge interface to acquire IP address as your physical network interface would. eg if eth0 is your network interface and it acquires IP via DHCP then

dhclient br0
  1. And finally add virtualbox host interface

VBoxAddIF vbox0 <VirtualBox user> br0

Now start VirtualBox and go to network settings. Select network interface as ‘host networking’ and interface device as ‘vbox0’.

Now you need to give an unused IP address in your IP range of the internet gateway. If you cannot provide that due to some reason then what you can do is create a virtual interface say eth0:0 then bind bridge network to that interface and setup NATing to pass packets between virtualbox and external network.

2 views0 comments

Recent Posts

See All

Mediawiki on dotcloud

Unfortunately, there’s no guide available for installing mediawiki on dotcloud and googling for it doesn’t turn up anything much useful....

WordPress Performance Tips

Do you find performance of your WordPress blog to be lousy? And have no clue on where to start with it? There are lots of articles on the...

Comentários


bottom of page