Local IP of Debian

Discussions related to using VirtualBox on Linux hosts.
Post Reply
chrislabricole
Posts: 20
Joined: 4. Aug 2008, 14:02

Local IP of Debian

Post 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 ;)
greenpossum
Volunteer
Posts: 98
Joined: 11. Jul 2008, 08:10

Re: Local IP of Debian

Post 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?
chrislabricole
Posts: 20
Joined: 4. Aug 2008, 14:02

Post 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 :)
greenpossum
Volunteer
Posts: 98
Joined: 11. Jul 2008, 08:10

Post 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.
chrislabricole
Posts: 20
Joined: 4. Aug 2008, 14:02

Post by chrislabricole »

Ok, can you explain how I can create forwardings ? or give me a link ?

Thanks for your helping :)
greenpossum
Volunteer
Posts: 98
Joined: 11. Jul 2008, 08:10

Post 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.
chrislabricole
Posts: 20
Joined: 4. Aug 2008, 14:02

Post by chrislabricole »

I have searched on the documentation but I haven't found :oops:
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

Section 6.4.1 describes it.
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.
chrislabricole
Posts: 20
Joined: 4. Aug 2008, 14:02

Post by chrislabricole »

Ok, thanks you :)
But that doesn't explain how I can do for my request :?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post 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'.
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.
chrislabricole
Posts: 20
Joined: 4. Aug 2008, 14:02

Post by chrislabricole »

What's the command which be must typed ? and where ? :roll:
Thanks :)
chrislabricole
Posts: 20
Joined: 4. Aug 2008, 14:02

Post by chrislabricole »

No solution for resolve this problem ? :?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post 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).
Last edited by Sasquatch on 7. Aug 2008, 22:39, edited 1 time in total.
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.
chrislabricole
Posts: 20
Joined: 4. Aug 2008, 14:02

Post by chrislabricole »

Ok, but I haven't understand this command :roll:
Where I have to enter this command ?

Thanks
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

Since you are on Linux, just run it from anywhere. Else give the full path to the VBoxManage command.
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.
Post Reply