1

I have a Windows 7, 32bit, HP Laptop. I have CentOs 6.5 running on VirtualBox 4.3.10.

Here is my eth0 config.

Code:

#vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=08:00:27:81:0F:EA
TYPE=Ethernet
UUID=65c5766b-b165-4f76-bb92-420a190b7bdc
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp
#IPADDR=#some ip here

So things work fine by doing that, I can access my local machine, share folders with samba and all.. The problem Says, if I wanted to download packages, like yum install php then I must make adapter 1 NAT it does not matter what Adapter 2 is set. Doing this I can download and install packages but can't access my localhost. The interesting part is that if I do ifconfig during this time, I can see inet addr 10.0.2.15 I can't access my projects with http:// 10.0.2.15 even after modifying hosts.

Now, if I switch Adapter 1 to Host Only, then my ip gets restored and I can use that ip http://... then I can access my project files. But during this time, I can not install any packages, and trying to do so will give me one of those mirror not found errors.

I thought I could get around by this doing, multiple adapters (giving adapter 1 NAT then adapter 2 Host Only) and vise versa, but it won't work.

How can I resolve this problem to be able to install packages and see use my host at the same time?

2
  • No, you don't need two adapters. You do need to understand how IP addresses are assigned by DHCP and what the differences between Host Only, NAT, and whatever the direct connection option in virtual box are though. If you give us the full information about the IP addresses assigned to your VM during each different configuration we can probably tell you more but the answer is almost certainly that your local 10.0.2.15 address is the NAT assigned address and when you change the device type or add the second device you no longer have that IP address on the VM. Apr 3, 2014 at 14:26
  • @EtanReisner thank you for your response I have added a detailed question for my problem. Please take a look. Thanks
    – Bimlik
    Apr 6, 2014 at 7:32

0

You must log in to answer this question.

Browse other questions tagged .