Page 1 of 1

Put a static IP address on Virtualbox

Posted: 16. Apr 2021, 18:17
by nordinez
Hi does anyone know how to put a static up address on a VM and is it useful because I checked and I already have the same subnet in my vm and my "real" pc
My real pc used Windows and my VM Ubuntu 18.04

Re: Put a static IP address on Virtualbox

Posted: 16. Apr 2021, 19:13
by mpack
I already answered this in your "Using VirtualBox" cross post (which I have now deleted):
That is a guest OS question, not a VirtualBox question. If the guest OS does not ask for an IP address assignment, it will not receive one. What it uses instead is up to the guest OS. Whether what it uses instead works is up to the network you attach the VM to. Every guest OS has different tools for network config.

But... if you need to ask this question then perhaps you should leave automated address assignment alone...
You can't assign a static IP to a VM, the guest OS has to do that for itself. As mentioned in the quote, you need to use guest tools to assign a static IP. In Windows guests you simply disable "Automatically request an IP address" on the NIC interface, and then type in some manual numbers.

I will move this topic to "Linux Guests", as the question does not concern any feature of your Windows Host.

Re: Put a static IP address on Virtualbox

Posted: 16. Apr 2021, 19:18
by mpack
Perhaps you should explain why you believe you need a static IP address.

Also, I hope you understand that this address will not be seen outside your home network, so it will not affect how the outside world treats the VM.