How to Create Your Own Data Center Specific Linux Image Using Cubic
If you’ve ever wanted to create a custom Linux image to use in your datacenter deployments, Cubic is here to make it much easier for you.
At this point, you are probably using Linux in your data center. It is a fatality that you cannot fight nowadays. And that’s a really good thing because Linux is incredibly powerful, flexible, and (without a doubt) powers a lot of what we depend on.
If you are deploying to many servers in your data center, the idea of ââinstalling a basic server distribution and then adding whatever you need, one server at a time, can be a daunting task. little intimidating. This is understandable, especially when these servers can number in the hundreds. And if you’re not using virtual machines for these deployments, you’re probably looking for a way to make those deployments a little easier.
Cubic could be the answer.
SEE: 5 Linux Server Distributions You Should Be Using (TechRepublic Premium)
Cubic makes it easy to deploy your own custom Linux image, based on a known distribution, and create a bootable ISO so you can install the exact version of Linux you need. Cubic is a very easy to use GUI tool.
I want to show how this is done, so that you can create your own image to install on your datacenter servers. I will demonstrate by creating an ISO image based on Ubuntu Server 21.10, but you can use the image you want.
What you will need
The only things you will need for this are a running instance of a Debian-based Linux desktop, an ISO image downloaded from a Linux distribution to base your image on, and a user with sudo privileges.
How to install Cubic
The first thing to do is install Cubic. To do this, connect to a Debian-based desktop and add the necessary repository with:
sudo add-apt-repository ppa:cubic-wizard/release
Then update apt then install Cubic with:
sudo apt-get update sudo apt-get install cubic -y
Once Cubic is installed, you will find the launcher in your desktop menu. Click to launch it and you are ready to create your image.
How to create your personalized image
From the main Cubic window (Figure A), click the folder icon, then, from your file manager, create and select a new directory to be used by the application to create and host your custom images.
Click on Next then, in the following window (Number B), you need to select the ISO image on which the custom version will be based. After selecting the image, all fields will be filled in automatically. You can then customize them on the right side.
Click Next and eventually you’ll end up at a chroot terminal prompt (Figure C).
At this point, you can start adding software and customize the image to your exact specifications. Everything here is done from the terminal window. Suppose, for example, that you want the ISO to include a full LAMP server. First, run the command:
Then install the LAMP server with:
apt-get install lamp-server^
You may want to install a specific version of PHP or support a number of other customizations for your image. One thing to note is that the chroot environment is not started with systemd initialized, so you cannot start or activate the services. For this reason, you cannot do any work in the databases. You can however drag and drop files from your file manager to the chroot environment and edit all configuration files (with the nano editor).
Once you have completed this step, click Next and Cubic will then present you with a window that allows the removal of packages for a minimal installation (Number D).
Once you have selected the packages to remove (if any), click Next, then select the kernel that will be used for the image. You will then need to select the compression used for the image (Encrypted).
I would suggest using the default compression (gzip) to make sure the live image will work fine. Click Generate and Cubic will create your custom ISO image. Once the process is complete, a window (Figure F) which details what Cubic did and where you can find your new custom ISO image.
At this point, you can either copy this image to a server to download at will, or to a USB drive and start deploying it to the servers in your datacenter.
Congratulations, you just made your Linux deployments a little more efficient.
Subscribe to TechRepublic How to make technology work on YouTube for all the latest technical advice for professionals at Jack Wallen’s business.