How can I add static IP adress to a virtual machine

I am running a Linux Ubuntu server on a virtual machine. I use VirtualBox for the virtualization. Now I want to give the virtual machine a static IP address. How can O do this? 

Codemaster's picture

You need to add a new device in your router

First of all, go to your VirtualBox settings. There you need to set the connection adapter 1 to "Networkbridge". Then click at advanced to find the MAC address. Please write this number down.

mac address in a vm

After this go to your local router configuration and add a new device. You can do this in the home network settings of your router. There you need to insert the correct MAC address and check the checkbox for assigning a static IP address. After this, you can check the results in your virtual machine. If you run for example Linux Ubuntu then just enter

ip addr

Then you will find the newly allocated IP address to your virtual machine.



Vote the answer: 
No votes yet