Installing Our First Linux Virtual Machine for Learning Systems Administration



  • There is no better way to get started with Linux than jumping straight in! So we will do just that. For the majority of our learning, we are going to focus on CentOS Linux because it is completely free, focused completely on enterprise server needs and is a mirror of the leading business distribution and the most commonly encountered in the Linux System Administration workplace. This series is not a sales pitch for CentOS or RHEL but use them because they make the most sense for getting started in a Linux career. When possible, we will branch out and investigate other enterprise Linux offerings as well to make the educational opportunities as complete as possible.

    As with any modern server administration, we are going to assume that everything that we do is going to be virtualized. We will address Linux on physical installs later in our "course", but unless we are specifically targeting a physical install for a special purpose (such as creating a virtualization host) we will stick to working and assuming that all work is as a virtual machine. As a system administrator, the physical server is of no concern to us, we work at the OS level.

    You are free to virtualize your Linux educational environment using any tool set that you have available to you. If you are doing this at home, I would recommend Oracle VirtualBox as it is free, very easy to use and extremely powerful. It will work great for this. You can use VMware Workstation, Fusion, Parallels or similar to virtualize on your desktop or laptop. If you have access to a type 1 hypervisor, even better, as this will mimic exactly how you would work in a production environment. If you have the resources to have a dedicated server for learning (this could be anything from an old desktop that you put together yourself to a massive HP Proliant or Dell PowerEdge server) then I highly recommend installing an enterprise type 1 hypervisor and performing this course in that manner. Any enterprise hypervisor is free and will work just fine: VMware ESXi, Microsoft Hyper-V, KVM or Xen / XenServer.

    In my own lab I will be doing all of the examples on the Linux-based KVM hypervisor-based Scale HC3 cluster, so all of my screenshots will be from that system. Yours will look differently but the basic functionality, especially as it pertains to this class, will be identical. If you are working with a Xen-based system offering optionally full paravirtualization or HVM modes, choose HVM for this course.

    Of course you could also do nearly everything the same working from a Linux instance on a cloud platform such as Amazon Web Services, Azure, Rackspace, Digital Ocean, Softlayer or Vultr, but we do not want to add any additional complications arising from platform differences, non-standard base images and such so if possible, save that for more advanced lessons.

    We will start by building a base, minimum system image and making that into a template to make things easier and faster in the future. But we cannot do anything until we have our first VM of Linux, so here we go.

    First we need to download a CentOS installation DVD image. CentOS has a download site here: https://www.centos.org/download/

    Choose the Minimum Install ISO. At the time of this writing, this is CentOS 7 release 1511. But all CentOS 7 should be the same for our purposes.

    We need very few resources for our Linux VM. In fact we could easily work with a single vCPU and less than 512MB of RAM. But we probably do not need to be that tight with our resources. We will bump up to 1GB of RAM for our default system.

    When installing CentOS, I often use the text-based installer only because it is more reliably going to work. The graphical installer is essentially identical but can have problems based on resolution or graphic capabilities and is less reliable. I will show the graphical installer here as it is more common and less intimidating.

    CentOS VM Setup on Scale HC3

    In this screenshot I show the Scale HC3 VM setup options that I will use for CentOS 7. Just one vCPU and just one GB of RAM. Notice that we only need a 20GB drive, even that is excessive. I like 20GB today, but you can get away with much less. If you have the option, thin provision so that it does not matter. You can see my boot ISO here, CentOS 7 Minimum 1511.

    If you are not on Scale obviously your screenshot will look a little different than this, but the basics will be the same. If you need specific details on a different hypervisor, post questions in the thread below.

    Now we can "Create" and start up our VM and begin our install. Unlike some desktop distributions, CentOS does not load into a "live" environment (Linux Mint does this, for example) and immediately will present the option to install.

    CentOS VM Config

    Once we start our new CentOS VM and view it from the console we can step through the installation process. Our first screen is time sensitive. Once it comes up we need to select Install CentOS 7 using the cursor keys and hit enter.

    CentOS Installation Screen 1

    Once the installation begins we will first have to choose our languages. This is all very self explanatory. Simply select yours and click to continue.

    centos 7 choose language

    Next we come to our general configuration screen. For advanced users there is a lot that we can select on this screen. As this is our first time we are going to stick to the minimum.

    centos 7 options

    Notice that under "System" there is a yellow triangle on "Installation Destination". CentOS 7 will always make us verify that we want to install to the disk to avoid accidents. So we have to click on "Installation Destination" so that we can verify the drive.

    CentOS 7 Drive Selection

    If you are doing a default installation like I am, coming to the drive selection screen should pick the only available drive automatically (this is the 20GB drive, labelled vda when using my KVM-based Scale system here) with no intervention needed. You can just click "Done" to return to the previous screen. If for some reason this does not happen automatically you will need to select the drive on this screen before clicking done.

    And we are back to the screen that we had before but the yellow triangle is gone now.

    CentOS 7 Drive Selected

    To make things easy, we will set up our networking now as well so that it is available to us as soon as the system comes up. We are assuming that you have DHCP working on your network at this point. Click on "Network & Host Name" to continue.

    This is the default screen that we will see when we first see the screen:

    CentOS Networking

    We just have two easy changes to make. In the "Host name" field, fill in your hostname. Mine is lab-lnx-centos.lab.ntg.co. I have a DNS domain already that I use for my environment (lab.ntg.co), if you do not have one you can make one up like .mylab. The only other thing that we must do is look for the networking "on/off" switch in the top right. It should be off by default. Click on this so that it turns to "on". One you do this the Ethernet (eth0) settings should say "Connected" and details about your IP addressing assigned via DHCP should appear.

    CentOS Updated Networking

    That is all that we needed to do, we are now free to continue with the installation!

    centos 7 installation

    Set the root password, this is self explanatory. Be sure not to forget this password, either!

    We are going to optionally create a user account that we will use, as well. I am going to make a user name "student" that is going to be an administrator. See the configuration in the screen shot below. Please configure a "student" user just as this. Use your own password for this and, again, don't forget it.

    CentOS 7 Make User

    After this we need only wait for the installation process to complete. CentOS 7 Minimum is pretty small and this generally happens very quickly.

    Once the installation is complete it will ask you to click "Reboot". Do so and our system should reboot and come up to a log in prompt. Put in "root", hit enter and then put in the password that was set for root a few steps ago. If all went according to plan we should be logged into our new CentOS 7 Linus virtual machine and ready to continue our class!

    centos 7 installation complete

    Part of a series on Linux Systems Administration by Scott Alan Miller



  • So explain to me why you skipped turning on networking in the GUI?

    In my experience with novice users, you avoid an entire host of issues if you additionally setup networking on that installation screen.

    It is not like the desired networking information will change between the GUI install and time you first login.



  • sub'd...
    VM installed...
    ready for the next class



  • Centos 7 installed in HyperV server W2008r2. 😄



  • @JaredBusch said:

    So explain to me why you skipped turning on networking in the GUI?

    In my experience with novice users, you avoid an entire host of issues if you additionally setup networking on that installation screen.

    It is not like the desired networking information will change between the GUI install and time you first login.

    Good point, I'm modifying it now.



  • @FATeknollogee said:

    sub'd...
    VM installed...
    ready for the next class

    Here is the thread where each of the lessons is coordinated. Kind of the "Table of Contents."

    http://mangolassi.it/topic/7825/sam-learning-linux-system-administration



  • @scottalanmiller said:

    @JaredBusch said:

    So explain to me why you skipped turning on networking in the GUI?

    In my experience with novice users, you avoid an entire host of issues if you additionally setup networking on that installation screen.

    It is not like the desired networking information will change between the GUI install and time you first login.

    Good point, I'm modifying it now.

    I do realize, that it is not hard to setup networking in CentOS, but if your target is novice users, I think enabling networking in the GUI is the best thing to do. Because then you can drop straight to SSH next.



  • Got it redone with the updated screen shots and details.



  • Ready & waiting for lesson # 2: Linux: The Lay of the Land, Filesystem Herarchy



  • Thanks, SAM! I had my VM installed and ready last night. 🙂



  • @JaredBusch said:

    @scottalanmiller said:

    @JaredBusch said:

    So explain to me why you skipped turning on networking in the GUI?

    In my experience with novice users, you avoid an entire host of issues if you additionally setup networking on that installation screen.

    It is not like the desired networking information will change between the GUI install and time you first login.

    Good point, I'm modifying it now.

    I do realize, that it is not hard to setup networking in CentOS, but if your target is novice users, I think enabling networking in the GUI is the best thing to do. Because then you can drop straight to SSH next.

    One other thing that trips people up is it doesn't enable the NIC by default. If you don't configure it and enable autloading, there is no networking until you configure the ifcfg file.



  • @johnhooks said:

    @JaredBusch said:

    @scottalanmiller said:

    @JaredBusch said:

    So explain to me why you skipped turning on networking in the GUI?

    In my experience with novice users, you avoid an entire host of issues if you additionally setup networking on that installation screen.

    It is not like the desired networking information will change between the GUI install and time you first login.

    Good point, I'm modifying it now.

    I do realize, that it is not hard to setup networking in CentOS, but if your target is novice users, I think enabling networking in the GUI is the best thing to do. Because then you can drop straight to SSH next.

    One other thing that trips people up is it doesn't enable the NIC by default. If you don't configure it and enable autloading, there is no networking until you configure the ifcfg file.

    That is what I just said. Turn it on in the GUI during initial config.



  • @JaredBusch said:

    @johnhooks said:

    @JaredBusch said:

    @scottalanmiller said:

    @JaredBusch said:

    So explain to me why you skipped turning on networking in the GUI?

    In my experience with novice users, you avoid an entire host of issues if you additionally setup networking on that installation screen.

    It is not like the desired networking information will change between the GUI install and time you first login.

    Good point, I'm modifying it now.

    I do realize, that it is not hard to setup networking in CentOS, but if your target is novice users, I think enabling networking in the GUI is the best thing to do. Because then you can drop straight to SSH next.

    One other thing that trips people up is it doesn't enable the NIC by default. If you don't configure it and enable autloading, there is no networking until you configure the ifcfg file.

    That is what I just said. Turn it on in the GUI during initial config.

    Wow, I don't know why I did that. It's been a long day.



  • Inquiring minds are asking about Lesson Plan #2 😃



  • @FATeknollogee said:

    Inquiring minds are asking about Lesson Plan #2 😃

    It is partially written and open on my desktop (I write in Atom then post over to keep my browser from crashing and losing it.) Hopefully later today.



  • If anyone has specific topic ideas, feel free to share. I have covered this material for decades but have never taught someone from the ground up and so am trying to figure out how to teach, and cover, the basic stuff both for a beginner and for someone coming from a Windows Admin background and not have huge gaps making things hard to understand.



  • @scottalanmiller Logging in using SSH with public/private keypairs instead of username/password to increase security might be a good topic or subtopic. Enjoying what has been posted so far!



  • @jt1001001 said:

    @scottalanmiller Logging in using SSH with public/private keypairs instead of username/password to increase security might be a good topic or subtopic. Enjoying what has been posted so far!

    That's definitely coming. SSH and key management will be major topics.



  • @FATeknollogee said:

    Lesson Plan #2

    Some of us Windows guys are excited for Lesson Plan #2 😃



  • Something that I'd like a better grasp on is how the mindset is different. Coming from a decade+ of Windows admin work, some of the things that others call easy, or assume that it should be understood, I don't get. There are many examples, but today I ran across an irritating one: installing RAID drivers. In Windows, this is either easy, or undoable. In Linux (during install) it appears to require a significant background. "Just compile from source." is not an easy answer for me at this point because I don't even know where on my mental grid to fit that, much less how to do it for the variety of needed scenarios.



  • @Kelly said:

    Something that I'd like a better grasp on is how the mindset is different. Coming from a decade+ of Windows admin work, some of the things that others call easy, or assume that it should be understood, I don't get. There are many examples, but today I ran across an irritating one: installing RAID drivers. In Windows, this is either easy, or undoable. In Linux (during install) it appears to require a significant background. "Just compile from source." is not an easy answer for me at this point because I don't even know where on my mental grid to fit that, much less how to do it for the variety of needed scenarios.

    Wait. What? You shouldn't really be installing RAID drivers at least not to my knowledge. As far as the OS is concerned that is just raw disk right?



  • @Kelly said:

    In Windows, this is either easy, or undoable. In Linux (during install) it appears to require a significant background. "Just compile from source." is not an easy answer for me at this point because I don't even know where on my mental grid to fit that, much less how to do it for the variety of needed scenarios.

    That's a major difference in Linux. Windows is often perceived as easy because "impossible" and "give up" are common answers. In Linux, when it is easy it is normally way easier, when it is hard it is almost always still possible. It's odd that Linux being easier causes it to be seen as harder.

    What RAID drivers did you have an issue with? Linux should generally need nothing, I've never seen an enterprise RAID card not supported out of the box,.



  • @coliver said:

    Wait. What? You shouldn't really be installing RAID drivers at least not to my knowledge. As far as the OS is concerned that is just raw disk right?

    Once in a while you need special ones no different than on Windows. While the OS sees it as a SAS card, sometimes they even need drives even just for a SAS adapter.

    I've not seen any OS need this in a very long time, though.



  • @scottalanmiller said:

    @coliver said:

    Wait. What? You shouldn't really be installing RAID drivers at least not to my knowledge. As far as the OS is concerned that is just raw disk right?

    Once in a while you need special ones no different than on Windows. While the OS sees it as a SAS card, sometimes they even need drives even just for a SAS adapter.

    I've not seen any OS need this in a very long time, though.

    I know I've had to install some commodity RAID drivers into a workstation before. Never on a server though.



  • It is an onboard SAS controller that I'm trying to install in XenServer during boot. I didn't go into the details because it was just an example of a current issue, and that detail I didn't feel was germane. The XS installer is not seeing the configured arrays, only the drives themselves. Perhaps I should start a new thread...



  • @Kelly said:

    It is an onboard SAS controller that I'm trying to install in XenServer during boot. I didn't go into the details because it was just an example of a current issue, and that detail I didn't feel was germane. The XS installer is not seeing the configured arrays, only the drives themselves. Perhaps I should start a new thread...

    Sounds like FakeRAID. I think @DustinB3403 and @scottalanmiller have a guide to setup MD RAID in XenServer.



  • @Kelly said:

    It is an onboard SAS controller that I'm trying to install in XenServer during boot. I didn't go into the details because it was just an example of a current issue, and that detail I didn't feel was germane. The XS installer is not seeing the configured arrays, only the drives themselves. Perhaps I should start a new thread...

    FakeRAID is the issue there. Windows just hides this from you making you think that you have something that you don't. Linux is just helping you here by telling you the truth. For this setup, Linux kicks butt over Windows because with regular Linux and/or XenServer you just use the included enterprise software RAID on those drives and have something way better than Windows offers with or without the FakeRAID hardware.



  • @scottalanmiller said:

    @FATeknollogee said:

    Inquiring minds are asking about Lesson Plan #2 😃

    It is partially written and open on my desktop (I write in Atom then post over to keep my browser from crashing and losing it.) Hopefully later today.

    Any update on # 2?



  • @FATeknollogee said:

    @scottalanmiller said:

    @FATeknollogee said:

    Inquiring minds are asking about Lesson Plan #2 😃

    It is partially written and open on my desktop (I write in Atom then post over to keep my browser from crashing and losing it.) Hopefully later today.

    Any update on # 2?

    Have you looked at all of the new content that went up over the last few days? There are more than a dozen lessons there now.



  • @scottalanmiller I love all the new content. Much appreciated.