Server Fault is a question and answer site for system and network administrators. 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 am using Ubuntu as guest on VirtualBox on my Windows 7 host machine as web server for my PHP/Ruby projects.

I set networking in VirtualBox setting to 'bridge' so now I can access my VirtualBox server by something like - it is generated by DHCP every time so it is not static.

Is it possible to make it static or get VirtualBox IP in Windows so I could set 'virtualbox' in hosts in Windows and go in browser to 'Virtualbox' address as I can go 'localhost'?

share|improve this question

closed as off-topic by Ward, womble Nov 30 '15 at 5:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

On your Ubuntu guest edit /etc/network/interfaces you'll see something like this

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

change it to be similar to this

iface eth0 inet static

using parameters that make sense in your network. Restart networking with

/etc/init.d/networking restart
share|improve this answer

On ubuntu guest set the static ip-address by editing the file /etc/network/interfaces

auto eth0
iface eth0 inet static
gateway windows-machine-ip-adress

And also, place the ip-address of windows machine in resolv.conf.

resolv.conf file typically contains directives with the IP addresses of nameservers available to a host.

#vim /etc/resolv.conf

nameserver windows-machine-ip-address

And restart the network service.

share|improve this answer

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