How to setup and access Web Server on Guest Ubuntu from Windows Host?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
YogiYang
Posts: 30
Joined: 27. Mar 2008, 13:50

How to setup and access Web Server on Guest Ubuntu from Windows Host?

Post by YogiYang »

Hello,

I want to build a VM running Ubuntu with Apache Web server in such a way that I should be able to access it from my Windows Host Browser.

I tried in may way to connect Chrome running in Windows Host to the web server in Ubuntu Guest VM but it is not able to connect.

Can someone point me to any documentation explaining how to do this.

TIA
Yogi Yang
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to setup and access Web Server on Guest Ubuntu from Windows Host?

Post by mpack »

See "Virtual Networking", chapter 6 of the user manual.

You will need to use "Bridged Networking" (6.5) because the default NAT does not respond to unsolicited queries, so it isn't easy to make a server with NAT.
YogiYang
Posts: 30
Joined: 27. Mar 2008, 13:50

Re: How to setup and access Web Server on Guest Ubuntu from Windows Host?

Post by YogiYang »

Hello,

Should I add two LAN cards to the VM - one with the NAT and another for Bridge Adopter?

TIA
Yogi Yang
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to setup and access Web Server on Guest Ubuntu from Windows Host?

Post by mpack »

Why would you want two connections to the same network?

The only time you'll see two adapters recommended is when one is NAT and the other is host-only. Those are two different networks (host-only is not the same as bridged). You might use NAT+hostonly when you want the guest to have Internet access but also have access to a host PC resource, a printer for example.

Bridged makes the VM a full participant on the same physical network the host is attached to, you can't do better than "full participant", so adding a NAT adapter does nothing good but could cause confusion.
YogiYang
Posts: 30
Joined: 27. Mar 2008, 13:50

Re: How to setup and access Web Server on Guest Ubuntu from Windows Host?

Post by YogiYang »

Hello,

I have setup the machine as per the documentation but still I am not able to access it from Host.

What other setting have I to do at Guest level to access the web server from Host?

TIA
Yogi Yang
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to setup and access Web Server on Guest Ubuntu from Windows Host?

Post by scottgus1 »

Please see Virtualbox Networks: In Pictures

Access to the VM from the host can be accomplished using these network types:
  • Bridged (Requires the host to be connected to a LAN of some sort; Wi-Fi may or may not work, full host & LAN access)
  • Host-Only (No internet or LAN access in the VM, but host has full access)
  • NAT or NAT Network (port forwarding required, but host & LAN & internet can access VM, works if Bridged does not)
Pick one, please, then we can guide further.
Post Reply