Used to be able to access web server on VirtualBox Guest from host OS...

I used to be able to access the web server I had running on my guest OS in Virtual Box from my host OS. I also had it set to the network settings of “Host Only Adapter”. Then I needed to access the internet directly on the gues OS, so I changed my settings on the guest OS to “NAT” (in virtual box), and in /etc/network/interfaces, I removed the loopback stuff and the static IP I’d put in.

Now no matter what I do, I cannot get it back to being accessible from the host os! I even did a completely NEW install of Ubuntu guest OS in Virtual box (completely new install from the ISO, new hard disk) and even THAT one won’t work! Any ideas what went wrong and how to fix this?

Guest OS: Ubuntu 10.04 Desktop
Host OS: OpenSUSE 11.3
VirtualBox: 3.2.6

Don’t use nat ! Use ‘bridged adapter’ in your VB host. Than you can access your guest from vb host and other computers in lan, provided the gest network settings ( ip, mask, gateway, /etc/hosts, etc) are correct.

I tried that too and it did not work! In fact, somehow when I type “ifconfig” on the guest OS, it now shows only “lo”!!! It no longer shows eth0! Help!

you have to enable the guest network adpater(s) in the network settings of the virtual machine in VBox. If you didn’t define any network adapter for your virtual machine, you won’t have any.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

More importantly, look in Yast. If you changed network adapters it is
possible your old one is still defined within the Guest but no longer
visible because the host (via VirtualBox) has given the guest a new
interface, and one that is not configured.

Good luck.

On 09/04/2010 10:36 PM, please try again wrote:
>
> you have to enable the guest network adpater(s) in the network settings
> of the virtual machine in VBox. If you didn’t define any network
> adapter for your virtual machine, you won’t have any.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMgyyvAAoJEF+XTK08PnB59PkP/RabeQfBXzrF6DmGlURMTgBh
nHVAEMRKSbxCF4+B0ny6VRCgmm80DfFgxELf/1rMSesBxxH6/K5uyj17sPEFXjZW
+t62b8DqhWKXNuQwHJXRrUvK63ROtmtvvxhfDfm28nmnfA+MQCpn3x0zOIBQ9CKs
kS0M/AcMSC2mL7DAKEhZHVAS82zHqKcJuOHQPwPWYl+dL27rKAbwjxP735e6NMDh
gHzNSWWncH0Xsa2gUG50pjyJf8Uw5PzxULa5V+Tl6njB0XWVfxZCi5FHlHfilu0D
lka827x9ZWPL+TG6uqSBvcJHG4OR9l2JLui+nb4oSOnNq39+BlkfHGdsv7k10wOS
bZ42zKtSNBh2WCQT94uLBm8rIBEeFe+EWvbqPEhSCHPzo8gnz49+vQaHpmIqL5ha
dFs+6BXu+5GN81rtIYWp2GogsZMtvA82m5UW0GGquw7nz0/lR2rW8DUFP0euSsLm
tJdsEqrMBO0SPtkdrxTWcRBzaWwWtUl8NMYjE4/yVrEVO6UQtRSoBoz9kmKTe0Nu
dl2eZp6jWxsBZWHo0yG+uMwYxhGPcF1iVWotOMQq01XKLuU7Chc3A3cmAGmpfpjD
WGvbabMgXrOHJ2JqVPx/C2tull1s3E+925p6OdefdCYKSvBLdfgI0Lr1EkVXTjsJ
19xVES/pgy8jIecJVd+s
=1tYB
-----END PGP SIGNATURE-----

Nothing I did worked, but something in VirtualBox and the random popups I got on changes (it always showed that I’d changed to “bridged adapter” but only sometimes popped up something to tell me the change was applied) made me think maybe it was buggy in actually applying the change. So I did this:

  • Changed to NAT
  • Restarted, didn’t work
  • Changed to host only
  • Restarted, didn’t work
  • Changed to bridged adapter
  • Restarted, didn’t work
  • Changed to NAT
  • Restarted, didn’t work
  • Changed to host only
  • Restarted, didn’t work
  • Changed to bridged adapter
  • it finally worked!

So something’s buggy with VirtualBox and changing network type.