Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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