Page 1 of 1

Problems in assigning IP addresses to virtual machines.

Posted: 28. Aug 2009, 10:22
by raheel213
Hello to all,

I am using Ubuntu Jaunty and Virtual Box 3.0.4. I have problems ins assigning IP address to my virtual machine.

The details are as under,
1-For red Hat i need to give IP 192.168.0.3
2-For Fedora Code i need to give 192.168.0.4
3-For Windows XP i need to give 192.168.0.5

I tried many combinations with Bridge, Inter networking and host only networking options. Static and dynamic settings but nothing works according to my requirement. Can any one suggest me how to achieve this.


Regards,
RAHEEL.

Re: Problems in assigning IP addresses to virtual machines.

Posted: 28. Aug 2009, 10:56
by vbox4me2
1 posted per topic(duplicate has been removed)

Look at what the Host is using as IP,mask and gateway, each VM uses the same apart from its main IP.

Re: Problems in assigning IP addresses to virtual machines.

Posted: 28. Aug 2009, 11:05
by raheel213
The host is using 172.20.105.30, Is there any way that i can assign my required IP to the machines installed in virtual box. I need that these machines can do ping to each other. I welcome your valuable suggestions.

Regards,
RAHEEL

Re: Problems in assigning IP addresses to virtual machines.

Posted: 28. Aug 2009, 11:14
by vbox4me2
You can't mix a 192.* with a 172.* and expect them to see each other. Using a second subnet requires additional routes or a second router in order to route traffic from the other subnet.

Re: Problems in assigning IP addresses to virtual machines.

Posted: 28. Aug 2009, 11:35
by raheel213
No i only need that machines that are installed in Virtual box which are red Hat (IP 192.168.0.3), Fedora Core(192.168.0.4), Windows XP (192.168.0.5) can do ping to each other.

Re: Problems in assigning IP addresses to virtual machines.

Posted: 28. Aug 2009, 11:51
by vbox4me2
Remove the gateway from all Guests.

Re: Problems in assigning IP addresses to virtual machines.

Posted: 28. Aug 2009, 13:39
by raheel213
In the latest version of the Virtual Box 3.0.4 there is no option for removing the gateway, in fact i have not mentioned the gateway anywhere. In the other machines i have not assign IP statically. Actually on Fedora and XP i can assign IPs statically and that works fine but on Red Hat i do not have rights, so i want to assign IP. I need to assign it dynamically via DHCP. That is the problem. I wanted to explain you.

Re: Problems in assigning IP addresses to virtual machines.

Posted: 28. Aug 2009, 20:50
by Sasquatch
Hook them up to Host-Only, set the IP configuration in the VB preferences to what you need, enable the DHCP server with the right range and attach the VMs to the Host-Only adapter. That should get things working. All VMs can use DHCP.

Now, if you don't want to do it this way, you set Internal Networking for each VM and assign all IPs statically. That means IP and netmask, nothing more.

Re: Problems in assigning IP addresses to virtual machines.

Posted: 2. Sep 2009, 10:44
by raheel213
I have tried both the option, the first with Host only: The problems are as under,

Every time the windows machine gets 192.168.0.3 and the Fedora Core gets 192.168.0.5 and in the File--->preferences--->Network in IP settings it adds automatically 192.168.56.1. Whic are not my requirements.

When i used static IPs the windows and fedora pings each other successfully but with Red Hat ping does not work. What are your suggestions now.

Regards,
RAHEEL.

Re: Problems in assigning IP addresses to virtual machines.

Posted: 2. Sep 2009, 14:21
by Sasquatch
As I stated, you can change the range the Host-Only adapter has and provides over DHCP. The only concern I have, is that the range you provided in your post, 192.168.0.x, can cause conflicts on your physical network. I hope that it's a different range, like 192.168.1.x. Everything should be good to go once you've set the right settings.
With the DHCP server on Host-Only, the IP addresses are served in order of first come first serve. A range giving IPs from .3 - .8 will give the VM that does a DHCP request first the IP 3, the next gets 4, etc.