# VirtualBox/RancherOS with fixed ip

**URL:** <https://forums.suse.com/t/virtualbox-rancheros-with-fixed-ip/1347>\
**Category:** RancherOS\
**Created:** [December 28, 2015, 11:43pm UTC](https://forums.suse.com/t/virtualbox-rancheros-with-fixed-ip/1347 "2015-12-28T23:43:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielmischler](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@danielmischler](https://forums.suse.com/u/danielmischler)\
**Post date:** [December 28, 2015, 11:43pm UTC](https://forums.suse.com/t/virtualbox-rancheros-with-fixed-ip/1347/1 "2015-12-28T23:43:25Z")

</div>

I’m new to Rancher and RancherOS and try to do some testing with it.

Having a machine running on Debian (3.16) and VirtualBox (5.0.10) I created VMs using docker machine with boot2docker. I was able to get a rancher-server (192.168.99.60) and some host-0x (192.168.99.6x) running.

Since there seems to be an issue with duplicate hosts after reboots ([https://github.com/rancher/rancher/issues/936#issuecomment-109722750](https://github.com/rancher/rancher/issues/936#issuecomment-109722750)) I want to use the latest RancherOS. But now I can not figure out a way to set a fixed ip for the VMs (tried sudo ros config set rancher.network.interfaces.eth0.address … etc).

What am I missing?

Thanks for your help  
Daniel

---

<div class="post-metadata">

**Author:** ![imikushin](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/imikushin/32/17_2.png) [@imikushin](https://forums.suse.com/u/imikushin)\
**Post date:** [January 6, 2016, 6:18pm UTC](https://forums.suse.com/t/virtualbox-rancheros-with-fixed-ip/1347/2 "2016-01-06T18:18:49Z")

</div>

So, what you actually need is assign 2 NICs to the RancherOS VM on VirtualBox:

- eth0: NAT - for Internet access
- eth1: host-only network - for communication between the host and the VMs

To do that, you need to create a host-only network in VirtualBox, configure the IP address range and (optionally) DHCP and choose it for NIC #2 on all RancherOS VMs you want in one virtual network.

If you want, you can configure RancherOS to use static IP on eth1:

```bash
sudo ros config set rancher.network.interfaces.eth1.address "172.19.8.101/24"

```

and reboot or just restart networking, like this:

```bash
sudo system-docker restart network

```

---

<div class="post-metadata">

**Author:** ![imikushin](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/imikushin/32/17_2.png) [@imikushin](https://forums.suse.com/u/imikushin)\
**Post date:** [January 6, 2016, 6:22pm UTC](https://forums.suse.com/t/virtualbox-rancheros-with-fixed-ip/1347/3 "2016-01-06T18:22:06Z")

</div>

BTW, don’t use 172.17.\*, 172.18.\*, 10.0.2.\* IP addresses on eth1 or you will suffer!

---

<div class="post-metadata">

**Author:** ![LynxDev](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/lynxdev/32/3769_2.png) [@LynxDev](https://forums.suse.com/u/LynxDev)\
**Post date:** [March 3, 2018, 8:01pm UTC](https://forums.suse.com/t/virtualbox-rancheros-with-fixed-ip/1347/4 "2018-03-03T20:01:00Z")

</div>

Good information!  
One addition is to also disable dhcp. On the current version dhcp was set to true and that overrode the address setting.  
`sudo ros config set rancher.network.interfaces.eth1.dhcp false`
