Skip to content

Instantly share code, notes, and snippets.

@thelbouffi
Last active June 22, 2019 21:53
Show Gist options
  • Select an option

  • Save thelbouffi/50cd0cd05ce065650e0a094291c7395f to your computer and use it in GitHub Desktop.

Select an option

Save thelbouffi/50cd0cd05ce065650e0a094291c7395f to your computer and use it in GitHub Desktop.

Revisions

  1. thelbouffi revised this gist Jun 22, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions virtualbox_installation.txt
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,8 @@ when installing on virtualox we have to install Guest Additions, to be able to i
    - first way: from terminal
    pacman -S virtualbox-guest-utils => for VirtualBox Guest utilities with X support, then choose for the default linux kernel choose virtualbox-guest-modules-arch and for non-default kernels choose virtualbox-guest-dkms
    pacman -S virtualbox-guest-utils-nox => for VirtualBox Guest utilities without X support
    systemctl enable vboxservice
    reboot

    - second way:
    mount the VBoxGuestAdditions.iso on cdrom of virtualbox app
  2. thelbouffi revised this gist Jun 22, 2019. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions virtualbox_installation.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    when installing on virtualox we have to install Guest Additions, to be able to improve image resolution and better control of the mouse. :

    - first way: from terminal
    pacman -S virtualbox-guest-utils => for VirtualBox Guest utilities with X support, then choose for the default linux kernel choose virtualbox-guest-modules-arch and for non-default kernels choose virtualbox-guest-dkms
    pacman -S virtualbox-guest-utils-nox => for VirtualBox Guest utilities without X support

    - second way:
    mount the VBoxGuestAdditions.iso on cdrom of virtualbox app
    mount /dev/cdrom /mnt => this will mount the cdrom
    cd /mnt
    ./VBoxLinuxAdditions.run

    ========
    NOTE:
    ========
    we may need to have as graphical card VBoxVGA to be able to have full screen
    so go to the virtualbox app => arch vdi setting => display => choose as graphics controller VBoxVGA


  3. thelbouffi revised this gist Jun 22, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 5_lxde_installation.txt
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ GNOME - gdm
    LXDE - lxdm
    Universal Display manager - lgthdm, mdm-dispaly-manager, slim, xorg-xdm

    pacman -S xorg-server xorg-server-utils xorg-xinit => the default package of xorg is xorg-server and the other are utilities that we may need later
    pacman -S xorg-server xorg-xinit => the default package of xorg is xorg-server and the other are utilities that we may need later
    pacman -S driver-of-my-gpu
    pacman -S lxdm

  4. thelbouffi revised this gist Jun 22, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -41,6 +41,8 @@ III- Mount partitions to system
    The reason why we mount in this way (one partion at /mnt and the second partition as folder in that parttion /mnt/boot)
    is to allow pacstrap to write into a single folder wich in facts write in two partitions and that makes it easy to install
    So pacstrap will put the base system onto the mount point wich write it into both partitions some inside /mnt/boot and some into /mnt

    NOTE: if we have a swap partition we dont need to mount it
    =======================================================
    IV- Install the base packages
    pacstrap is a binary of arch (/usr/bin/pacstarp) it writes the base system to a mount point
  5. thelbouffi revised this gist Jun 22, 2019. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -13,13 +13,23 @@ I- Partitionate the disk
    w
    fdisk -l

    NOTE: we can also partitionate using cfdisk
    NOTE:
    - we can also partitionate using cfdisk
    - normally we should create 3 partitions boot partition, swap partition and root partition

    ======================================================
    II- Format
    mkfs.vfat -F32 /dev/sda1
    mkfs.ext4 /dev/sda2

    NOTE:
    if we have 3 partitions sda1 sda2 and sda3, we can format them like that:
    mkfs.ext2 /dev/sda1 => for the boot also we can format using ext4
    mkfs.ext4 /dev/sda3 => for the root partition
    mkswap /dev/sda2
    swapon /dev/sda2 => for the swap partition


    ======================================================
    III- Mount partitions to system
    ls -l /mnt==> we should fint nothing
  6. thelbouffi revised this gist Jun 22, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,8 @@ I- Partitionate the disk
    w
    fdisk -l

    NOTE: we can also partitionate using cfdisk

    ======================================================
    II- Format
    mkfs.vfat -F32 /dev/sda1
  7. thelbouffi revised this gist Jun 21, 2019. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -116,5 +116,10 @@ reboot

    now we can access arch from Boot existing os

    ============================================================
    XII - Logging
    we boot from Boot existing os
    we insert for login : root
    for password: the password that we created


  8. thelbouffi revised this gist Jun 21, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -103,7 +103,6 @@ The GRUB (Grand Unified Bootloader) is the first program which starts when the p
    pacman -S grub
    grub-install /dev/sda
    grub-mkconfig -o /boot/grub/grub.cfg
    reboot

    df -h => to see our disk how it looks like

  9. thelbouffi revised this gist Jun 21, 2019. No changes.
  10. thelbouffi revised this gist Jun 21, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -101,7 +101,7 @@ grub is meant for allowing us access arch from Boot existing os
    The GRUB (Grand Unified Bootloader) is the first program which starts when the program is switched on. The bootloader transfers the control to the operating system kernel.

    pacman -S grub
    grub install /dev/sda
    grub-install /dev/sda
    grub-mkconfig -o /boot/grub/grub.cfg
    reboot

  11. thelbouffi revised this gist Jun 21, 2019. 2 changed files with 14 additions and 6 deletions.
    14 changes: 14 additions & 0 deletions 2_in_case_of_pb_after_installation.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    back to Boot Arch Linux (x86_64)

    mount /dev/sda2 /mnt
    mount /dev/sda1 /mnt/boot
    arch-chroot /mnt

    make the fix you want

    exit
    umount /mnt/boot
    umount /mnt
    reboot

    then Boot from existing os
    6 changes: 0 additions & 6 deletions 2_install_grub.txt
    Original file line number Diff line number Diff line change
    @@ -1,6 +0,0 @@
    pacman -S grub
    grub install /dev/sda
    grub-mkconfig -o /boot/grub/grub.cfg
    reboot

    df -h => to see our disk how it looks like
  12. thelbouffi revised this gist Jun 21, 2019. 1 changed file with 13 additions and 1 deletion.
    14 changes: 13 additions & 1 deletion 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -94,9 +94,21 @@ for me I did:
    IX- set password
    passwd => insert the new password

    ==========================================================
    X- install grub

    grub is meant for allowing us access arch from Boot existing os
    The GRUB (Grand Unified Bootloader) is the first program which starts when the program is switched on. The bootloader transfers the control to the operating system kernel.

    pacman -S grub
    grub install /dev/sda
    grub-mkconfig -o /boot/grub/grub.cfg
    reboot

    df -h => to see our disk how it looks like

    ===========================================================
    X- Exit
    XI- Exit
    now we can exit from chroot envirement
    exit
    umount /mnt/boot
  13. thelbouffi revised this gist Jun 21, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -99,8 +99,8 @@ passwd => insert the new password
    X- Exit
    now we can exit from chroot envirement
    exit
    unmount /mnt/boot
    unmount /mnt
    umount /mnt/boot
    umount /mnt
    reboot

    now we can access arch from Boot existing os
  14. thelbouffi revised this gist Jun 21, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -91,8 +91,8 @@ for me I did:
    127.0.0.1 localhost myHostname

    ==========================================================
    IX- set passwd
    insert the new password
    IX- set password
    passwd => insert the new password


    ===========================================================
  15. thelbouffi revised this gist Jun 21, 2019. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -80,12 +80,16 @@ hostname => to see the new hostname
    IX- set hosts file
    it contains different host names to ip adresses

    on docs we have
    nano /etc/hosts
    127.0.0.1 localhost
    ::1 localhost
    127.0.1.1 myhostname.localdomain myhostname
    then save

    for me I did:
    127.0.0.1 localhost myHostname

    ==========================================================
    IX- set passwd
    insert the new password
  16. thelbouffi revised this gist Jun 21, 2019. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -68,7 +68,6 @@ locale-gen => will generate locale uncommented
    now we should create the locale.conf
    nano /etc/locale.conf => and then add the LANG and KEYMAP for example
    LANG=en_US.UTF-8
    KEYMAP=de-latin1
    and finally ctrl+O and ctrl+X to save

    ==========================================================
  17. thelbouffi revised this gist Jun 21, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -37,7 +37,7 @@ IV- Install the base packages

    =======================================================
    V- Generate the fsatb file
    genstab -U /mnt >> /mnt/etc/fstab
    genfstab -U /mnt >> /mnt/etc/fstab
    cat /mnt/etc/fstab => to chack its content

    what this file does is once our system boots it will use this file to know:
    @@ -61,15 +61,15 @@ date => to check out the time
    ==========================================================
    VIII- set localization
    we will generate the local files
    nano /etc/locale.gen => uncomment locale you want and save
    nano /etc/locale.gen => uncomment locale you want and ctrl+O and ctrl+X to save

    locale-gen => will generate locale uncommented

    now we should create the locale.conf
    nano /etc/locale.conf => and then add the LANG and KEYMAP for example
    LANG=en_US.UTF-8
    KEYMAP=de-latin1
    and finally ctrl+X to save
    and finally ctrl+O and ctrl+X to save

    ==========================================================
    IX- set hostname
  18. thelbouffi revised this gist Jun 21, 2019. 1 changed file with 27 additions and 0 deletions.
    27 changes: 27 additions & 0 deletions 5_lxde_installation.txt
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,30 @@
    another example of installing dektop env.
    ===================================
    part 1: create a user acount

    useradd -m -g users -s /bin/bash taha => creates a user called taha -s to use bash as defalut shell -m create /home/taha -g to add taha to group of users
    passwd taha
    visudo => to add taha to sudoers, when visudo opened scroll to root ALL=(ALL) ALL and insert taha ALL=(ALL) ALL

    =====================================
    part 2: install prerequisites (display server, graphics driver, display manager)

    * display server is the link between software and hardware, it allows the computer to display images taht we want by configuring the graphic card to dispaly them on the monitor => the most popular display server is xorg
    *find the appropriate gpu driver and install it, xf86-video-vesa is a standard of all gpu cards
    *display manager is the login page, for each desktop env ther is a recomanded display manager like below in the list:
    KDE Plasma 5 - sddm
    KDE4 - kdm*
    GNOME - gdm
    LXDE - lxdm
    Universal Display manager - lgthdm, mdm-dispaly-manager, slim, xorg-xdm

    pacman -S xorg-server xorg-server-utils xorg-xinit => the default package of xorg is xorg-server and the other are utilities that we may need later
    pacman -S driver-of-my-gpu
    pacman -S lxdm

    ======
    NOTE:
    ======
    To choose the right driver, first detect the graphics card. lspci can be used for this task:

    lspci -v => all devices
  19. thelbouffi revised this gist Jun 21, 2019. No changes.
  20. thelbouffi revised this gist Jun 20, 2019. 1 changed file with 54 additions and 0 deletions.
    54 changes: 54 additions & 0 deletions 5_lxde_installation.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    To choose the right driver, first detect the graphics card. lspci can be used for this task:

    lspci -v => all devices

    or

    root #lspci | grep -i VGA
    This should show something like this:

    root #lspci | grep -i VGA
    00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)

    the 3rd gen is an intel i915

    Generation Chipset OpenGL OpenGL-ES OpenCL VAAPI Vulkan VIDEO_CARDS
    Gen 3 915G/GM, 945G/GM, G/Q33, Q35, Atom D4xx/D5xx/N4xx/N5xx 1.4 No No No No intel i915

    so we will install for intel the driver xf86-video-intel

    Note that generally for:
    AMD -> xf86-video-amdgpu
    NVIDIA -> xf86-video-nouveau
    INTEL -> xf86-video-intel
    xf86-video-vesa is a standard driver

    pacman -S xf86-video-intel

    =========================================
    part 3: install the desktop environement

    we are going to instal the group that contains the packages that we need for tha desktop environment
    KDE Plasma 5 -> plasma
    Cinnamon -> cinnamon
    GNOME -> gnome
    LXDE -> lxde or lxde-gtk3*
    MATE -> lxde or mate-gtk3*
    Xfce -> xfce4

    pacman -S lxde

    By default it only install the minimum of desktop env, and not many other apps that go with it, to do that we can install other packages that have a bundle of group of packages like
    KDE Plasma 5 -> kade-applications
    Cinnamon -> N/A (not applicable or available)
    GNOME -> gnome-extra
    LXDE -> (not applicable or available)
    MATE -> mate-extra
    Xfce -> xfce4-goodies

    =================================================
    part 4: launch the display manager while booting

    systemctl enable lxdm
    systemctl start lxdm
    reboot
  21. thelbouffi revised this gist Jun 20, 2019. 2 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  22. thelbouffi revised this gist Jun 20, 2019. 1 changed file with 30 additions and 0 deletions.
    30 changes: 30 additions & 0 deletions add_mate_dm.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    to get somthing graphical on our machine we need: desktop or display managers "dms" & desktop environement "des"
    globaly we need:
    - X server
    - GPU driver
    - Window Manager (Gnome, KDE, i3wm)
    - Apps (terminal urxvt for example)
    for our example we will install:
    - 1st we need xorg-server: X server
    Xorg is the X Window server which allows users to have a graphical environment at their fingertips. X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting with a mouse and keyboard. The X.Org Server implements the server side of the X Window System core protocol
    - 2nd lxdm: display manager
    LXDM is a lightweight display manager for the LXDE desktop environment.
    - 3rd mate is one of many desktop env like gnome, kde, kde/plasma, lxde, Xfce, nome
    - 4th mate-extra

    pacman -S xorg-server lxdm mate mate-extra
    useradd -m -d /home/taha taha => we need a user with pwd beacause on arch we are root
    passwd taha
    systemctl enable lxdm
    systemctl start lxdm => launch the display manager


    ====================================================
    NOTE: to go back to arch terminal ctrl + F2

    ====================================================
    to let a user do root things
    ctrl+F2
    login
    nano /etc/sudoers
    taha ALL=(ALL) ALL
  23. thelbouffi revised this gist Jun 20, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion enable_networking.txt
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ note that Arch comes with systemd wich means we have systemctl command

    ip addr => to see if we have a network interface

    systemctl enable dhcpcd
    systemctl enable dhcpcd => to make this service start each time we reboot
    systemctl start dhcpcd

    this will enable our network interface and we ill have an IP to work with
  24. thelbouffi revised this gist Jun 20, 2019. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions enable_networking.txt
    Original file line number Diff line number Diff line change
    @@ -8,3 +8,7 @@ systemctl enable dhcpcd
    systemctl start dhcpcd

    this will enable our network interface and we ill have an IP to work with

    to test if it works

    ping google.com
  25. thelbouffi revised this gist Jun 20, 2019. 2 changed files with 11 additions and 1 deletion.
    2 changes: 1 addition & 1 deletion 2_install_grub.txt
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,4 @@ grub install /dev/sda
    grub-mkconfig -o /boot/grub/grub.cfg
    reboot

    df -h => to see
    df -h => to see our disk how it looks like
    10 changes: 10 additions & 0 deletions enable_networking.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    networking is not enabled (so ifconfig ping wont work) => we need to enable DHCP (Dynamic Host Configuration Protocol) precisely DHCP clinet which is for Arch it's dhcpcd.

    note that Arch comes with systemd wich means we have systemctl command

    ip addr => to see if we have a network interface

    systemctl enable dhcpcd
    systemctl start dhcpcd

    this will enable our network interface and we ill have an IP to work with
  26. thelbouffi created this gist Jun 19, 2019.
    106 changes: 106 additions & 0 deletions 1_install_arch_linux.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,106 @@
    =======================================================
    I- Partitionate the disk
    fdisk -l
    fdisk /dev/sda
    * boot partition
    n -> p -> enter -> enter (defines first sector for boot partition by default 2048) -> 1002048 sectors (defines last sector for boot partition)
    a (toogle boot) -> t (type) -> ef (EFI)
    * disk parttion
    n -> p -> enter -> enter (fst sector) -> enter (last sector)
    * to see parttion table
    p
    * to write save & quit
    w
    fdisk -l

    ======================================================
    II- Format
    mkfs.vfat -F32 /dev/sda1
    mkfs.ext4 /dev/sda2

    ======================================================
    III- Mount partitions to system
    ls -l /mnt==> we should fint nothing
    mount /dev/sda2 /mnt
    mkdir /mnt/boot
    mount /dev/sda1 /mnt/boot
    df -h ==> should print that /dev/sda1 & /dev/sda2 are mounted

    The reason why we mount in this way (one partion at /mnt and the second partition as folder in that parttion /mnt/boot)
    is to allow pacstrap to write into a single folder wich in facts write in two partitions and that makes it easy to install
    So pacstrap will put the base system onto the mount point wich write it into both partitions some inside /mnt/boot and some into /mnt
    =======================================================
    IV- Install the base packages
    pacstrap is a binary of arch (/usr/bin/pacstarp) it writes the base system to a mount point

    pacstrap /mnt base => live installation will start

    =======================================================
    V- Generate the fsatb file
    genstab -U /mnt >> /mnt/etc/fstab
    cat /mnt/etc/fstab => to chack its content

    what this file does is once our system boots it will use this file to know:
    which partions to mount, where to mount them, the options to mount them with and then the order of mounting
    In our case it will be two entries:
    * the root system /dev/sda2 mounetd on / its type is ext4 read/write
    * the boot partition mounetd at /boot type vfat

    blkid ==> this command also give us idea about the system mounted partition

    ========================================================
    VI- chroot the system
    arch-chroot /mnt => arch linux iso root will change to our installed / (but we are still on the iso)

    =========================================================
    VII- set time zone
    now we are on our system any thing we will it will remain on our system, so we can set time
    ln -sf /usr/share/zoneinfo/africa/casablanca /etc/localtime
    date => to check out the time

    ==========================================================
    VIII- set localization
    we will generate the local files
    nano /etc/locale.gen => uncomment locale you want and save

    locale-gen => will generate locale uncommented

    now we should create the locale.conf
    nano /etc/locale.conf => and then add the LANG and KEYMAP for example
    LANG=en_US.UTF-8
    KEYMAP=de-latin1
    and finally ctrl+X to save

    ==========================================================
    IX- set hostname
    hostname => to see the actual hostname it will be archiso
    nano /etc/hostname => insert wanted hostname myHostname then ctrl+X
    hostname => to see the new hostname

    ==========================================================
    IX- set hosts file
    it contains different host names to ip adresses

    nano /etc/hosts
    127.0.0.1 localhost
    ::1 localhost
    127.0.1.1 myhostname.localdomain myhostname
    then save

    ==========================================================
    IX- set passwd
    insert the new password


    ===========================================================
    X- Exit
    now we can exit from chroot envirement
    exit
    unmount /mnt/boot
    unmount /mnt
    reboot

    now we can access arch from Boot existing os



    6 changes: 6 additions & 0 deletions 2_install_grub.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    pacman -S grub
    grub install /dev/sda
    grub-mkconfig -o /boot/grub/grub.cfg
    reboot

    df -h => to see