I'm using oracle/sun virtual box3.2 on ubuntu 10.04 desktop. The ip is not assigned to the guest virtual system and the mode of network is bridged. I even tried 'dhclient' but it could not fetch.
Output of 'ifconfig':
Edit:1 Actually I want to have both, the guest should have access to internet and as well as the host to guest networking
If all you want is to browse the Web change to NAT otherwise :
Network Address Translation (NAT) If all you want is to browse the Web, download files and view e-mail inside the guest, then this default mode should be sufficient for you, and you can safely skip the rest of this section. Please note that there are certain limitations when using Windows file sharing (see chapter 6.3.3, NAT limitations, page 102 for details).
Bridged networking This is for more advanced networking needs such as network simulations and running servers in a guest. When enabled, VirtualBox connects to one of your installed network cards and exchanges network packets directly, circumventing your host operating system’s network stack.
see virtual box manual
you can use a TAP interface too :
First we have to install the follow :
and after that add to kernel :
now, here there is a script that permit have and internet acces in host and guest at the same time :
copy and save as vb add execute permision :
after that sudo ./vb start and when finish sudo ./vb stop
create the virtual machine as bridge and interface vth0
Here the SCRIPT :
more information here