Please help: host to guest network connection trouble

Discussions related to using VirtualBox on Windows hosts.
Post Reply
nanoander
Posts: 4
Joined: 6. Jun 2008, 21:16

Please help: host to guest network connection trouble

Post by nanoander »

I've installed VB 1.6.2 on WinXPsp2, Debian 4 on a virtual machine and mounted a web server on it. I need to browse webs on that web server from Windows, but I can't. That's all, good bye.
shu8i
Posts: 2
Joined: 6. Jun 2008, 21:00

Re: Please help: host to guest network connection trouble

Post by shu8i »

nanoander wrote:I've installed VB 1.6.2 on WinXPsp2, Debian 4 on a virtual machine and mounted a web server on it. I need to browse webs on that web server from Windows, but I can't. That's all, good bye.
try to build a network bridge between your working network (WLAN/LAN) and the VirtualBox Network...
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

The easier option is to stick with the default NAT and read section 6.4.1 of the user guide (hit F1 when you are in the VirtualBox Console to display this). On my VMs I set up as standard

Code: Select all

set SVM=VBoxManage setextradata <<your VM>>
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol  TCP
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort 22 
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort  2222
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestwww/Protocol  TCP
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestwww/GuestPort 80 
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestwww/HostPort  81 
and now http://localhost:81/ browses the VM and I can do SSH based interactive log on and file transfer through localhost port 2222.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

Create a Host Interface is the easiest setup you can do. Add an interface useing the GUI, set an IP address for that interface on the host, put the Guest in the same range and you are good to go to test your sites from the webserver. If the webserver need to be able to access other resources like other machines on the network (or other machines need to access the webserver), you need to bridge the connections as described in the manual. If it only needs to access internet too, then you only need to add a second virtual interface on the Guest and set it to NAT.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
nanoander
Posts: 4
Joined: 6. Jun 2008, 21:16

Post by nanoander »

TerryE wrote:The easier option is to stick with the default NAT and read section 6.4.1 of the user guide (hit F1 when you are in the VirtualBox Console to display this). On my VMs I set up as standard

Code: Select all

set SVM=VBoxManage setextradata <<your VM>>
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol  TCP
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort 22 
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort  2222
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestwww/Protocol  TCP
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestwww/GuestPort 80 
%SVM% VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestwww/HostPort  81 
and now http://localhost:81/ browses the VM and I can do SSH based interactive log on and file transfer through localhost port 2222.
Thank you very very much, that works perfect!
Post Reply