Oracle VM VirtualBox Static IP - Fedora

2

I created a Virtual Machine (Linux Fedora) using Oracle VM VirtualBox . The ip address changes every now and then. I want to make it static in the VM.

Update : I was able to setup a static ip address for the VM that can be accessible from the host but now I lost internet connection in the linux VM .

Any ideas?

Thanks

Ricardo Parro

Posted 2012-07-30T22:17:38.090

Reputation: 207

1this is more of a linux question.. just allocate the poor linux a static ip. – None – 2012-07-30T22:22:05.550

how can I do that? I tried to change eth0 and it did not work. – None – 2012-07-30T22:27:36.887

or do you mean the external ip allocated to the vm? you can do that by editing the "network card" from the VM device options. – None – 2012-07-30T22:31:26.497

can you be more specific. I can't see that option – None – 2012-07-30T22:46:26.183

well i dont have virtualbox installed currently , but somewhere there in the gui you can configure the virtual network card and somehow it was possible to use different modes of operation like using the host ip, using a natted ip, using a local ip , or getting one via dhcp and so-on. – None – 2012-07-30T22:48:28.300

well thanks for you help but it's not that easy. thanks anyway – None – 2012-07-30T23:34:26.083

yeah that's pretty easy - just configure DHCP server and than configure fixed ip leases based on MAC Addresses ;) – hovanessyan – 2012-07-30T23:48:49.610

I did that it worked for a bit then when I restarted the VM other IP was attributed on DHCP Server ... – Ricardo Parro – 2012-07-31T00:02:37.767

Answers

1

It depends on what you want to do. If you want to give the guest OS an IP in the same network as the HOST OS you can use the "bridged" Networking mode. Check the Virtual Networking chapter of the Virtualbox User Manual

Borislav Sabev

Posted 2012-07-30T22:17:38.090

Reputation: 138

I am using Windows 7 as a Host OS and the VM is a Fedora12. I am using a bridged networking mode but the ip keeps changing. Any idea why? – Ricardo Parro – 2012-07-31T12:23:50.323

What does "it keeps changing" mean? If you're using DHCP in the Fedora box it may change if the router issues you a new IP. This really depends on the configuration of your local network and networking environment. – Borislav Sabev – 2012-07-31T12:41:41.207

I am using a wireless router at home. I setup a reserved ip with the mac address for the virtual machine and even with this setup when I turn the virtual machine on the ip address chages time to time. I also edit the eth0 file witht he settings to handle an static ip. After this I have a fixed IP address but no internet connection. I can access my virtual machine from my host using an IP that does not change but I do not have a internet connection on the Virtual machine which is really weird. – Ricardo Parro – 2012-08-02T09:08:23.990

Your wifi card on the host is not eth0 it is most probably wlan0 or eth1 (if you have a cable interface which should be your case). You should go to the machine settings, network panel and configure the virtual machine network interface to be bridged to your wifi interface. – Borislav Sabev – 2012-08-02T10:33:07.877