OpenStack VirtualBox

Install OpenStack on VirtualBox

In this article, I am going to show you how to install OpenStack in a VirtualBox virtual machine for learning OpenStack on your own computer. I am going to install CentOS 7 on a VirtualBox virtual machine and install OpenStack on there. So, let’s get started.

Downloading CentOS 7 ISO Image:

First, you have to download the CentOS 7 ISO installation image from the official website of CentOS 7.

To do that, visit https://www.centos.org/download/ and click on Minimal ISO as marked in the screenshot below.

Now, click on any of the link.

Your browser should prompt you to save the file. Select Save File and click on OK.

CentOS 7 ISO installation media is being downloaded.

Creating a Virtual Machine:

Once the CentOS 7 ISO installation image is downloaded, open VirtualBox and click on Machine > New… as marked in the screenshot below.

Now, type in a name for the VM. Then, select Linux and Red Hat (64-bit) as the Type and Version respectively. Then, click on Next.

You need at least 16 GB of RAM in order to run OpenStack. So, make sure you assign 16 GB (16384 MB) of RAM to your VM. Once you’ve set the memory size, click on Next.

Now, click on Create.

Now, click on Next >.

Now, click on Next >.

Now, set 100 GB as the hard disk size and click on Create.

OpenStack VM should be created. Now, select the OpenStack VM and click on Settings.

Now, select USB Tablet as the Pointing Device from System > Motherboard as marked in the screenshot below.

Now, check Enable Nested VT-x/AMD-v from System > Processor as marked in the screenshot below.

Now, from the Network section, change Attached to to Bridged Adapter, Adapter Type to Paravirtualized Network (virtio-net) and Promiscuous Mode to Allow All.

Now, you have to set the CentOS 7 ISO installation image as the Optical drive. To do that, follow the procedures as marked in the screenshot below.

Now, select the CentOS 7 ISO installation image and click on Open.

Now, click on OK.

The VM is now ready to install CentOS 7.

Installing CentOS 7 on the Virtual Machine:

Now, select the OpenStack VM and click on Start.

The VM should boot from the ISO installation image. Now, select Install CentOS 7 and press <Enter>.

The CentOS 7 GUI installer should start. Now, install CentOS 7 as usual. Make sure to set a root password during installation.

Once CentOS 7 is installed, you should be able to log in as the user root using the password that you’ve set during installation.

Configuring Network:

Now, disable firewalld service with the following command:

# systemctl disable firewalld

Now, stop the firewalld service with the following command:

# systemctl stop firewalld

Now, disable NetworkManager service with the following command:

# systemctl disable NetworkManager

Now, stop NetworkManager service with the following command:

# systemctl stop NetworkManager

Now, enable network service with the following command:

# systemctl enable network

Now, start network service with the following command:

# systemctl start network

Now, check the name of your network interface as follows:

$ ip a

The name of the network interface of my CentOS 7 VM is eth0.

Now, run the following command to configure the network interface eth0 to automatically get IP address via DHCP:

# echo -e 'DEVICE=eth0\nBOOTPROTO=dhcp\n' > /etc/sysconfig/network-scripts/ifcfg-eth0

Now, reboot your CentOS 7 VM as follows:

$ sudo reboot

Once it boots, the network interface eth0 should have an IP address.

Installing OpenStack:

Before you do anything, make sure to set the LANG and LC_ALL environment variables correctly with the following command:

# echo -e "LANG=en_US.utf-8\nLC_ALL=en_US.utf-8\n" > /etc/environment

Now, to make sure all the CentOS 7 packages are up to date, run the following command:

# yum update -y

CentOS packages are being updated.

All the CentOS 7 packages should be updated.

Now, add the OpenStack Rocky package repository with the following command:

# yum install -y centos-release-openstack-rocky

The OpenStack Rocky package repository should be added.

Now, update the CentOS 7 system packages again with the following command:

# yum update -y

All the system packages should be updated.

Now, install PackStack with the following command:

# yum install -y openstack-packstack

PackStack is being installed. It may take a while to complete.

PackStack should be installed.

Now, install all the components of OpenStack on CentOS 7 with the following command:

# packstack --allinone

OpenStack is being installed.

PackStack is configuring required components with Puppet. It will take a long time to complete.

OpenStack is installed.

Testing OpenStack:

You need the IP address of your CentOS 7 machine in order to access OpenStack Horizon dashboard.

To find the IP address of CentOS 7, run the following command:

# ip a

As you can see, the IP address of my CentOS 7 machine is 192.168.21.200. It will be different for you. So, make sure to replace it with yours from now on.

Now, to find the OpenStack Horizon dashboard password, run the following command:

# cat keystonerc_admin | grep PASSWORD

As you can see, df29616110934166 is the password for my OpenStack Horizon dashboard.

Now, from your favorite web browser, visit http://192.168.21.200 and you should see the OpenStack login page. Type in the username admin and the password df29616110934166 (password should be different for you. So, replace it with yours.). Then, click on Sign In.


a
You should be logged in to OpenStack Horizon dashboard. Now, you can configure OpenStack any way you like from here.

So, that’s how you install OpenStack on VirtualBox. Thanks for reading this article.

About the author

Shahriar Shovon

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.