Page 1 of 1
Local IP of Debian
Posted: 4. Aug 2008, 14:45
by chrislabricole
Hi all,
Sorry for my english if it's bad...
I've got a problem with Linux systems work with VirtualBox.
I have installed Debian (the latest version) and why I see the configuration of connection, the local IP is
10.0.2.15, the OS are not connected on my router...
I have tried to change this IP configurations but it can't connect at the router

=> the Internet doesn't work...
How I must change in VirtualBox or Debian ?
Router's IP address (gateway) : 192.168.0.254
Subnet Mask : 255.255.255.0
and I want the IP : 192.168.0.10 (for be connected on the router)
Thanks by advance of your helping

Re: Local IP of Debian
Posted: 4. Aug 2008, 15:28
by greenpossum
That 10.0.2.15 is not a problem, Virtualbix is working normally in NAT mode. This means that packets from the guest are translated to look like they came from the host. So you don't need to change anything.
Rather than get stuck on this IP, tell us what is it that is not working for you in the guest Debian?
Posted: 4. Aug 2008, 15:58
by chrislabricole
in fact, I want to make a server (HTTP) in Debian, but I can't accessed with the computer which host Debian (VirtualBox on windows)....
If I type in the FireFox address bar : 10.0.2.15, I have got an error

I have verified if the HTTP server work really : I have typed
localhost in FireFox address bar in Debian and I get "It works!"...
What's the solution to access on the Debian HTTP server with other computer of my network ?
Thanks

Posted: 4. Aug 2008, 17:19
by greenpossum
chrislabricole wrote:What's the solution to access on the Debian HTTP server with other computer of my network ?
Thanks

You create a port forwarding from the host OS to the guest OS. The situation is very much like giving access to a service behind a NAT firewall. The User Manual explains how to create forwardings.
Naturally there are limitations to forwarding, like you have to use an unused port on the host and you cannot forward ports under 1024. If you cannot live with those restrictions then there Host Interface Networking aka bridging. But that is more complex to set up.
Posted: 4. Aug 2008, 17:37
by chrislabricole
Ok, can you explain how I can create forwardings ? or give me a link ?
Thanks for your helping

Posted: 4. Aug 2008, 17:44
by greenpossum
chrislabricole wrote:Ok, can you explain how I can create forwardings ? or give me a link ?
Thanks for your helping

It's all explained in the fine User Manual on the website.
Posted: 4. Aug 2008, 18:53
by chrislabricole
I have searched on the documentation but I haven't found

Posted: 4. Aug 2008, 19:53
by Sasquatch
Section 6.4.1 describes it.
Posted: 4. Aug 2008, 20:10
by chrislabricole
Ok, thanks you

But that doesn't explain how I can do for my request

Posted: 4. Aug 2008, 20:16
by Sasquatch
Why not? All it does it giving an example. You only have to change the command slightly so it fits for your situation. So instead of forwarding 2222 to 22, you can forward 8080 to 80, and use 'webserver' as description instead of 'guestssh'.
Posted: 4. Aug 2008, 20:27
by chrislabricole
What's the command which be must typed ? and where ?

Thanks

Posted: 7. Aug 2008, 20:25
by chrislabricole
No solution for resolve this problem ?

Posted: 7. Aug 2008, 21:03
by Sasquatch
Lazy bum. I'm quoting the section of the UM mentioned above and bold the command. The command location should be obvious and can also be found in the manual (section 8).
6.4.1 Con?guring port forwarding with NAT
As the virtual machine is connected to a private network internal to VirtualBox and invisible to the host, network services on the guest are not accessible to the host machine or to other computers on the same network. However, VirtualBox can make given services available outside of the guest by using port forwarding. This means that VirtualBox listens to certain ports on the host and resends all packages which arrive on them to the guest on the ports used by the services being forwarded. To an application on the host or other physical (or virtual) machines on the network, it looks as though the service being proxied is actually running on the host (note that this also means that you cannot run the same service on the same ports on the host). However, you still gain the advantages of running the service in a virtual machine – for example,
services on the host machine or on other virtual machines cannot be compromised or crashed by a vulnerability or a bug in the service, and the service can run in a different operating system to the host system.
You can set up a guest service which you wish to proxy using the command line tool VBoxManage. You will need to know which ports on the guest the service uses and to decide which ports to use on the host (often but not always you will want to use the same ports on the guest and on the host). You can use any ports on the host which are not already in use by a service. An example of how to set up incoming NAT
connections to a ssh server on the guest requires the following three commands:
VBoxManage setextradata "Linux Guest" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "Linux Guest" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "Linux Guest" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
The name guestssh is an arbitrary one chosen for this particular forwarding con?guration. With that con?guration in place, all TCP connections to port 2222 on the host will be forwarded to port 22 on the guest. Protocol can be either of TCP or UDP (these are case insensitive). To remove a mapping again, use the same commands, but leaving out the values (in this case TCP, 22 and 2222).
It is not possible to con?gure incoming NAT connections while the VM is running. However you can change the settings for a VM which is currently saved (or powered off at a snapshot).
Posted: 7. Aug 2008, 22:02
by chrislabricole
Ok, but I haven't understand this command

Where I have to enter this command ?
Thanks
Posted: 7. Aug 2008, 22:39
by Sasquatch
Since you are on Linux, just run it from anywhere. Else give the full path to the VBoxManage command.