Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a web (development) server on my Virtualbox (Ubuntu 11.1). I'm moving around a lot and thus I get various IP addresses on my computer.

Each time I get a new IP adr I have to change various config settings to get my site up and going.

Is there a way that I can set "permanent" IP address on my VB and somehow route all trafic to my laptop?

share|improve this question

migrated from Feb 1 '12 at 12:40

This question came from our site for system and network administrators.

Is this not just a case of setting a staic IP in the Ubuntu Guest? – tombull89 Feb 1 '12 at 9:36
no, because I need to get out on the net from the dev server. – Steven Feb 1 '12 at 9:52
Please explain which config settings you need to change. You should be able to achieve what you need with DNS. – Paul Feb 1 '12 at 12:43

I had the same problem (VirtualBox 4.1.10, Host Ubuntu 11.10, Guest Ubuntu 11.10). Here's how I fixed it:

Set two network interfaces for the VM. The first one should be NAT and the second should be Host-Only. If you can't add a host-only connection, make sure you've set one up in Preferences -> Network.

In the Guest OS (Ubuntu for me), edit /etc/network/interfaces, adding the following on the end:

auto eth1 # this refers to the Host-only network interface
iface eth1 inet static
address # Arbitrary IP address

and reboot. And that's it. Don't modify anything for eth0, since we need that getting it's settings automatically via DHCP to access the internet. eth1 lets the host and guest communicate with eachother.

share|improve this answer

You can change your VB Guest IP to static by modifying these files.

vim /etc/network/interfaces

Add these lines at the end:

auto eth0
iface eth0 inet static

For DNS Setting

vim /etc/resolv.conf

and add:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .