[Guide]: Install Debian on Razer Blade Stealth 13

Discussion in 'The Linux Corner' started by P5YKH3R, Feb 17, 2022.

  1. P5YKH3R

    P5YKH3R New Member

    [​IMG]
    This guide is for Razer Blade Stealth 13 (RZ09-03101E72)

    Overview

    The purpose of this guide is to provide a step-by-step guide to install Debian 11 on the Razer Blade Stealth 13 and solve the known Issues on the fly.

    Before reading this guide, please note:
    • Everything is included in the guide, so if you have problem, read the guide carefully again or search in the guide.
    • If you follow the guide and have problems, please post your questions.
    • Every command with "psykher" word means to be replaced with your user.
    Note: I recommend updating to the latest BIOS on windows before following the guide.


    Preparing UEFI USB

    Download: Debian 11 + nonfree
    Download: Rufus

    Open Rufus and select the options as bellow:
    • Partition scheme: MBR
    • Target System: UEFI
    • File System: FAT32
    • Cluster Size: 4096 bytes
    • Write in DD image mode

    BIOS settings

    Set BIOS to defaults and make sure:
    • UEFI boot is enabled
    • Secure Boot is disabled
    • Fast boot is disabled (you can turn it back on after finishing installation)

    Installing

    Boot from the USB drive and select "Graphical Install":
    • Choose your language, location and keyboard layout
    • Set hostname (computer name)
    • Leave the Domain name blank
    • Choose your root password
    • Set your user display name
    • Set your username for your account
    • Choose your password for your account
    • Configure your clock
    • Partition disks:
      • I recommend to use Guided with encrypted LVM
      • Select your disk for partitioning
      • Choose All files in one partition
      • Configure LVM: choose Yes
      • Don't change the default amount
      • Write changes to disks?: Yes
      • Don't scan for extra installation media
      • Choose your package manager: your country if available
      • Debian archive mirror: deb.debian.org
      • HTTP Proxy: leave it blank
      • Choose your desktop environment: debian standard desktop environment, GNOME, system utilities
      • Install GRUB boot loader to your primary drive
      • Choose your disk
    Note: In case that you peripherals are not being detected during the install please attach an external one to be able to complete the installation, it will be fixed later.


    Post Installation

    [-] In order to use sudo you may need to add your user to the sudoers file, open a terminal and type:

    Code:
    $ su
    # nano /etc/sudoers
    
    Add your user right after root and save:

    Note: You won't need root anymore on this guide so let's logout with the exit command.

    Code:
    # exit

    [-] Now let's fix the repositories sources:

    Code:
    $ sudo nano /etc/apt/sources.list
    
    You can replace all with this and save:


    [-] Next thing to do is install the latest kernel, nvidia drivers and intel CPU firmware:

    Code:
    $ sudo apt-get update
    $ sudo apt-get install -y build-essential dkms linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-detect nvidia-driver firmware-misc-nonfree mesa-utils intel-microcode
    $ sudo dpkg --add-architecture i386 && sudo apt-get update
    $ sudo apt-get install -y nvidia-driver-libs:i386
    
    I recommend to block and remove the previous default driver to avoid future issues:

    Code:
    $ sudo nano /etc/modprobe.d/blacklist-nouveau.conf
    
    Paste this and save:

    Then let's update the initramfs and remove the default driver:

    Code:
    $ echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
    $ sudo update-initramfs -u
    $ sudo apt-get remove --purge xserver-xorg-video-nouveau
    
    Reboot your system to enable the nvidia driver:

    Code:
    $ systemctl reboot
    
    Now verify that the nvidia driver is loading properly:

    Code:
    $ lspci -k | grep -EA3 'VGA|3D|Display'
    

    [-] Closing / opening lid is not being recognized, so let's fix it with a grub update:

    Code:
    $ sudo nano /etc/default/grub
    
    First section should have these entries:

    Update the grub and remove the boot messages:

    Code:
    $ sudo update-grub
    $ sudo nano /etc/init.d/rcS
    
    Paste this and save:


    [-] There are still some issues when suspending the laptop, let's fix them:

    Note: this setting must be set! Otherwise closing the lid won't suspend the laptop.

    Now lets fix the timeout response when suspending / awaking:

    Code:
    $ sudo nano /etc/systemd/system.conf
    
    Change the following lines with these values:


    [-] Now let's fix the webcam reloading the uvcvideo kernel module with the "quirks=512" argument:

    Code:
    $ sudo nano /etc/modprobe.d/razer.conf
    
    And add this line to the file and save:


    [-] If you have bluetooth disconnection / re-connection issues, you can execute the following to permanent fix them:

    Code:
    $ sudo nano /etc/bluetooth/main.conf
    
    Comment out and change these values:

    Finally remove your bluetooth device (manual), whitelist it and connect again:

    Code:
    $ bluetoothctl
    $ power on
    $ scan on
    $ pair [MAC Address]
    $ trust [MAC Address]
    $ connect [MAC Address]
    
    Note: This last step should be done for all your bluetooth devices

    When done you can exit the bluetooth interface with the exit command:

    Code:
    $ exit
    
    [-] Next thing is fix the laptop battery efficiency

    Code:
    $ sudo apt-get install -y tlp tlp-rdw
    $ sudo nano /etc/tlp.conf
    
    Look for this entry and change the value to 0

    Then enable the service:

    Code:
    $ sudo tlp start
    $ sudo tlp-stat -b
    $ sudo systemctl enable tlp.service
    
    [-] Now let's enable the Network Manager

    Code:
    $ sudo nano /etc/NetworkManager/NetworkManager.conf
    
    It should look like this:

    And restart the service:

    Code:
    $ sudo service NetworkManager restart
    
    [-] Since this is a 16GB fixed RAM laptop, let's fix the memory swap

    Code:
    $ sudo nano /etc/sysctl.conf
    
    Change this value to 10 and save:


    [-] Finally you need to install some Razer tools and drivers:

    Code:
    $ sudo apt-get install -y curl
    
    Add your user to the razer group:

    Code:
    $ sudo gpasswd -a psykher plugdev
    
    Download and install Open Razer:

    Code:
    $ echo 'deb http://download.opensuse.org/repositories/hardware:/razer/Debian_11/ /' | sudo tee /etc/apt/sources.list.d/hardware:razer.list
    $ curl -fsSL https://download.opensuse.org/repositories/hardware:razer/Debian_11/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/hardware_razer.gpg > /dev/null
    $ sudo apt-get update
    $ sudo apt-get install -y openrazer-meta
    
    Download and install Polychromatic:

    Code:
    $ echo "deb http://ppa.launchpad.net/polychromatic/stable/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/polychromatic.list
    $ sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 96B9CD7C22E2C8C5
    $ sudo apt-get update
    $ sudo apt-get install -y polychromatic
    
    Restart your system:

    Code:
    $ systemctl reboot
    
    You are done, that's pretty much it! You can change your lights color with the polychromatic tool, find it on your apps icons.

    Note: If you find more issues / fixes please post them here.
     
    Last edited: Feb 23, 2022
  2. jaust12

    jaust12 New Member

    thanks for this nice and clear guide! I wish this existed earlier. But using some of the Infos from this Forum and others, I have manged to get my late 2020 blade stealth to run Linux Mint 20.3 Una with Kernel 5.13 finally smooth and flawless. Battery-life is comparable to windows.
    I basically did almost exactly what you are describing in your guide, except from tlp, which simply doesn't work with intels 11th gen.
     
    P5YKH3R likes this.
  3. Is it the same for Rz09-0327. the 2020 version laptop?
     
  4. jaust12

    jaust12 New Member

    I have the same model as mentioned above, with linux mint it runs very smooth. the only issue im still struggling with is the wake up from hibernation that is not always working correctly.
     
  5. P5YKH3R

    P5YKH3R New Member

    What is the issue? Did you add this line to your grub file?

    Code:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash loglevel=0 button.lid_init_state=open mem_sleep_default=deep"
     
  6. jaust12

    jaust12 New Member

    yes i did, without it i couldnt even start the os.
    the bug im facing only appears when i close the lid (on battery) or when it sets itself in sleep according to the time set in the menu. after that i only have a black screen and the pc doesnt react to any command except from the power button.

    when i sent my pc to sleep manually, the wakeup is working without issues. Any clues would be very much appreciated since my investigations haven't got me any result so far.
     
  7. Thank you so much for the detail post sharing with us. I am going to try this and will share my experience here with you guys. Thanks again!!
     
  8. jaust12

    jaust12 New Member

    I just discovered that my monitor actually disables when going in sleep mode and that it seems to have problems to reactivate itself. I've just taken my laptop, it set itself to sleep, the monitor wouldn't turn on by opening the lid and/or pressing whatever. But now I plugged my usb-c dock (computer turned on, woken from sleep, monitor black) and the external monitor turned on immediately, when I checked the screen settings, the laptop monitor was set to deactivated.

    I think I'll try to remap a key to turn the monitor on/off as an easy workaround :stuck_out_tongue_winking_eye:
     
  9. can u guide me how to install a software for cctv camera .
    on razer laptop.
     
  10. THANKS SO MUCH FOR THIS AMAZING ARTICLE .
    IBUY RAZOR LAPTOP BUT THE WEB BROWSER ON IT NOT RUNNING . LIKE I OPEN MY TREE WEBSITE SYSTEM WILL AUTOMATICALLY SHUT DOWN.
    KINDLY SOLVE MY ISSUE I HAVE ONLY THIS PC TO OPEN MY TREE SERVICE WEBSITE.
     
Sign In with Razer ID >


Don't have a Razer ID yet?
Get Razer ID >