CentOS 7 for Building Virtual Appliance
I started to play with CentOS 7 recently because I wanted to use it for one of my appliance products. Naturally, I installed the minimum version of the CentOS 7.0.
While it takes time, the installation process is pretty straight-forward like installing any other Linux on a virtual machine. What I did was to upload the .iso file to a datastore, then create a new virtual machine that uses the iso file as CD device. When it booted, the installation started. Although it’s minimal version, but the installer is actually GUI based. So it’s pretty intuitive.
Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.
Immediately, I got first problem. I want to see IP address of the virtual machine just installed so that I can remotely SSH to it. To my surprise, the ifconfig command does not work. As I searched the Web, it’s actually not included there. It can be, however, installed using the yum command. But since it’s virtual appliance, I didn’t want the extra because there is already an alternative as follows.
# ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:50:56:8a:3a:99 brd ff:ff:ff:ff:ff:ff ...
With that, I came to second problem – there is no IPv4 address. It turned out that I used the VMX3 adapter in hope that it performs the best, but I didn’t install VMware Tools which includes the driver.
To solve the problem, I had two options: install the VMware Tools, or change the adapter to e1000 NIC. After considering the options, I decided to change the NIC type. After that, it worked pretty well. Notice that the interface name is no longer eth0, but something like ens33. If you really want to use the old name, you can configure it that way.
After the two problems, building the appliance is not much different from using older version of CentOS except the systemctl command vs service command. The overall experience has been very positive.