{"id":1395,"date":"2016-09-19T19:01:44","date_gmt":"2016-09-19T23:01:44","guid":{"rendered":"http:\/\/enterpriseadmins.org\/blog\/?p=1395"},"modified":"2016-09-19T19:01:44","modified_gmt":"2016-09-19T23:01:44","slug":"lab-template-centos-7-2","status":"publish","type":"post","link":"https:\/\/enterpriseadmins.org\/blog\/virtualization\/lab-template-centos-7-2\/","title":{"rendered":"Lab template: CentOS 7.2"},"content":{"rendered":"<p>Recently I&#8217;ve been working in a couple of different \/ disconnected labs.  This means I&#8217;m managing a couple copies of all my templates manually.  Sometimes its hard to find the right section of my notes depending on when\/where I&#8217;m working on the lab, so I decided to post a couple quick blog posts so I can always find them.  The following notes are for creating a template based on CentOS 7.2, and include notes on setting a static IP and joining to the domain with pbis-open (formerly likewise-open). <\/p>\n<p>Special thanks to <a href=\"http:\/\/www.tecmint.com\/things-to-do-after-minimal-rhel-centos-7-installation\/\">http:\/\/www.tecmint.com\/things-to-do-after-minimal-rhel-centos-7-installation\/<\/a>&#8230; which showed me how to get ifconfig in my minimal install.  I&#8217;m not sure who decides what makes the cut for minimal installations, but ifconfig and nslookup seem like they should be in to me.<\/p>\n<p>Install CentOS 7.2 Minimal install from ISO image (<a href=\"http:\/\/isoredirect.centos.org\/centos\/7\/isos\/x86_64\/CentOS-7-x86_64-Minimal-1511.iso\">http:\/\/isoredirect.centos.org\/centos\/7\/isos\/x86_64\/CentOS-7-x86_64-Minimal-1511.iso<\/a>), accepting all defaults.  Create an administrator account named hostadmin during the install.<\/p>\n<p>Once the install is complete, login as hostadmin.  Switch to root and set a password for the root user.<\/p>\n<pre>\r\nsudo su -\r\npasswd\r\n<\/pre>\n<p>In my testing, the VM did not get an IP address from DHCP, even though DHCP was available and working.  To get online I had to change ONBOOT=no to ONBOOT=yes in the file:<\/p>\n<pre>vi \/etc\/sysconfig\/network-scripts\/ifcfg-eno16777984<\/pre>\n<p>I then restarted networking to bring the interface back up with an IP:<\/p>\n<pre>service network restart<\/pre>\n<p>Now that I have an IP, I update\/upgrade my installation and install some handy\/useful packages:<\/p>\n<pre>\r\nyum update && yum upgrade\r\nyum install net-tools bind-utils nano ntp wget -y\r\n<\/pre>\n<p>Get the template ready for PowerBroker Identity Services (formerly likewise-open) domain joins:<\/p>\n<pre>\r\nrpm --import http:\/\/repo.pbis.beyondtrust.com\/yum\/RPM-GPG-KEY-pbis\r\nwget -O \/etc\/yum.repos.d\/pbiso.repo http:\/\/repo.pbis.beyondtrust.com\/yum\/pbiso.repo\r\nyum clean all\r\nyum install pbis-open\r\n<\/pre>\n<p>At this point, I shutdown the VM and convert it to a template.  When I&#8217;m ready to use the VM, I deploy a copy from template and follow the remaining steps.<\/p>\n<p>If needed, set a static IP by updating the following file&#8230; this is the same file we edited earlier to enable DHCP:<\/p>\n<pre>nano \/etc\/sysconfig\/network-scripts\/ifcfg-eno16777984<\/pre>\n<p>For Static IP, remove bootproto=dhcp, and add the following<\/p>\n<pre>\r\nIPADDR=\"192.168.0.101\"\r\nPREFIX=\"24\"\r\nGATEWAY=\"192.168.0.1\"\r\nDNS1=\"192.168.0.20\"\r\nSEARCH=\"lab.enterpriseadmins.org\"\r\n<\/pre>\n<p>Verify that the hostname is properly set:<\/p>\n<pre>nano \/etc\/hostname<\/pre>\n<p>Join the Linux VM to the domain and create a DNS record:<\/p>\n<pre>\r\ndomainjoin-cli join lab.enterpriseadmins.org adminbw\r\n\/opt\/pbis\/bin\/config AssumeDefaultDomain true\r\n\/opt\/pbis\/bin\/config LoginShellTemplate \/bin\/bash\r\n\/opt\/pbis\/bin\/config HomeDirTemplate %H\/%U\r\n\/opt\/pbis\/bin\/config RequireMembershipOf \"lab\\\\domain^users\"\r\n\/opt\/pbis\/bin\/update-dns\r\n<\/pre>\n<p>Once I reach this point, I kick off a quick reboot (just to make sure the domain join took) and am now free to use the VM.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I&#8217;ve been working in a couple of different \/ disconnected labs. This means I&#8217;m managing a couple copies of all my templates manually. Sometimes its hard to find the right section of my notes depending on when\/where I&#8217;m working &hellip; <a href=\"https:\/\/enterpriseadmins.org\/blog\/virtualization\/lab-template-centos-7-2\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1395","post","type-post","status-publish","format-standard","hentry","category-virtualization"],"_links":{"self":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/1395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/comments?post=1395"}],"version-history":[{"count":4,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/1395\/revisions"}],"predecessor-version":[{"id":1402,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/posts\/1395\/revisions\/1402"}],"wp:attachment":[{"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/media?parent=1395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/categories?post=1395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enterpriseadmins.org\/blog\/wp-json\/wp\/v2\/tags?post=1395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}