Page 1 of 2
VirtualBox as a server?
Posted: 25. Dec 2008, 15:11
by mashcaster
Is it possible to install an OS on VirtualBox and make it act like a server so another installation via VirtualBox can see the other VirtualBox OS?
For example, I want to create 2 VirtualBox OS installations
1: Debian Web Server
2. Debian Desktop
Setup the VM with the website to run PHP and allow the desktop VM to access the other which hosts the website
Is that possible?
Posted: 25. Dec 2008, 17:48
by baf
Yes.
Posted: 25. Dec 2008, 19:23
by mashcaster
baf wrote:Yes.
Excellent. Could you please explain how I can do this?
Posted: 25. Dec 2008, 20:09
by TerryE
mashcaster, welcome to our forum. You might want to take this opportunity to browse the
Forum Posting Guide. This contains some useful tips on how to search for VBox knowledge and how to frame Qs.
The Q that you ask is very open ended. You can't expect someone to write an essay to lay out a comprehensive answer for you. You asked was it possible and the answer is yes. There are lots of topics in this forum which explore the issues. Can I suggest that you use the google search tips to find these topics and explore your options. If you have any specific Q that you can't find answer to then post them here and we can address them.
Posted: 26. Dec 2008, 13:10
by mashcaster
Thanks for the welcome message.
Using your advice, I've done some reading and have installed a basic webserver in virtualbox. So I have debian as a client. Using my host machine (ubuntu), how do I access this guest webserver using a browser.
I am assuming I have to type
http://localhost:
How do I configure this. I have tried searching, but can only find instructions for xp as host.
Posted: 26. Dec 2008, 13:50
by TerryE
Search for Port Forwarding or the keyword GuestPort in the forum or user guide.
Posted: 26. Dec 2008, 13:57
by mashcaster
TerryE wrote:Search for Port Forwarding or the keyword GuestPort in the forum or user guide.
Based on the user manual I did the following from the host after closing down all guest machines
VBoxManage setextradata "Debian Base" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" 8888
VBoxManage setextradata "Debian Base" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" 80
VBoxManage setextradata "Debian Base" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" TCP
After starting the guest machine, I get an error saying
Failed to start virtual machine Debian Base.
Unknown configuration in port forwarding.
Posted: 26. Dec 2008, 14:47
by Sasquatch
Does the VM have it's first NIC attached to NAT and do you use the PCNet adapter?
Posted: 26. Dec 2008, 15:23
by mashcaster
Sasquatch wrote:Does the VM have it's first NIC attached to NAT and do you use the PCNet adapter?
Yes to both questions.
Posted: 26. Dec 2008, 15:57
by mashcaster
I want to start again. How do I remove the lines:
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort, Value: 80
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort, Value: 8888
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol, Value: TCP
Posted: 26. Dec 2008, 16:10
by Hachiman
mashcaster wrote:I want to start again. How do I remove the lines:
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort, Value: 80
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort, Value: 8888
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol, Value: TCP
you can find and edit in ~/.VirtualBox/Machines/<machine name>/<machine name>.xml
Posted: 26. Dec 2008, 16:51
by mashcaster
Hachiman wrote:mashcaster wrote:I want to start again. How do I remove the lines:
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort, Value: 80
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort, Value: 8888
Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol, Value: TCP
you can find and edit in ~/.VirtualBox/Machines/<machine name>/<machine name>.xml
Thanks, I remove the TCP line and it started working?
Anyway, I am now trying to connect to mysql and have made changes to the xml file mentioned above. I get an error when trying connect to the guest mysql server from the host computer.
http://i40.tinypic.com/rsasna.png
I have obviously done something wrong.
You can see the server running in the image, the xml hostport and guest ports for mysql and my attempt to connect to mysql from the host computer using mysql administrator.
Posted: 26. Dec 2008, 21:20
by TerryE
Hachiman wrote:you can find and edit in ~/.VirtualBox/Machines/<machine name>/<machine name>.xml
Yes, but despite this suggestion from one of the dev team, this is not the correct way to delete extradata entries. The correct way is to specify the
name|
UUID and
key but omit the
value. This deletes the entry for this key.
You must specify all three nodes in the mapping (GuestPort, HostPort and Protocol) or it will fail. When you've done this try the VM again and let us know what the VBox.log CFGM enumeration for the
/Devices/pcnet/0/LUN#0/Config key is.
Posted: 26. Dec 2008, 22:18
by Hachiman
TerryE wrote:Hachiman wrote:you can find and edit in ~/.VirtualBox/Machines/<machine name>/<machine name>.xml
Yes, but despite this suggestion from one of the dev team, this is not the correct way to delete extradata entries. The correct way is to specify the
name|
UUID and
key but omit the
value. This deletes the entry for this key.
You must specify all three nodes in the mapping (GuestPort, HostPort and Protocol) or it will fail. When you've done this try the VM again and let us know what the VBox.log CFGM enumeration for the
/Devices/pcnet/0/LUN#0/Config key is.
thank you Terry, of course you right

Posted: 26. Dec 2008, 22:28
by Hachiman
mashcaster wrote:Thanks, I remove the TCP line and it started working?
Anyway, I am now trying to connect to mysql and have made changes to the xml file mentioned above. I get an error when trying connect to the guest mysql server from the host computer.
http://i40.tinypic.com/rsasna.png
I have obviously done something wrong.
You can see the server running in the image, the xml hostport and guest ports for mysql and my attempt to connect to mysql from the host computer using mysql administrator.
What is your Host system wallpapers are very familiar

? and could you please post here you vm configuration and logs.