Using the self-serve net installer/CentOS Stream: Difference between revisions

From BitFolk
Jump to navigation Jump to search
(→‎Supported distributions: CentOS 7.x available)
(Rename to CentOS Stream. Document Stream 9.x. Document install to encrypted partition.)
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
Installing CentOS or Scientific Linux using the BitFolk installer.
Installing CentOS Stream using the BitFolk installer.


==Supported distributions==
==Supported distributions==
* CentOS 5.x
* CentOS Stream 9.x
* CentOS 6.x
* CentOS Stream 8.x
* CentOS 7.x
* CentOS Linux 7.x
* Scientific Linux 6.x


==Supported install methods==
==Supported install methods==
===CentOS 5.x===
All of the supported versions of CentOS Stream and CentOS Linux use a semi-automated installation method which has automated partitioning and a minimal selection of packages. If you require a custom partitioning scheme then you will need to write your own kickstart file and provide BitFolk's installer with a URL to it.
* Interactive text-mode
* Custom kickstart URL
 
===CentOS 6.x, Scientific Linux 6.x===
* Semi-interactive text mode (automated partitioning and package selection)
* Interactive VNC GUI
* Custom kickstart URL


==About kickstart==
==About kickstart==
Line 21: Line 13:


===The default kickstart profile===
===The default kickstart profile===
The default kickstart profile for CentOS 5.x performs a largely interactive text mode install, whereas the default kickstart for CentOS 6.x and Scientific Linux 6.x perform a mostly automatic install. In particular, '''the default installer kickstart for CentOS 6.x and Scientific Linux 6.x has automated partitioning and package selection.''' The different behaviour is down to Red Hat dropping disk partitioning and package selection from the text mode installer:
BitFolk's default kickstart profiles perform a mostly automatic install. In particular, '''the default installer kickstart has automated partitioning and package selection.'''
 
If you're curious about what the default kickstart profile contains, use the '''kickstart''' [[Xen Shell]] command to see the URL to the file. You can just view it in your web browser.


<br />
Briefly, the default kickstart does this:
{{warning|If you select text mode for a kickstart installation, make sure that you specify choices for the partitioning, bootloader, and package selection options. These steps are automated in text mode, and anaconda cannot prompt you for missing information. If you do not provide choices for these options, anaconda will stop the installation process.<br />&ndash; http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Installation_Guide/index.html#s1-kickstart2-file<br />}}
* Automatically blanks your '''xvda''' disk then puts a single partition across the whole of it for a root filesystem (XFS).
<br />
* Automatically blanks your '''xvdb''' disk then puts a single partition across the whole of it for a swap partition.
* Installs a minimal package selection.
* Leaves you to interactively set up a user account as the only manual step.


===Selecting a different kickstart profile===
===Selecting a different kickstart profile===
Since version '''v1.48bitfolk16''' you can use the '''kickstart''' [[Xen Shell]] command to choose from some alternate kickstart profiles, or (from version '''v1.48bitfolk18''') to specify a URL to your own custom profile.
Since version '''v1.48bitfolk16''' you can use the '''kickstart''' [[Xen Shell]] command to choose from some alternate kickstart profiles, or (from version '''v1.48bitfolk18''') to specify a URL to your own custom profile.


===Performing an interactive install===
You should use BitFolk's default kickstart file as a template for making your own modifications.
If you want to do an interactive install of CentOS 6.x or Scientific Linux 6.x you're going to need to use the [[Wikipedia:VNC|VNC]] GUI kickstart.
 
It is possible to make your install entirely automated if you're willing to put (crypted) password information in your kickstart file.


This intially boots the text mode installer as far as acquiring an IP address and networking config (automated). It then generates a random password and starts a VNC server. You can connect to this with any VNC client, using the randomly-generated password. A normal GUI interactive install proceeds from there.
===Encrypting your filesystem===
One of the supplied alternate kickstart profiles installs to an encrypted partition (with the passphrase '''changeme''' which you should change after install). You can use that profile as-is, or take a copy of it to use as the basis for your own automated kickstart profile.


A typical Linux VNC client is [http://projects.gnome.org/vinagre/ vinagre].
==CentOS 7.x's text mode installer==
On CentOS 7.x the default kickstart sets all defaults and leaves you to set your own root password. If you wish it is then possible at this point for you to alter most settings apart from disk partitioning. The initial installer screen will look something like the following:


==CentOS 5's text mode installer==
<syntaxhighlight lang="text">
===Partitioning===
Starting automated install......
Soon after the install starts you'll see something like this:
Generating updated storage configuration
Checking storage configuration...
================================================================================
================================================================================
Installation


<syntaxhighlight>
1) [x] Language settings                2) [x] Timezone settings
Welcome to CentOS                                                             
        (English (United Kingdom))              (Etc/UTC timezone)
  +-------------------------+ Partitioning Type +-------------------------+   
3) [x] Software selection                4) [x] Installation source
  |                                                                      |   
        (Custom software selected)              (http://lon.static.bitfolk.com/
  |    Installation requires partitioning of your hard drive.  The        |   
5) [x] Network settings                        centos/7/os/x86_64)
  |    default layout is reasonable for most users.  You can either      |   
        (Wired (eth0) connected)          6) [x] Install Destination
  |    choose to use this or create your own.                            |   
7) [x] Kdump                                    (Custom partitioning selected)
  |                                                                      |   
        (Kdump is enabled)               8) [!] Create user
  | Remove all partitions on selected drives and create default layout.   |   
9) [!] Set root password                        (No user will be created)
  | Remove linux partitions on selected drives and create default layout. |   
        (Password is not set.)
  | Use free space on selected drives and create default layout.         |   
   Please make your choice from above ['q' to quit | 'b' to begin installation |
  | Create custom layout.                                                |   
   'r' to refresh]:
  |                                                                      |   
  |      Which drive(s) do you want to use for this installation?        |   
  |          [*]   xvda    10237 MB (Xen Virtual Block Device) ^          |   
  |          [*]   xvdb      251 MB (Xen Virtual Block Device) #          |   
  |                                                                      |   
  |                          +----+   +------+                            |  
  |                         | OK |  | Back |                            |   
  |                          +----+   +------+                            |   
  |                                                                      |   
  |                                                                      |   
  +-----------------------------------------------------------------------+   
                                                                               
<Space>,<+>,<-> selection  |  <F2> Add drive  |  <F12> next screen     
</syntaxhighlight>
</syntaxhighlight>


You are advised to:
You will need to select {{Key press|9}} to set a root password.


* move the cursor to the "Create custom layout." line
In what appears to be a bug, after setting the root password the installer will insist now that "3) Software selection" now needs completing. Select {{Key press|3}} and then make your selection (e.g. just {{Key press|1}} for a minimal install), then {{Key press|c}} to continue.
* hit tab to move drive selection, where you can toggle the drives with the space key
* when done there, tab again to the "OK" button and press return to continue.


You will then see something like:
The installer screen will now resemble:


<syntaxhighlight>
<syntaxhighlight lang="text">
Welcome to CentOS                                                             
  1) [x] Language settings                2) [x] Timezone settings
                                                                               
        (English (United Kingdom))              (Etc/UTC timezone)
  +------------------------------+ Partitioning +------------------------------+
  3) [!] Software selection               4) [!] Installation source
|                                                                            |
        (Processing...)                          (http://lon.static.bitfolk.com/
|        Device          Start    End    Size      Type    Mount Point    |
  5) [x] Network settings                        centos/7/os/x86_64)
| /dev/xvda                                                                ^ |
        (Wired (eth0) connected)          6) [x] Install Destination
  |  Free space               1    1306  10240M  Free space              # |
  7) [x] Kdump                                    (Custom partitioning selected)
| /dev/xvdb                                                                : |
        (Kdump is enabled)                8) [x] Create user
  |  Free space                1      33    256M  Free space              : |
  9) [x] Set root password                        (No user will be created)
| /dev/xvdc                                                                : |
        (Password is set.)
|  Free space                1    621    4864M  Free space              : |
   Please make your choice from above ['q' to quit | 'b' to begin installation |
  |                                                                          : |
   'r' to refresh]:
|                                                                          : |
|                                                                          : |
  |                                                                          v |
|                                                                            |
|      +-----+   +------+  +--------+  +------+  +----+  +------+        |  
|      | New |  | Edit |  | Delete |  | RAID |  | OK |  | Back |        |  
|      +-----+   +------+  +--------+  +------+  +----+  +------+        |
|                                                                            |
|                                                                            |
+----------------------------------------------------------------------------+
                                                                               
    F1-Help    F2-New      F3-Edit  F4-Delete    F5-Reset    F12-OK         
</syntaxhighlight>
</syntaxhighlight>


You just need to remember the above advice to put root as type '''ext3''' on '''xvda1''' and swap as '''xvdb1'''.
{{Key press|r}} to refresh until it changes to:


The install will now proceed normally and should be finished in a couple of minutes.
<syntaxhighlight lang="text">
1) [x] Language settings                2) [x] Timezone settings
        (English (United Kingdom))              (Etc/UTC timezone)
3) [x] Software selection                4) [x] Installation source
        (Minimal Install)                        (http://lon.static.bitfolk.com/
5) [x] Network settings                        centos/7/os/x86_64)
        (Wired (eth0) connected)          6) [x] Install Destination
7) [x] Kdump                                    (Custom partitioning selected)
        (Kdump is enabled)                8) [x] Create user
9) [x] Set root password                        (No user will be created)
        (Password is set.)
  Please make your choice from above ['q' to quit | 'b' to begin installation |
  'r' to refresh]:
</syntaxhighlight>


===Finishing the install===
and then you are ready to use {{Key press|b}} to begin the installation. There will be no further questions until the installation is completed.
Once the install has completed you'll see something like:


<syntaxhighlight>
If you desire an entirely automated installation then:
sending termination signals...done                                           
 
sending kill signals...done
# Take a copy of [http://tools.bitfolk.com/ks/centos/7/ks.cfg the default kickstart file].
disabling swap...
# Add an appropriate '''rootpw''' command.
        /tmp/xvdb1
# Host your kickstart file on some web server.
unmounting filesystems...
# Select your kickstart file from BitFolk's [[Xen Shell]].
        /mnt/runtime done
 
        disabling /dev/loop0
The addition of a '''rootpw''' command to the default kickstart will result in an entirely automated install that will not pause for input at all.
        /proc done
 
        /dev/pts done
==CentOS Stream 8.x's text mode installer==
        /sys done
The CentOS 8.x installer with the default kickstart is very similar to the CentOS 7 version above, except:
        /tmp/ramfs done
* '''It doesn't have an option to set root password'''. Instead there is only option {{Key press|8}}, to create a user. You should give that user administrator privileges, then it will be able to use '''sudo'''. The root password is locked.
        /selinux done
* '''The bug where you have to set some other things again is fixed'''. After adding an admin user you'll use {{Key press|b}} to begin and then the install will be entirely automated.
        /mnt/sysimage/sys done
 
        /mnt/sysimage/proc done
===Navigating the installer screens===
        /mnt/sysimage/selinux done
The CentOS 8 installer ([https://fedoraproject.org/wiki/Anaconda Anaconda]) now runs under '''[https://github.com/tmux/tmux/wiki tmux]''', a terminal multiplexer.
        /mnt/sysimage/dev done
 
        /mnt/sysimage done
While you can normally complete the install without ever switching between the installer's screens — or even pressing a key at all, if you used an automated kickstart file — you may wish to do so when debugging the process or for other advanced tasks.
rebooting system
 
Restarting system.
As with normal usage of '''tmux''' you can switch to other screens by using the command sequence {{Key press|Ctrl|b}} and then the screen number (e.g. {{Key press|Ctrl|b}} then {{Key press|2}}). The usual screens are:
xen-shell>
* main installer on screen {{Key press|1}}
</syntaxhighlight>
* shell prompt on screen {{Key press|2}}
* logs on screen {{Key press|3}}
* command output on screen {{Key press|4}}
 
===The ElRepo kernel-lt will be automatically installed===
{{warning|As of CentOS 8, Red Hat removed the ability to boot their kernels under Xen PV and [[PVH]] mode, even though the upstream Linux kernel enables this by default. Therefore BitFolk's CentOS installers will automatically switch you to the [http://elrepo.org/tiki/kernel-lt kernel-lt] longterm kernel from [http://elrepo.org/tiki/HomePage the ElRepo project].}}
 
===SELinux relabel===
Upon first boot the first thing your install will do is an [https://www.redhat.com/en/topics/linux/what-is-selinux SELinux] relabel so that SELinux functions correctly. If you're watching on the console it will tell you it's doing this, and then after a minute or so it will reboot. You can then use the Xen Shell '''console''' command to again connect to its console and see the subsequent normal boot.


You should now be able to '''boot''' into the new CentOS install.
==CentOS Stream 9.x's text mode installer==
The CentOS Stream 9.x installer is very similar to the one for Stream 8.x, except that it is now possible to set a root password when creating an admin user. If you don't set a root password then the root account will be locked and the only way to gain root access will be with '''sudo'''. As usual, the user you have designated as admin will have '''sudo''' access.

Latest revision as of 17:33, 20 August 2023

Installing CentOS Stream using the BitFolk installer.

Supported distributions

  • CentOS Stream 9.x
  • CentOS Stream 8.x
  • CentOS Linux 7.x

Supported install methods

All of the supported versions of CentOS Stream and CentOS Linux use a semi-automated installation method which has automated partitioning and a minimal selection of packages. If you require a custom partitioning scheme then you will need to write your own kickstart file and provide BitFolk's installer with a URL to it.

About kickstart

All RHEL-like installs use a kickstart profile.

The default kickstart profile

BitFolk's default kickstart profiles perform a mostly automatic install. In particular, the default installer kickstart has automated partitioning and package selection.

If you're curious about what the default kickstart profile contains, use the kickstart Xen Shell command to see the URL to the file. You can just view it in your web browser.

Briefly, the default kickstart does this:

  • Automatically blanks your xvda disk then puts a single partition across the whole of it for a root filesystem (XFS).
  • Automatically blanks your xvdb disk then puts a single partition across the whole of it for a swap partition.
  • Installs a minimal package selection.
  • Leaves you to interactively set up a user account as the only manual step.

Selecting a different kickstart profile

Since version v1.48bitfolk16 you can use the kickstart Xen Shell command to choose from some alternate kickstart profiles, or (from version v1.48bitfolk18) to specify a URL to your own custom profile.

You should use BitFolk's default kickstart file as a template for making your own modifications.

It is possible to make your install entirely automated if you're willing to put (crypted) password information in your kickstart file.

Encrypting your filesystem

One of the supplied alternate kickstart profiles installs to an encrypted partition (with the passphrase changeme which you should change after install). You can use that profile as-is, or take a copy of it to use as the basis for your own automated kickstart profile.

CentOS 7.x's text mode installer

On CentOS 7.x the default kickstart sets all defaults and leaves you to set your own root password. If you wish it is then possible at this point for you to alter most settings apart from disk partitioning. The initial installer screen will look something like the following:

Starting automated install......
Generating updated storage configuration
Checking storage configuration...
================================================================================
================================================================================
Installation

 1) [x] Language settings                 2) [x] Timezone settings
        (English (United Kingdom))               (Etc/UTC timezone)
 3) [x] Software selection                4) [x] Installation source
        (Custom software selected)               (http://lon.static.bitfolk.com/
 5) [x] Network settings                         centos/7/os/x86_64)
        (Wired (eth0) connected)          6) [x] Install Destination
 7) [x] Kdump                                    (Custom partitioning selected)
        (Kdump is enabled)                8) [!] Create user
 9) [!] Set root password                        (No user will be created)
        (Password is not set.)
  Please make your choice from above ['q' to quit | 'b' to begin installation |
  'r' to refresh]:

You will need to select 9 to set a root password.

In what appears to be a bug, after setting the root password the installer will insist now that "3) Software selection" now needs completing. Select 3 and then make your selection (e.g. just 1 for a minimal install), then c to continue.

The installer screen will now resemble:

 1) [x] Language settings                 2) [x] Timezone settings
        (English (United Kingdom))               (Etc/UTC timezone)
 3) [!] Software selection                4) [!] Installation source
        (Processing...)                          (http://lon.static.bitfolk.com/
 5) [x] Network settings                         centos/7/os/x86_64)
        (Wired (eth0) connected)          6) [x] Install Destination
 7) [x] Kdump                                    (Custom partitioning selected)
        (Kdump is enabled)                8) [x] Create user
 9) [x] Set root password                        (No user will be created)
        (Password is set.)
  Please make your choice from above ['q' to quit | 'b' to begin installation |
  'r' to refresh]:

r to refresh until it changes to:

 1) [x] Language settings                 2) [x] Timezone settings
        (English (United Kingdom))               (Etc/UTC timezone)
 3) [x] Software selection                4) [x] Installation source
        (Minimal Install)                        (http://lon.static.bitfolk.com/
 5) [x] Network settings                         centos/7/os/x86_64)
        (Wired (eth0) connected)          6) [x] Install Destination
 7) [x] Kdump                                    (Custom partitioning selected)
        (Kdump is enabled)                8) [x] Create user
 9) [x] Set root password                        (No user will be created)
        (Password is set.)
  Please make your choice from above ['q' to quit | 'b' to begin installation |
  'r' to refresh]:

and then you are ready to use b to begin the installation. There will be no further questions until the installation is completed.

If you desire an entirely automated installation then:

  1. Take a copy of the default kickstart file.
  2. Add an appropriate rootpw command.
  3. Host your kickstart file on some web server.
  4. Select your kickstart file from BitFolk's Xen Shell.

The addition of a rootpw command to the default kickstart will result in an entirely automated install that will not pause for input at all.

CentOS Stream 8.x's text mode installer

The CentOS 8.x installer with the default kickstart is very similar to the CentOS 7 version above, except:

  • It doesn't have an option to set root password. Instead there is only option 8, to create a user. You should give that user administrator privileges, then it will be able to use sudo. The root password is locked.
  • The bug where you have to set some other things again is fixed. After adding an admin user you'll use b to begin and then the install will be entirely automated.

Navigating the installer screens

The CentOS 8 installer (Anaconda) now runs under tmux, a terminal multiplexer.

While you can normally complete the install without ever switching between the installer's screens — or even pressing a key at all, if you used an automated kickstart file — you may wish to do so when debugging the process or for other advanced tasks.

As with normal usage of tmux you can switch to other screens by using the command sequence Ctrl+b and then the screen number (e.g. Ctrl+b then 2). The usual screens are:

  • main installer on screen 1
  • shell prompt on screen 2
  • logs on screen 3
  • command output on screen 4

The ElRepo kernel-lt will be automatically installed

Warning Warning: As of CentOS 8, Red Hat removed the ability to boot their kernels under Xen PV and PVH mode, even though the upstream Linux kernel enables this by default. Therefore BitFolk's CentOS installers will automatically switch you to the kernel-lt longterm kernel from the ElRepo project.

SELinux relabel

Upon first boot the first thing your install will do is an SELinux relabel so that SELinux functions correctly. If you're watching on the console it will tell you it's doing this, and then after a minute or so it will reboot. You can then use the Xen Shell console command to again connect to its console and see the subsequent normal boot.

CentOS Stream 9.x's text mode installer

The CentOS Stream 9.x installer is very similar to the one for Stream 8.x, except that it is now possible to set a root password when creating an admin user. If you don't set a root password then the root account will be locked and the only way to gain root access will be with sudo. As usual, the user you have designated as admin will have sudo access.