Search

MachPanel Knowledgebase

GUIDE:SOP for preparation of Centos (Linux) Sealed Images for Hyper-V

Mudesira Munir
Manuals and Guides

Summary

This article provides information about preparation of sealed images for Centos (Linux) Virtual Machines.

Applies To

Applies to MachPanel v6.3.30 and onward.

Important Note:

  • It is recommended to create Virtual Machines based on Gen2.

Pre-reqs​
  • While installing CentOS, for Partitioning either choose Automatically Configure Partitioning OR if you choose I will configure partitioning set the Volume Group Name as centos.
  • Create a standard Centos & build
  • Configure the Network - nmtui
  • Install dos2unix - sudo yum install dos2unix
  • Change Permissions for rc.local file to run on bootup - chmod +x /etc/rc.d/rc.local

Procedure for preparing Centos (Linux) Sealed Image for Gen 2 virtual Machines

  • Make rc.local file settings like below in your sealed image. (sudo nano /etc/rd.d/rc.local)

================================================================================

#!/bin/bash
touch /var/lock/subsys/local
sed -n 's/;#COMMAND//p' /root/Config.bat > /root/Config.bak && mv -f /root/Config.bak /root/Config.bat && chmod 777 /root/Config.bat && dos2unix /root/Config.bat
sh /root/Config.bat
rm -f /root/Config.bat
rm -f /root/Config.bak

================================================================================

Selinux Config: Selinux Config file should contain below settings. (root\etc\SELINUX\Config)

 ================================================================================

Procedure for preparing Centos (Linux) Sealed Image for Gen1 virtual Machines

Below are the settings which are required for preparing the Linux (Centos) Sealed image for Gen1.

  • Make sure your Centos flavor supports floppy
  • Create Floppy Folder under /media - mkdir /media/floppy
  • Make rc.local file settings like below in your sealed image. (sudo nano /etc/rc.local)

================================================================================

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do full Sys V style init stuff.

touch /var/lock/subsys/local
insmod /lib/modules/$(uname -r)/kernel/drivers/block/floppy.ko
mount /dev/fd0 /media/floppy && mount -o remount,rw /dev/fd0
wait
sed -n 's/;#COMMAND//p' /media/floppy/Config.bat > /media/floppy/Config.bak && mv -f /media/floppy/Config.bak /media/floppy/Config.bat && chmod 777 /media/floppy/Config.bat && dos2unix /media/floppy/Config.bat
sh /media/floppy/Config.bat
rm -f /media/floppy/Config.bat
rm -f /media/floppy/Config.bak
umount -l /dev/fd0

================================================================================

Selinux Config: Selinux Config file should contain below settings. (root\etc\SELINUX\Config)


Details
Type: GUIDE
Access Type: Public
Last Modified: Last Month
Last Modified By: qaiser.khan
Article not rated yet.
Article has been viewed 66 times.
Options
Also In This Category
Tags