|
| 1 | +# Installation |
| 2 | + |
| 3 | +## Install AlmaLinux 9 |
| 4 | + |
| 5 | +Open Microsoft Store, in the search box type in: `AlmaLinux` and hit `Enter`. |
| 6 | + |
| 7 | +From the results, select **AlmaLinux 9** - this will take you to **AlmaLinux 9**'s app page. |
| 8 | + |
| 9 | +On this page, locate and click the `Install` button - this will download **AlmaLinux 9** WSL image on your system. |
| 10 | + |
| 11 | +Once the download has finished, the `Install` button is replaced by an `Open` button - clicking it will open |
| 12 | +`Windows Terminal`. |
| 13 | + |
| 14 | +Here you will be asked to fill in your username (for example `dotkernel`): |
| 15 | + |
| 16 | +```text |
| 17 | +Installing, this may take a few minutes... |
| 18 | +Please create a default UNIX user account. The username does not need to match your Windows username. |
| 19 | +For more information visit: https://aka.ms/wslusers |
| 20 | +Enter new UNIX username: |
| 21 | +``` |
| 22 | + |
| 23 | +Next, you are prompted to enter a password to use with your username (you will not see what you are typing, that's a |
| 24 | +security measure in Linux regarding passwords): |
| 25 | + |
| 26 | +```text |
| 27 | +Enter new UNIX username: dotkernel. |
| 28 | +Changing password for user dotkernel. |
| 29 | +New password: |
| 30 | +``` |
| 31 | + |
| 32 | +Depending on the strength of your password, you might see one of the following messages (if you want to choose a |
| 33 | +different password, hit `Enter` and you are taken back to previous step - else, continue with retyping your password). |
| 34 | + |
| 35 | +```text |
| 36 | +BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word |
| 37 | +BAD PASSWORD: The password is a palindrome |
| 38 | +``` |
| 39 | + |
| 40 | +Next, you are asked to retype your password: |
| 41 | + |
| 42 | +```text |
| 43 | +Retype new password: |
| 44 | +``` |
| 45 | + |
| 46 | +Finally, you should see the following message: |
| 47 | + |
| 48 | +```text |
| 49 | +passwd: all authentication tokens updated successfully. |
| 50 | +Installation successful! |
| 51 | +[dotkernel@hostname:~]$ |
| 52 | +``` |
| 53 | + |
| 54 | +## Setup the packages in AlmaLinux 9 |
| 55 | + |
| 56 | +Install requirements: |
| 57 | + |
| 58 | +```shell |
| 59 | +sudo dnf install epel-release dnf-utils http://rpms.remirepo.net/enterprise/remi-release-9.rpm -y |
| 60 | +``` |
| 61 | + |
| 62 | +Update/Upgrade system packages: |
| 63 | + |
| 64 | +```shell |
| 65 | +sudo dnf upgrade -y |
| 66 | +``` |
| 67 | + |
| 68 | +Now, install the latest version of **Ansible**: |
| 69 | + |
| 70 | +```shell |
| 71 | +sudo dnf install ansible -y |
| 72 | +``` |
| 73 | + |
| 74 | +Clone `dotkernel/development` into your home directory: |
| 75 | + |
| 76 | +```shell |
| 77 | +git clone https://github.com/dotkernel/development.git |
| 78 | +``` |
| 79 | + |
| 80 | +Move inside the directory `development/wsl`: |
| 81 | + |
| 82 | +```shell |
| 83 | +cd ~/development/wsl/ |
| 84 | +``` |
| 85 | + |
| 86 | +Using your preferred text editor, open `config.yml` where you must fill in the empty fields. |
| 87 | + |
| 88 | +Save and close the file. |
| 89 | + |
| 90 | +Install requirements and initialize systemd by running the below Ansible command: |
| 91 | + |
| 92 | +```shell |
| 93 | +ansible-playbook -i hosts install.yml --ask-become-pass |
| 94 | +``` |
| 95 | + |
| 96 | +The installation process will ask for your password (set during the installation process) and will iterate over each |
| 97 | +task in the playbook and will output a short summary with the results. |
| 98 | + |
| 99 | +At this step, **AlmaLinux 9** needs to be restarted - quit it by pressing `Control` + `d`. |
| 100 | + |
| 101 | +Open `Windows Terminal`. |
| 102 | + |
| 103 | +Stop **AlmaLinux 9**: |
| 104 | + |
| 105 | +```shell |
| 106 | +wsl -t AlmaLinux9 |
| 107 | +``` |
| 108 | + |
| 109 | +Start **AlmaLinux 9**: |
| 110 | + |
| 111 | +```shell |
| 112 | +wsl -d AlmaLinux9 |
| 113 | +``` |
| 114 | + |
| 115 | +Move inside the directory `development/wsl`: |
| 116 | + |
| 117 | +```shell |
| 118 | +cd ~/development/wsl/ |
| 119 | +``` |
| 120 | + |
| 121 | +Continue installation by running the below Ansible command: |
| 122 | + |
| 123 | +```shell |
| 124 | +ansible-playbook -i hosts install.yml --ask-become-pass |
| 125 | +``` |
| 126 | + |
| 127 | +The installation process will ask for your password (set during the installation process) and will iterate over each |
| 128 | +task in the playbook and will output a short summary with the results. |
| 129 | + |
| 130 | +Now check if everything works by opening in your browser: |
| 131 | + |
| 132 | +- [http://localhost/](http://localhost/) - Apache's default home page |
| 133 | +- [http://localhost/info.php](http://localhost/info.php) - PHP info page |
| 134 | +- [http://localhost/phpmyadmin/](http://localhost/phpmyadmin/) - PhpMyAdmin (login with `root` + the root password you |
| 135 | +configured in `config.yml` under `mariadb` -> `root_password`) |
| 136 | + |
| 137 | +The installation is complete, your **AlmaLinux 9** development environment is ready to use. |
| 138 | + |
| 139 | +## Running AlmaLinux 9 |
| 140 | + |
| 141 | +Open `Windows Terminal`. |
| 142 | + |
| 143 | +Start **AlmaLinux 9**: |
| 144 | + |
| 145 | +```shell |
| 146 | +wsl -d AlmaLinux9 |
| 147 | +``` |
| 148 | + |
| 149 | +### Note |
| 150 | + |
| 151 | +> In order to run your applications using WSL2, you always need to be connected to your AlmaLinux9 distribution. |
| 152 | +> For this, all you need to do is to keep open an instance of Windows Terminal that is connected to it. |
0 commit comments