DEV Community

Cover image for Experiment: Running IaaS Cloud Inside Container

Experiment: Running IaaS Cloud Inside Container

manish srivastava
Director & CEO, GDP CHURN (P) Ltd. Loves coding . Supports open source by funding.
・4 min read

In this experiment, I am trying to build an IaaS inside container.Better to name -"container cloud".

If you don't know about different types of clouds, please visit my post :

Different types of Clouds:


Common Examples of SaaS, PaaS, & IaaS:

SaaS:Google Apps, Dropbox, Salesforce, Cisco WebEx, Concur, GoToMeeting
PaaS:AWS Elastic Beanstalk, Windows Azure, Heroku,, Google App Engine, Apache Stratos, OpenShift
IaaS:DigitalOcean, Linode, Rackspace, Amazon Web Services (AWS), Cisco Metapod, Microsoft Azure, Google Compute Engine (GCE)

There are different types of containers and their pros & cons. you can get some details here :

Alt Text

I am choosing LXC!!! why?

  • nearest like VM , its VE.
  • Allows iptables -easy like VM. For IaaS , I am choosing Opennebula. My these two articles can help you to understand more about opennebula:


STEP-1: Download and run lxd. New to containers? or LXD? learn here:

STEP-2: Download and run Opennebula.(
c1 is my container.
If you have kvm enabled host then try kvm / firegate else lxc minions script.

root@vmi307975:~#lxc launch ubuntu:18.04 c1 -c security.privileged=true -c security.nesting=true
root@vmi307975:~# lxc exec c1 bash
root@c1:~# wget ''
root@c1:~# sudo bash minione --force

### Checks & detection
Checking cpu virtualization capabilities  SKIP QEMU will be used
Checking augeas is installed  SKIP will try to install
Checking free disk space  IGNORE
Checking apt-transport-https is installed  SKIP will try to install
Checking AppArmor  SKIP will try to modify
Checking for present ssh key  SKIP
Checking (iptables|netfilter)-persistent are installed  SKIP will try to install

### Main deployment steps:
Install OpenNebula frontend version 5.12
Configure bridge minionebr with IP
Enable NAT over eth0
Modify AppArmor
Install OpenNebula KVM node
Export appliance and update VM template
Install  augeas-tools apt-transport-https iptables-persistent netfilter-persistent

Do you agree? [yes/no]:

### Installation
Updating APT cache  OK
Install  augeas-tools apt-transport-https iptables-persistent netfilter-persistent  OK
Creating bridge interface minionebr  OK
Bring bridge interfaces up  OK
Configuring NAT using iptables  OK
Saving iptables changes  OK
Installing DNSMasq  OK
Starting DNSMasq  OK
Configuring repositories  OK
Updating APT cache  OK
Installing OpenNebula packages  OK
Installing OpenNebula kvm node packages  OK
Updating AppArmor  OK
Disable default libvirtd networking  OK
Restart libvirtd  OK

### Configuration
Switching OneGate endpoint in oned.conf  OK
Switching OneGate endpoint in onegate-server.conf  OK
Switching keep_empty_bridge on in OpenNebulaNetwork.conf  OK
Switching scheduler interval in oned.conf  OK
Switching to QEMU emulation  OK
Setting initial password for current user and oneadmin  OK
Changing WebUI to listen on port 80  OK
Starting OpenNebula services  OK
Enabling OpenNebula services  OK
Add ssh key to oneadmin user  OK
Update ssh configs to allow VM addresses reusig  OK
Ensure own hostname is resolvable  OK
Checking OpenNebula is working  OK
Disabling ssh from virtual network  OK
Adding localhost ssh key to known_hosts  OK
Testing ssh connection to localhost  OK
Updating datastores template  OK
Creating KVM host  OK
Creating virtual network  OK
Exporting [CentOS 7] from Marketplace to local datastore  OK
Waiting until the image is ready  OK
Updating VM template  OK

### Report
OpenNebula 5.12 was installed
Sunstone [the webui] is running on:
Use following to login:
  user: oneadmin
  password: j27h253eBi
root@c1:~# sudo apt-get update && sudo apt-get upgrade -y
Hit:1 bionic InRelease
Hit:2 bionic-security InRelease
Hit:3 bionic-updates InRelease
Hit:4 bionic-backports InRelease
Ign:5 stable InRelease
Hit:6 stable Release
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@c1:~# exit
root@vmi307975:~# lxc config device add c1 myport80 proxy listen=tcp: connect=tcp:
Device myport80 added to c1


  1. Use IP tables or inbuilt proxy of lxc.

  2. Visit:hostip:port

    Alt Text

You are most welcome to join my team

Alt Text

Click here for joining my team .

Also you are most welcome to join OPEN SOURCE INTELLIGENT SYSTEM (OSINT) if you can help in open source project regarding safeguarding humans from various diseases like CORONA outbreak

Contact email:

If you have any problem, our team is also engaged in professional consultancy and delivery.

Imagecredit: Pixabay, manishfoodtechs,giphy

Discussion (0)