Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I allocate a fixed IP address for a guest Ubuntu Server 12.04 running in VirtualBox ?

I've seen this question but it doesn't address using Bridged.

The vm is currently getting an IP in the range 192.168.10.x and I want it always to be 192.168.10.99.

Thanks

share|improve this question
    
You could literally copy and paste that answer but substitute 'Host-only' for 'Bridged'. –  Tanner Jul 31 '12 at 23:44
    
Does the VM get its IP address via DHCP from the router? If so, what model router is it? –  Paul Aug 1 '12 at 6:55
add comment

1 Answer

When you give a VM a Bridged Adapter, its affectingly like giving it its own NIC connected directly to your network.

The Ubuntu installation inside of the VM needs to be set to use a static IP address. This is done in the /etc/network/interfaces file. Some information about the interfaces file can be found on this page: https://help.ubuntu.com/12.04/serverguide/network-configuration.html

Here is an example interfaces file configured to match your question:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.10.99
        netmask 255.255.255.0
        broadcast 192.168.10.255
        network 192.168.10.0
        gateway 192.168.10.1

After making modifications to /etc/network/interfaces, restart your VM for the changes to take effect.

share|improve this answer
    
Works perfectly! +1 –  nothing-special-here Jun 22 '13 at 18:29
add comment

Your Answer

 
discard

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.