Surface device perfect installation Linux/Archlinux dual system tutorial

I. Introduction


The blogger is a student of the School of Accounting, because he often runs around with his computer on his back. Considering that he is not that strong, he started with a surface laptop. Then I often use Linux in the learning process. It is not convenient to use a virtual machine for a long time, so I tried to install dual systems. After a long time, I took a lot of detours. In the end, it was perfectly done, so I recorded It is convenient for later generations.

note

The perfect installation of the title refers to that the dual system can be booted normally in the Secureboot mode , that is, it does not cause any impact on Windows , and Linux devices can be driven normally .

Secureboot only allows trusted systems to start on the Surface. Installing non-windows systems will not start directly. Turning off Secureboot will make Windows hello unavailable. Later in this article we will talk about how to boot dual systems normally with Secureboot mode turned on.

2. Preparation


External devices

  1. A U disk (not less than 8G)
  2. An external keyboard (wired is recommended, some systems may not use Bluetooth at the beginning)

The need for an external keyboard is because the built-in keyboard cannot be used due to driver problems during the linux installation process, and an external keyboard needs to be used for setting

Download image (iso)

This article takes UBUNTUDDE REMIX 20.10 as an example (the blogger is Yankong). The installation steps of these systems are similar.

Download and install
You can download the mirror image from the official website of the corresponding system or the mirror station. Here, I recommend the mirror station of Tsinghua University.
Get mirror
Click the get link pointed by the arrow to select the corresponding version to download.

Make U Disk Boot Disk

  1. Download production tool: Rufus ( click me to download from the official website ), no need to install after download
  2. Open the download Rufus, see the following interface, insert the U disk prepared in advance

Production software

  1. Click the select button, find the good mirror image downloaded in advance, that is, the iso file, click open

Select mirror

  1. After finishing, keep the default options without changing them, click the Start button, if a pop-up window appears, keep the default selections, just continue to the next step, and you will know to start writing.

Start writing

  1. The writing process will probably last a few minutes, please wait patiently~

At this point, the boot disk is made!

Allocate hard disk space for Linux/Archlinux

It is recommended that you do this step in advance to avoid various problems~

  1. Mouse Right Start icon (that is, under the Windows icon ), click Disk Management

Disk management

  1. You can enter the following interface

Disk management

  1. Find the target disk where you want to install ubuntu, select it, right click, select compressed volume, enter the amount of space you want to allocate, it is recommended that it be no less than 50GB

Input size

  1. After the compression is completed, you can get an unallocated space, because I allocated it in advance, so you can see the figure in step 2.

Three, install Linux/Archlinux


Turn off Secureboot

The role of secureboot was mentioned earlier. Fedora and Debian/Ubuntu both support Secureboot, but Arch does not.
But because we need to replace the linux kernel later , it will lead to the failure to boot safely, so here we all turn off Secureboot first .

  1. Choose to restart the computer , wait for the shutdown , long press the volume up , which is F5
  2. Wait for the computer to enter UEFI , the interface shown below

UEFA

  1. Select security , you can see Secure boot , click change configuration below , select none in the expanded item , and then OK

Secure boot

  1. Then click boot configuration , you can see that the first one is the Windows startup item, drag the USB configuration to the first item by hand

Startup item

  1. When finished, click Exit , click reboot to

Insert picture description here

Official installation

The installation of Linux/Archlinux on Surface is no different from other devices. Here is a brief introduction with ubuntu as an example. You can also refer to other more detailed tutorials and skip this step.

  1. After restarting in the previous step, you will enter the following interface, you can keep the default options, just wait to enter

start up

  1. Wait for the system to check the disk and enter the boot interface after completion

enter

  1. Click to run the installer and follow the prompts

Insert picture description here

  1. After the partitioning step, if you want to install dual systems, you must choose manual partitioning. For specific partitioning, please refer to other posts. Here is an example ( partition reference )

Partition

  1. After setting the user name and password, choose to restart the computer and follow the prompts to unplug the U disk

So far, linux has been installed on your surface device~

Fourth, install the Surface driver


The driver that comes with ubuntu is not compatible with Surface hardware, so many hardware cannot be used, such as keyboards, touch screens, etc., we are now installing a third-party kernel

For details on the hardware available for each Surface device, you can check here , basically the camera can’t be used

Due to the differences between Linux and Achlinux , the installation process of the drivers on different versions are introduced below .

Debian/Ubuntu driver

  1. First, import the key used to sign the package
wget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc \
    | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/linux-surface.gpg
  1. Then, add the repository configuration and update APT
echo "deb [arch=amd64] https://pkg.surfacelinux.com/debian release main" \
	| sudo tee /etc/apt/sources.list.d/linux-surface.list

sudo apt update
  1. Now, you can install the linux-surface kernel and its dependencies, and you can also enable the iptsd service to use the touch screen
sudo apt install linux-image-surface linux-headers-surface iptsd libwacom-surface

sudo systemctl enable iptsd
  1. After performing the above steps, you can restart the system. After completion, you will find that the keyboard, power supply, touch screen, etc. are all available

Arch driver

  1. First, import the key used to sign the package
 wget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc \
    | sudo pacman-key --add -
  1. Then, check and verify the fingerprint of the key, and then sign it locally
 sudo pacman-key --finger 56C464BAAC421453
 sudo pacman-key --lsign-key 56C464BAAC421453
  1. Now, the repository can be added by adding the following at the end of /etc/pacman.conf
[linux-surface]
Server = https://pkg.surfacelinux.com/arch/

For example, you can use gedit to modify:

gedit  /etc/pacman.conf
  1. Now, update the repository data to install the linux-surface kernel and its dependencies, and also enable the iptsd service to use the touch screen
 sudo pacman -Sy
 sudo pacman -S linux-surface linux-surface-headers iptsd
 sudo systemctl enable iptsd
  1. After performing the above steps, you can restart the system. After completion, you will find that the keyboard, power supply, touch screen, etc. are all available

Five, signature kernel


Since we have replaced the Linux kernel, the secure boot cannot directly boot the system when it is turned on, so we need to sign the kernel and import the key of the Linux-Surface kernel into the bootloader so that the kernel can be booted without being disabled secureboot.

Install signature tool

Linux and Archlinux can be installed in the following ways:

Debian / Ubuntu

sudo apt install linux-surface-secureboot-mok

Arch

sudo pacman -S linux-surface-secureboot-mok

Download the signed public key

Public key used: linux-surface/linux-surface/keys/MOK.cer

Import public key

Open the terminal in the folder where you downloaded the public key, or locate the terminal to the corresponding folder

sudo mokutil --import surface.cer

This process will let you film a password. Remember to use it later. You will
succeed when you see the following prompt:

SKIP: surface.cer is already enrolled

Restart the computer after success

Select public key

After restarting, it will enter the following interface, which is more retro, just press Enter

mug

After pressing enter, you will enter the following interface, choose the second one, it should be import mok, because I imported here, it is delete mok, you can understand

mug

After entering the next interface, select continue, follow the prompts to enter the password you set when importing the public key, and then press Enter

mug

After completion, you can enter UEFI, change the boot configuration to Microsoft & 3rd party CA in secure boot, and then you will find that there is no red prompt when booting, and the system can boot the dual system normally

Six, finally

At this point, linux/archlinux has been perfectly installed on your Surface device. For follow-up work, such as changing the source, you can refer to other materials, and I won’t repeat them here.

The code word is not easy, thank you for reading, and welcome to point out any improprieties. If you have any questions, please leave a message, thank you!

The warehouse address used in this article is: the source warehouse address , thanks here

Reprinting is prohibited without the author's permission!

Guess you like

Origin blog.csdn.net/weixin_43819518/article/details/113035311