How to install OSM on VirtualBox

From OSM Public Wiki
Jump to: navigation, search

Deprecated: Please refer to


VirtualBox has different networking setup modes (see Table 6.1)

In case we want to install OSM on VirtualBox, it needs an IP address that remains the same across reboots.

If the host is attached to DHCP and you cannot access the router to assign the same IP to your VMs, "bridged" mode could be difficult to manage. So, a possible alternative is to have two network adapters: one NAT that allows the VMs to access Internet + one Host-Only that allows static address on the VM and traffic from Host to VM.

OSM can be configured like that using the procedure below, tested on OSM Rel THREE.

1) Create a VM on VirtualBox (e.g. 8GB RAM, 40GB DISK)

2) Configure network with 2 adapters: NAT + Host-Only

3) Install OpenSSH server (sudo apt-get install openssh-server) and update Ubuntu (sudo apt-get update)

4) Add a static address to the "Host-only" adapter (e.g. enp0s8 with static IP, e.g. appending the following to "/etc/network/interfaces":

auto enp0s8
iface enp0s8 inet static

5) Restart the network services, then the VM should be reachable in ssh from the host using the static IP address

sudo service networking restart

6) Configure LXD following the instructions: OSM Release THREE LXD config

7) Install OSM following the instructions: OSM Three install

chmod +x

8) Before launching the installation, modify, find export_ips (2 times!), and add a line afterwards with:

export DEFAULT_IP= 

where DEFAULT_IP is the static IP address configured for host-only network)

9) Install OSM


10) When the installation is over, a final step to configure NAT

git clone temp
vi temp/installers/export_ips
#Change the DEFAULT_IF to DEFAULT_IF=enp0s8 (the interface used for Host-only network configuration)
sudo ./temp/installers/nat_osm      # in order to apply NAT rules

11) Check NAT rules in "/etc/iptables/rules.v4".

12) Access OSM GUI using (admin/admin). You can also ssh to the Virtualbox VM running OSM (ssh ubuntu@