Page 1 of 1

Host: WinXP SP3 | Guest: Debian Lenny (port forward probs)

Posted: 31. May 2009, 01:00
by cnchybrid
I installed

Host: Win XP SP3
VirtualBox 2.2.4 for Windows hosts x86/amd64
Guest: Linux Debian Lenny
Apache
MySQL
php
phpmyadmin

followed this tutorial: http://www.alexatnet.com/node/200
and fixed phpmyadmin from: http://my.opera.com/subjam/blog/install ... bian-lenny

everything worked well from the Debian Guest http:127.0.0.1 even http://127.0.0.1/phpmyadmin

then i wanted to access these pages from the host machine i.e Win XP

so i shutdown the Guest

and i opened the cmd from windows and ran these commands

cd C:\Program Files\Sun\xVM VirtualBox
VBoxManage setextradata Debian-Web "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" 8888
VBoxManage setextradata Debian-Web "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" 80
VBoxManage setextradata Debian-Web "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" TCP
VBoxManage setextradata Debian-Web "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
VBoxManage setextradata Debian-Web "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22
VBoxManage setextradata Debian-Web "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP


and verified that the entries are done well by

VBoxManage getextradata Debian-Web enumerate

C:\Program Files\Sun\xVM VirtualBox>VBoxManage getextradata "Debian-Web" enumera
te
VirtualBox Command Line Management Interface Version 2.2.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Key: GUI/LastCloseAction, Value: powerOff
Key: GUI/LastWindowPostion, Value: 4,30,720,442
Key: GUI/Fullscreen, Value: off
Key: GUI/Seamless, Value: off
Key: GUI/AutoresizeGuest, Value: on
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort, Value: 8888
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort, Value: 80
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol, Value: TCP
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort, Value: 2222
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort, Value: 22
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol, Value: TCP

I started the Guest O/S again logged in tested for the test web site and worked but wehen i tried to access them from the Host it failed
Firewall is off

i tried

http://127.0.0.1:8888
http://127.0.0.1:8888/phpmyadmin

http://192.168.56.1:8888
http://192.168.56.1:8888/phpmyadmin

192.168.56.1 (ip assigned to the VirtualBox)


Also tried to use putty for ssh and connection was refused

Can anyone help me with this ? and tell me what to check for cause am really confused if you need aditional info ask and I will provide

Thanks in Advance

Re: Host: WinXP SP3 | Guest: Debian Lenny (port forward probs)

Posted: 31. May 2009, 01:03
by cnchybrid
Ok after a restart it worked so its not a problem anymore 8) consider this as a Description of how to do it

Re: Host: WinXP SP3 | Guest: Debian Lenny (port forward probs)

Posted: 31. May 2009, 01:20
by Sasquatch
Did you by chance also add Host-Only? Because 192.168.56.1 is that adapter. You could have accessed your VM through that too ;). But it works, that's all that matters.

Re: Host: WinXP SP3 | Guest: Debian Lenny (port forward probs)

Posted: 31. May 2009, 17:56
by cnchybrid
Sasquatch wrote:Did you by chance also add Host-Only? Because 192.168.56.1 is that adapter. You could have accessed your VM through that too ;). But it works, that's all that matters.

hmm am not sure but Network setting is NAT if that what you wanted to know

Re: Host: WinXP SP3 | Guest: Debian Lenny (port forward probs)

Posted: 31. May 2009, 18:02
by cnchybrid
The same setup worked fine for Guest Ubuntu 8.04 on the very same windows XP
These are the instructions I have entered in Ubuntu terminal

sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart
sudo apt-get install mysql-server
sudo apt-get install php5-mysql

Make phpmyadmin available in Apache

cd /
cd etc
cd apache2
sudo vi apache2.conf

paste near the includes

Include /etc/phpmyadmin/apache.conf

restart Apache


Remember the port forwarding must be done also from the VirtualBox so as for the websites to be accessed from the host.

If one wishes the site to be accessed from outside world check the firewall and port forwarding from the router (if u have one)

I hope this is of use

Regards