1

My router is set to have computers IP range from 10.1.1.1 to 10.1.1.60 I'm trying to run Linux in virtual box in a host computer with windows 7.

The host computer has 10.1.1.5 currently, which is dynamic, set by DHCP on the router. The command, ipconfig, on the host computer shows the VirtualBox host only IP address 192.168.56.2 and Linux in it was well connected to the network.

But later I changed the IP address of Linux as static 10.1.1.16 using vim /etc/network/interfaces. Then in the host computer's network configuration settings, I changed the IP address of VirtualBox as 10.1.1.16.

Now my Linux is no longer connecting to the network. I'm new to this and am attempting to learn how these things work. Please help in showing me, what did I do wrong?

3

Because you set your virtual machine network card in Host-only mode, so only your host computer(and another VMs that in Host-only mode) can see your current virtual machine. External machine can't.

In your case, you should set the virtual machine netword card to Bridged Adapter, meaning it will access your physical network the same way your host computer does.

Then it will receive IP from DHCP, and can communicate with others machine in your network.

  • Note to OP, you'll have to do ifconfig eth<n> down ifconfig eth<n> up to refresh your IP – cutrightjm Jan 8 '14 at 10:11
  • I did exactly the same and it worked. Thanks Gnouc and Ekaj – user2439565 Jan 9 '14 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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