Prerequisites
All that is described below relies on the virtualization technologies of the CPU in your computer. Therefore, you first have to check if this is enabled in your BIOS/UEFI and enable virtualization on Windows.
A simple procedure to access the BIOS/UEFI of your computer and enable virtualization on Windows is available
Anyway, your favorite search engine will give you several answers.
Installation
WSL
Windows Subsystem for Linux (WSL) is an abstract layer allowing a Linux virtual machine to run on top of Windows. It requires the hardware virtualisation support to be activated. It must be manually enabled to be available. You will find installation instructions reading the official Microsoft documentation (Manual setup).
| Configure your system to use WSL 2 right now (if possible). |
Ubuntu
You may want to choose any Linux version that suits your tastes. However, for the purpose of this lesson as well as some others in the Major Informatique, we will use Ubuntu (the latest LTS release available) — LTS stands for Long Term Support, which means it will be maintained (new software, bug fixes, security updates) for at least five years.
The install process is done via the Microsoft Store in two steps: first download the package, then install it. You have to initiate each step manually.
|
You may be prompted to enter your Microsoft Account credentials when installing the Ubuntu package. They are not actually required and you can safely proceed by clicking |
First run
Once your Ubuntu package is installed, you can launch you Linux distribution by clicking its icon in the Start menu.
A window will open in which your are asked to create a new user. This will be you default user and may have a different name than your Windows account. It’s up to you to choose, but use a secure enough password for this user and remember it!
For the purpose of this document, our default user login name is smith.
|
Users
Your default user has now been set, but there are some other users already available on the system. The most famous and useful one is root (the superuser).
root, the superuser
|
The superuser is granted all rights, it can damage the system beyond repair. Be careful! |
On Ubuntu Linux it is not possible to directly login as root. There’s actually no password for this user, making it impossible to be granted access via a regular login process. However, some administrative tasks have to be done as root, so we have to find a way to become root.
One can temporarily obtain the root privileges using the sudo command. To elevate the privileges of a specific command, you have to prefix it with sudo. As an example, you could try to list the content of the superuser home directory.
/root directory as a regular user and using sudo$> ls -a /root (1)
ls: cannot open directory '/root': Permission denied
$> sudo ls -a /root (2)
[sudo] password for smith:
. .. .bash_history .bashrc .motd_shown .profile .viminfo
$>
| 1 | a regular user (as yourself) cannot list the content of the /root directory. |
| 2 | using sudo the ls command gains temporarily some more privileges and therefore can list the content of the home directory of the root user. |
When configured properly, sudo will ask for your password. This means you are listed as a sudoer.
|
Tweaking the system
Behaviour and Look & Feel of the terminal
You may want to change the colors and font of the main window or enable the copy/paste feature between Linux and Windows.
All of these can be done by right clicking on the window title bar and selecting Properties. In the pop-up window, browse through tabs to make adjustments:
- Options
-
Check the
Use Ctrl+Shift+C/V as copy/pastebox. This way you will be able to copy/paste text from/to the Windows host without interfering with the regular kbd:[Ctrl+C] used to kill processes under Linux. You may also want to change other settings there, to suit your needs. - Police
-
Select the font you want to use. I highly recommend the use of the Source Code Pro font (get the TTF version and install it under Windows) as it is perfect for text editing and computer science stuff in general. This font is designed in a way where glyphs are clearly distinguishable so you don’t mix up characters (unlike this font…) like those ones:
0OILl1(zero, uppercase o, uppercase i, uppercase l, lowercase l, one). Compare with 0OILl1. - Configuration
-
Nothing relevant there.
- Colors
-
Change the colors of the foreground and the background.
- Terminal
-
Within this tab you may change the behavior and shape of the cursor.
System Localisation
$> sudo vim /etc/locale.gen
Uncomment the line that corresponds to your preferred language. As an example, French users should uncomment the following line. Always choose the UTF-8 variant.
fr_FR.UTF-8 UTF-8
then, regenerate the locales with
$> locale-gen
Shell behavior
The default configuration is fine, nothing to do here.
Installing & upgrading software
At this stage there is no need for more software.
| It is wise to update your system before any attempt to install a new software. |
Every installation or removal of packages (as well as system updates) has to be done with elevated privileges. This means that you need being the root user or using the sudo command.
To update your system (you’ll have to do this on a regular basis), follow the steps below.
$> sudo apt update (1)
[sudo] password for smith: (2)
... lots and lots of messages ... (3)
$> sudo apt dist-upgrade (4)
... list of packages to upgrade ... (3)
Do you want to continue? [Y/n] (5)
... upgrade progress messages ...
$>
| 1 | This is the main command to update the software database (repositories). |
| 2 | As usual, you have to type in your password to unlock sudo. |
| 3 | The apt command outputs a lot of messages about what is being done. |
| 4 | Once the repositories are synced, you ask apt to actually upgrade the system. |
| 5 | The list of upgradable packages is displayed and apt asks you if you want to proceed. You can enter kbd:[Y] or simply kbd:[Return] to accept. |
Your system is now up and running, let’s start learning!