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

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

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

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?


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.