[RESOLVED]How to get ip 192.168.0.x on gues

Discussions related to using VirtualBox on Windows hosts.
Post Reply
gurmnagne
Posts: 52
Joined: 14. Aug 2009, 06:58
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Centos

[RESOLVED]How to get ip 192.168.0.x on gues

Post by gurmnagne »

VED]My box is cetos 5.3 x86 as guest and windows 7 x64 as host.

I have selected network adapters with bridged, host_only, nat, internal....., but I could not get 192.168.0.x ip on eth0.

For my whole network setting, I need guest os' Ip should be 192.168.0.x.

How to get ip 192.168.0.x on guest on virtualbox?

Any comment would be appreciated.
Last edited by gurmnagne on 18. Aug 2009, 13:27, edited 1 time in total.
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Re: How to get ip 192.168.0.x on guest ?

Post by baf »

Nat (almost)always uses 10.0.2.15 and is not visible to the net. If you need something else use bridged.
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
gurmnagne
Posts: 52
Joined: 14. Aug 2009, 06:58
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Centos

Re: How to get ip 192.168.0.x on guest ?

Post by gurmnagne »

baf wrote:Nat (almost)always uses 10.0.2.15 and is not visible to the net. If you need something else use bridged.
baf/ Thanks for your kind comment.

I changed network adapter to Bridged Mode, and run VBoxLinuxAdditions-x86.run. But I could not connect to internet.
What am I missing?

The result of ifconfig and ping is here.
[root@localhost vboxadditions]# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:25:D6:47
inet addr:192.168.0.7 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe25:d647/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:150 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:31144 (30.4 KiB)
Base address:0xd010 Memory:f0000000-f0020000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3631 errors:0 dropped:0 overruns:0 frame:0
TX packets:3631 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5613892 (5.3 MiB) TX bytes:5613892 (5.3 MiB)

[root@localhost vboxadditions]# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.7 icmp_seq=1 Destination Host Unreachable
From 192.168.0.7 icmp_seq=3 Destination Host Unreachable
From 192.168.0.7 icmp_seq=4 Destination Host Unreachable
From 192.168.0.7 icmp_seq=5 Destination Host Unreachable
From 192.168.0.7 icmp_seq=6 Destination Host Unreachable
From 192.168.0.7 icmp_seq=7 Destination Host Unreachable

--- 192.168.0.1 ping statistics ---
9 packets transmitted, 0 received, +6 errors, 100% packet loss, time 8311ms
, pipe 4
[root@localhost vboxadditions]#
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: How to get ip 192.168.0.x on guest ?

Post by Sasquatch »

Did you select the right Host adapter to use on the bridged network? It won't do much good if you select your wired NIC when using wireless. Assuming you set the IP manually, try DHCP instead. Your router should provide your network with IP addresses and you can test connectivity this way perfectly.
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.
gurmnagne
Posts: 52
Joined: 14. Aug 2009, 06:58
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Centos

Re: How to get ip 192.168.0.x on guest ?

Post by gurmnagne »

Sasquatch wrote:Did you select the right Host adapter to use on the bridged network? It won't do much good if you select your wired NIC when using wireless. Assuming you set the IP manually, try DHCP instead. Your router should provide your network with IP addresses and you can test connectivity this way perfectly.
Sasquatch/ Thanks for your kind replies.

I'll change DHCp and reboot, then post result here.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: How to get ip 192.168.0.x on guest ?

Post by Sasquatch »

Also, if you have two NICs and one is for internet, the other is where you share your internet with using Internet Connection Sharing, it won't do the VM any good if you select the internet NIC. You need the NIC that shares the internet, not the shared one (confusing, I know :P).
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.
gurmnagne
Posts: 52
Joined: 14. Aug 2009, 06:58
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Centos

Re: How to get ip 192.168.0.x on guest ?

Post by gurmnagne »

Sasquatch wrote:Also, if you have two NICs and one is for internet, the other is where you share your internet with using Internet Connection Sharing, it won't do the VM any good if you select the internet NIC. You need the NIC that shares the internet, not the shared one (confusing, I know :P).
Sasquatch/ I'm very sorry for letting you know I'm not expert of linux or network.

I selected only one adapter at making centos VM, which is Intel PRO/1000 MT Server with Bridged.
And at centos I call "ifconfig" command, and post here the result.

Also I'm very sorry for my poor english to explain my situation correctly to you.

Let me summary my setting of centos and VM,

1. host lan adpater two, but only one is connected. The dirver name of adapter is Generic Marvell Yukon 88E8056 based Ethernet Controller.

2. guest lan adapter of VM : Intel PRO/1000 MT Server with Bridged

3. centos has two: lo and eth0.

These are all my set up my network between VM and host.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: How to get ip 192.168.0.x on guest ?

Post by Sasquatch »

First, you don't have to be a Linux expert to get the networking straightened out. There are plenty of internet pages that describe how to set up your network. And I was still talking about Windows with the Internet Connection Sharing, but it seems you don't use that, your router just happens to provide the 192.168.0.x range (usually it's 192.168.1.x).

Your English is just fine. I'm no native either, so I make a mistake once in a while. It's still understandable.

1. You have two adapters, are they both the same or are they different (e.g. one is the marvell, and another is a Realtek)? If they are the same, you have to pick the right one. Now the dropdown box might not be big enough to fit the whole name in it, so selecting the other NIC might get you somewhere further.

2. That's fine if you use a router or some sort. Is there a specific reason why you want your VM to be a part of your network? If you want to hook it to the internet, with just access to it, instead of also from it, using NAT will be enough.

3. That's normal. The lo stands for loopback. Windows has it too, you just don't see 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.
gurmnagne
Posts: 52
Joined: 14. Aug 2009, 06:58
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Centos

Re: How to get ip 192.168.0.x on guest ?

Post by gurmnagne »

I' reporting here according to your suggestion - make dynamic.

1. I have 192.168.0.14 at eth0.
(copy and paste suddenly doesn't work.)

2. At centos as guest, browsing internet works fine. Also, ping 192.168.0.14 at guest and host works great.

3. For running xampp on centos as guest, It' very important for making my host and guest network' ip 192.168.0.x.

Sasquatch, thanks for your kind and valuable explanation and advise for solving this problem.
Post Reply