Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have two VMs(Ubuntu) in virtualbox and I wanna assign the first one 10.0.3.15 and the other one 10.0.3.14. But when I set network type to NAT the network adresses are different, 10.0.3.15 and 10.0.4.15.

Even when I change the range, one of them to another one statically in Ubunutu I can not ping another one.

I could not find any solution over the Internet!

share|improve this question

1 Answer 1

NAT mode will not let you do that. In this mode:

The "router", in this case, is the VirtualBox networking engine, which maps traffic from and to the virtual machine transparently. In VirtualBox this router is placed between each virtual machine and the host. This separation maximizes security since by default virtual machines cannot talk to each other.

Note there's an isolation between each virtual machine, so they will be unable to connect to each other.

What you need is to configure your virtual machines (go to settings, network, look at the network modes) to use either internal networking or host-only networking.

Internal networking will allow virtual machines to communicate only with other virtual machines. Host-only networking will also allow VMs to communicate with the host system.

Read here about what each mode does and how to configure them:

http://www.virtualbox.org/manual/ch06.html

  1. configure both your virtual machines' networks to be "Internal network". Select "eth0" for "attached to" (this means the VM's network interface that will be connected to this network) and select the same "name" for the network (think of each name as a "hub" to which virtual machines are connected). The default of intnet is fine.
  2. Boot your VMS, and manually assign IP addresses. I tried with 10.0.0.1 for one and 10.0.0.2 for the other.
  3. You should be able to ping 10.0.0.1 from 10.0.0.2. It works for me!
share|improve this answer
    
I read the instruction that you mentioned so there is not straightforward solution, i have to use 2 NICs for my purpose. By the way thank you for your answer. –  Anna Feb 6 '13 at 15:02
    
NOOOO you don't need two NICs for the VMS to talk to each other, see the updated answer. –  roadmr Feb 6 '13 at 15:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.