Microsoft Surface Pro 3: Difference between revisions

From ArchWiki
m (→‎Installation: Grammar fixes)
(added accessibility section)
 
(55 intermediate revisions by 22 users not shown)
Line 1: Line 1:
[[Category:Laptops]]
[[Category:Microsoft]]
[[Category:Tablet PCs]]
[[de:Microsoft Surface]]
[[ja:Microsoft Surface Pro 3]]
[[ja:Microsoft Surface Pro 3]]
[[zh-CN:Microsoft Surface Pro 3]]
[[zh-hans:Microsoft Surface Pro 3]]
{{Style|[[Help:Style#Language register]]}}
{{Style|[[Help:Style#Language register]]}}
{{Laptop style|Missing some sections. This page also duplicates content of other wiki pages (sections are already flagged with [[Template:Merge]])}}
{| class="wikitable" style="float: right;"
|-
! Hardware !! PCI/USB ID !! Working?
|-
| GPU || {{ic|8086:0a16}} || {{Yes}}
|-
| Wi-Fi || {{ic|11ab:2b38}} || {{Yes}}
|-
| Bluetooth || {{ic|1286:204b}} || {{Yes}}
|-
| Webcam (front) || {{ic|045e:07be}} || {{Yes}}
|-
| Webcam (rear) || {{ic|045e:07bf}} || {{Yes}}
|}
{{Warning|
{{Warning|
The warranty of the device is only valid if the OEM image of Windows is still present. A dual boot, however, will not invalidate the warranty as explained [http://answers.microsoft.com/en-us/surface/forum/surfpro-surfusingpro/would-dual-booting-the-surface-pro-void-its/da549e24-f986-4984-b081-25c029882163 here].}}
The warranty of the device is only valid if the OEM image of Windows is still present. A dual boot, however, will not invalidate the warranty as explained [https://answers.microsoft.com/en-us/surface/forum/surfpro-surfusingpro/would-dual-booting-the-surface-pro-void-its/da549e24-f986-4984-b081-25c029882163 here].}}


This page aims to document all relevant information on getting Arch Linux working on the Microsoft Surface Pro 3 tablet.  
This page aims to document all relevant information on getting Arch Linux working on the Microsoft Surface Pro 3 tablet.


== Booting into the installer ==
== Booting into the installer ==


To boot from USB, you will need to instruct the tablet to boot from USB or SD Card. Also, you may want to avoid disabling [[UEFI#Secure_Boot|Secure Boot]] as this will cause each boot to display an ugly bright red background intentionally clashing with the "Surface" splash logo.
To boot from USB, you will need to instruct the tablet to boot from USB or SD Card. Also, you may want to avoid disabling [[Secure Boot]] as this will cause each boot to display an ugly bright red background intentionally clashing with the "Surface" splash logo.


There are three types of boots in the Surface Pro 3 [http://www.microsoft.com/surface/en-us/support/storage-files-and-folders/boot-surface-pro-from-usb-recovery-device explained here]:
There are three types of boots in the Surface Pro 3 [https://www.microsoft.com/surface/en-us/support/storage-files-and-folders/boot-surface-pro-from-usb-recovery-device explained here]:
# Normal mode
# Normal mode
## Just leave the computer go. You can change it from "Alternate Boot order" in the UEFI Setup
## Just leave the computer go. You can change it from "Alternate Boot order" in the UEFI Setup
Line 32: Line 50:


{{Note|This will cause a red background before the logo when booting.}}
{{Note|This will cause a red background before the logo when booting.}}
{{Warning|If your drive is BitLocker encrypted, you might lose access to its data if you disable secure boot, even if you later re-enable it, '''unless''' you backup your recovery key or suspend the protection before disabling secure boot.}}


Boot into the UEFI setup, and select ''Secure Boot Control > Disable''. Now continue with the installation. See the [http://www.microsoft.com/surface/en-sg/support/warranty-service-and-recovery/how-to-use-the-bios-uefi Microsoft steps] for more information.
Boot into the UEFI setup, and select ''Secure Boot Control > Disable''. Now continue with the installation. See the [https://www.microsoft.com/surface/en-sg/support/warranty-service-and-recovery/how-to-use-the-bios-uefi Microsoft steps] for more information.


=== Boot with Secure Boot ===
=== Boot with Secure Boot ===


See [[Unified Extensible Firmware Interface#Secure Boot]].
See [[Secure Boot]].


== Installation ==
== Installation ==
Line 43: Line 62:
{{Merge|UEFI#Secure Boot|These steps are on how to support Secure Boot for Arch Linux, need to try it in a regular computer.}}
{{Merge|UEFI#Secure Boot|These steps are on how to support Secure Boot for Arch Linux, need to try it in a regular computer.}}


I have done the installation with systemd's bootctl [[Systemd-boot]] (old [[Gummiboot]]). After doing all the steps of installation within the [[Beginners' guide]], you should do two more things. Booting in Secure Boot won't work for the new installation, as the vmlinuz hasn't been registered within its loader.
I have done the installation with systemd's bootctl [[Systemd-boot]] (old [[Gummiboot]]). After completing the [[Installation guide]], you should do two more things. Booting in Secure Boot will not work for the new installation, as the vmlinuz has not been registered within its loader.


The easiest way is to do all the setup is the following, just before rebooting:
The easiest way is to do all the setup is the following, just before rebooting:


# Exit from the chroot but don't umount anything
# Exit from the chroot but do not umount anything
# Move /mnt/boot/EFI/boot/bootx64.efi to /mnt/boot/EFI/boot/loader.efi
# Move /mnt/boot/EFI/boot/bootx64.efi to /mnt/boot/EFI/boot/loader.efi
# Copy /boot/EFI/boot/bootx64.efi and HashTool.efi to /mnt/boot/EFI/boot/
# Copy /boot/EFI/boot/bootx64.efi and HashTool.efi to /mnt/boot/EFI/boot/
Line 53: Line 72:
(If you are unable to find HashTool in /boot, try in /usr/run)
(If you are unable to find HashTool in /boot, try in /usr/run)


Here, we have enabled Preloader to boot our gummiboot loader, and if it detects that something hasn't been signed, it will boot the HashTool.efi to sign the vmlinuz-image binary.
Here, we have enabled Preloader to boot our gummiboot loader, and if it detects that something has not been signed, it will boot the HashTool.efi to sign the vmlinuz-image binary.


The idea is, we take the systemd bootloader and make it the one that PreLoader will boot (the one in its same folder, named loader.efi). Then, we copy both the PreLoader (which is the archiso's bootx64.efi) and the HashTool (already with that name).
The idea is, we take the systemd bootloader and make it the one that PreLoader will boot (the one in its same folder, named loader.efi). Then, we copy both the PreLoader (which is the archiso's bootx64.efi) and the HashTool (already with that name).
Line 61: Line 80:
== Extra steps ==
== Extra steps ==


Although in the latest kernel you have support for the touchpad, the screen, etc. It doesn't have support for stuff like the webcam, etc. A github repo to track the support of the Surface Pro 3 in Archlinux was created: [https://github.com/nuclearsandwich/surface3-archlinux], where you can check for the status.
=== Enabling Touchpad ===


Other resource, listed in the github repo, is a surface pro 3 specific linux kernel package, with support for these devices. It is available in the AUR [https://aur.archlinux.org/packages/linux-surfacepro3]. You can check there the support for the different modules available, or take the patch from upstream.
Ref: [https://github.com/matthewwardrop/linux-surfacepro3/issues/1 GitHub]
In order to enable full functionality of the touchpad (e.g. two-finger scrolling, right click), you need to
[[Install]] the {{Pkg|xf86-input-synaptics}} package, have the kernel patch applied as well as add the following to {{ic|/etc/X11/xorg.conf.d/10-multitouch.conf}}:


=== Compile Kernel with Patches ===
Section "InputClass"
Ref: [[Kernels/Compilation/Traditional#Build configuration]]
  Identifier "Default clickpad buttons"
 
  MatchDriver "synaptics"
{{Note|The most up-to-date source at the time of writing for the kernel patches is [https://github.com/shvr/fedora-surface-pro-3-kernel/ shvr's github repository].
  Option "ClickPad" "true"
*Latest stable kernel release: [https://github.com/shvr/fedora-surface-pro-3-kernel/commits/f23 f23 branch]
  Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
*Latest RC: [https://github.com/shvr/fedora-surface-pro-3-kernel/commits/master master branch]}}
  Option "SecondarySoftButtonAreas" "58% 0 0 15% 42% 58% 0 15%"
EndSection


==== Surface Pro 3 Linux Kernel Hardware Patches ====
=== Tuning the Pen ===
*[https://github.com/shvr/fedora-surface-pro-3-kernel/blob/f23/surface-pro-3-Add-support-driver-for-Surface-Pro-3-b.patch Camera patch]
*[https://github.com/shvr/fedora-surface-pro-3-kernel/blob/f23/Add-Microsoft-Surface-Pro-3-camera-support.patch Hardware Buttons patch]
*[https://github.com/shvr/fedora-surface-pro-3-kernel/blob/f23/Add-multitouch-support-for-Microsoft-Type-Cover-3.patch Type Cover patch]


{{Note|These patches can be automatically applied using {{ic|git-apply}} from the [[Git]] package.}}
The pen buttons might not work out of the box. [[Install]] the {{Pkg|xf86-input-wacom}} package and comment the {{ic|MatchIsTablet}} section in {{ic|/usr/share/X11/xorg.conf.d/10-evdev.conf}}. Furthermore add {{ic|1B96:1B05 Pen}} in the {{ic|MatchProduct}} line of N-Trig in {{ic|/usr/share/X11/xorg.conf.d/50-wacom.conf}}. Note that the purple bluetooth button is recognized but able to be bound to an action.
Ref:[https://www.reddit.com/r/SurfaceLinux/comments/3mu28a/sp3_pen_tip_button_working/ Reddit]


=== Enabling Touchpad ===
=== Virtual Keyboard ===
Ref: [https://www.reddit.com/r/SurfaceLinux/comments/3lbgs4/ubuntu_gnome_1510/ Reddit]


[[Install]] the {{Pkg|xf86-input-synaptics}} package, as well as add the following to the end of {{ic|/usr/share/X11/xorg.conf.d/10-evdev.conf}}:
Depending on the desktop environment you are using, you might want to use different virtual keyboard. {{Pkg|onboard}} provides a reliable and comfortable experience.
A guide for optical tweaking is provided [https://github.com/Vistaus/surface3-arch-antergoslinux/issues/5 here]. If you are using [[GNOME]], these two extension ([https://extensions.gnome.org/extension/992/onboard-integration/ 1], [https://extensions.gnome.org/extension/993/slide-for-keyboard/ 2]) provide a better integration.


Section "InputClass"··
=== Booting with Secure Boot Enabled ===
    Identifier "Surface Pro 3 cover"
    MatchIsPointer "on"
    MatchDevicePath "/dev/input/event*"
    Driver "evdev"
    Option "vendor" "045e"
    Option "product" "07dc"
    Option "IgnoreAbsoluteAxes" "True"
EndSection


=== Booting with Secure Boot Enabled ===
{{Merge|Secure Boot|This duplicates parts of the page as some of this is not really specific to the device.}}
{{Merge|UEFI#Secure boot|Generic instructions}}
The recommended bootloader for UEFI with Secure Boot enabled is [[systemd-boot]]
The recommended bootloader for UEFI with Secure Boot enabled is [[systemd-boot]]


To boot with Secure Boot, you will need the following packages: {{Pkg|efibootmgr}} {{Pkg|prebootloader}}
To boot with Secure Boot, you will need the following packages: {{Pkg|efibootmgr}} {{Pkg|efitools}}


Ref: [https://bbs.archlinux.org/viewtopic.php?pid=1570523#p1570523 Surface Pro 3 and Secure Boot post-install]
See [https://bbs.archlinux.org/viewtopic.php?pid=1570523#p1570523 Surface Pro 3 and Secure Boot post-install]


Copy {{ic|/usr/lib/prebootloader/HashTool.efi}} and {{ic|/usr/lib/prebootloader/PreLoader.efi}} to {{ic|/boot/EFI/systemd/}}
Copy {{ic|/boot/EFI/systemd/systemd-bootx64.efi}} to {{ic|/boot/EFI/systemd/loader.EFI}}.
Copy {{ic|/usr/lib/prebootloader/HashTool.efi}} and {{ic|/usr/lib/prebootloader/PreLoader.efi}} to {{ic|/boot/EFI/systemd/}}.
Create an NVRAM entry for PreLoader.efi:
Create an NVRAM entry for PreLoader.efi:
   efibootmgr -d /dev/sd'''X''' -p '''Y''' -c -L Preloader -l /EFI/systemd/PreLoader.efi
   efibootmgr -d /dev/sd''X'' -p ''Y'' -c -L Preloader -l /EFI/systemd/PreLoader.efi
{{Note|'''Y''' is the partition number of the /boot partition.}}
Verify the entry was made and that it is first in the boot order:
Verify the entry was made and that it is first in the boot order:
  efibootmgr
  efibootmgr
Enrolling your kernel in the bootloader: [[Unified Extensible Firmware Interface#Secure Boot]]
Enrolling your kernel in the bootloader: [[Secure Boot]]
Enroll HashTool.efi and vmlinuz-linux, and then reboot to system.
Enroll HashTool.efi and vmlinuz-linux, and then reboot to system.
You should now be able to boot with Secure Boot enabled.
You should now be able to boot with Secure Boot enabled.
{{Note|Since PreLoader.efi is the default boot option per {{Pkg|efibootmgr}}, if you change the kernel you will be presented with PreLoader to enroll the new kernel with HashTool again}}
 
{{Note|Ensure that you add the entry in {{ic|/boot/loader/entries/}} so that you are presented the option to boot with the new kernel}}
{{Note|
* Since PreLoader.efi is the default boot option per {{Pkg|efibootmgr}}, if you change the kernel you will be presented with PreLoader to enroll the new kernel with HashTool again
* Ensure that you add the entry in {{ic|/boot/loader/entries/}} so that you are presented the option to boot with the new kernel}}
 
=== Enabling Wi-Fi and Bluetooth ===
 
The package {{Pkg|linux-firmware-marvell}} is required for the Wi-Fi and Bluetooth since the [https://archlinux.org/news/linux-firmware-202201190c6a7b3-2-requires-kernel-53-and-package-splitting/ linux-firmware 20220119 update].
 
== Accessibility ==
 
The appearance of the BIOS is pretty simple and not very colorful, so it might work well with OCR software.
 
The BIOS can be configured with a keyboard, mouse, or using the touch screen.


== Troubleshooting ==
== Troubleshooting ==
Line 118: Line 141:
=== Invalid signature detected check secure boot policy in setup ===
=== Invalid signature detected check secure boot policy in setup ===


This happened to me after deleting the Secure Boot database and initializing it with Microsoft & CAs. I also had to do the recovery of the bitlocker partition, but I would follow these steps:
This happened to me after deleting the Secure Boot database and initializing it with Microsoft & CAs. I also had to do the recovery of the BitLocker partition, but I would follow these steps:


# After the reset, switch off and try to boot from the sd/usb. If you don't succeed and get the message many times:
# After the reset, switch off and try to boot from the SD/USB. If you do not succeed and get the message many times:
## Leaving all TPM & SecureBoot enabled and SSD Only alternate system order
## Leaving all TPM & Secure Boot enabled and SSD Only alternate system order
## Do another database reset
## Do another database reset
## Enroll the Microsoft and CAs again
## Enroll the Microsoft and CAs again
## reboot into sd/usb with volume down
## reboot into SD/USB with volume down
## It should work now
## It should work now
# Follow steps in the Secure Boot installation
# Follow steps in the Secure Boot installation
# After the full installation of archlinux, when you have it working, do the BitLocker recovery
# After the full installation of Arch Linux, when you have it working, do the BitLocker recovery


If after doing these steps doesn't still work. Flash the archiso image once more and try again,
If after doing these steps does not still work. Flash the Archiso image once more and try again,


=== Keyboard Cover not working ===
=== Keyboard Cover not working ===


This can happen sometimes when you restart. The solution was to shutdown and reboot. (not restart)
This can happen sometimes when you restart. The solution was to shutdown and reboot. (not restart)
=== Pen/Touchscreen issues in Xournal ===
When using the {{Pkg|xf86-input-wacom}} package there is a bug in the last official release of {{AUR|xournal}} (0.48.2) where it will incorrectly detect the Surface Pen as the touchscreen device. However it has been fixed in the latest Xournal source as per this [https://sourceforge.net/p/xournal/bugs/144/ bug]. Installing the AUR package {{AUR|xournal-git}} builds the latest source including this fix.
Note that you will need to select 'NTRG0001:01 1B96:1B05' as the touchscreen device (Options > Pen and Touch).

Latest revision as of 12:18, 30 July 2023

This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.

This article or section does not follow the Laptop page guidelines.

Reason: Missing some sections. This page also duplicates content of other wiki pages (sections are already flagged with Template:Merge) (Discuss in Talk:Microsoft Surface Pro 3)
Hardware PCI/USB ID Working?
GPU 8086:0a16 Yes
Wi-Fi 11ab:2b38 Yes
Bluetooth 1286:204b Yes
Webcam (front) 045e:07be Yes
Webcam (rear) 045e:07bf Yes
Warning: The warranty of the device is only valid if the OEM image of Windows is still present. A dual boot, however, will not invalidate the warranty as explained here.

This page aims to document all relevant information on getting Arch Linux working on the Microsoft Surface Pro 3 tablet.

Booting into the installer

To boot from USB, you will need to instruct the tablet to boot from USB or SD Card. Also, you may want to avoid disabling Secure Boot as this will cause each boot to display an ugly bright red background intentionally clashing with the "Surface" splash logo.

There are three types of boots in the Surface Pro 3 explained here:

  1. Normal mode
    1. Just leave the computer go. You can change it from "Alternate Boot order" in the UEFI Setup
  2. Boot into the UEFI Setup
    1. With the device powered off (or rebooting, but better play safe)
    2. Press & hold Volume up
    3. Press power button
    4. Wait until the surface logo appears
    5. Release Volume up
    6. You will be presented with the UEFI Setup Menu
  3. Boot into the USB/SD card
    1. Power off the device
    2. Press & hold Volume down
    3. Press power button
    4. Wait until the surface logo appears
    5. Release Volume down

Disable Secure Boot

Note: This will cause a red background before the logo when booting.
Warning: If your drive is BitLocker encrypted, you might lose access to its data if you disable secure boot, even if you later re-enable it, unless you backup your recovery key or suspend the protection before disabling secure boot.

Boot into the UEFI setup, and select Secure Boot Control > Disable. Now continue with the installation. See the Microsoft steps for more information.

Boot with Secure Boot

See Secure Boot.

Installation

This article or section is a candidate for merging with UEFI#Secure Boot.

Notes: These steps are on how to support Secure Boot for Arch Linux, need to try it in a regular computer. (Discuss in Talk:Microsoft Surface Pro 3)

I have done the installation with systemd's bootctl Systemd-boot (old Gummiboot). After completing the Installation guide, you should do two more things. Booting in Secure Boot will not work for the new installation, as the vmlinuz has not been registered within its loader.

The easiest way is to do all the setup is the following, just before rebooting:

  1. Exit from the chroot but do not umount anything
  2. Move /mnt/boot/EFI/boot/bootx64.efi to /mnt/boot/EFI/boot/loader.efi
  3. Copy /boot/EFI/boot/bootx64.efi and HashTool.efi to /mnt/boot/EFI/boot/

(If you are unable to find HashTool in /boot, try in /usr/run)

Here, we have enabled Preloader to boot our gummiboot loader, and if it detects that something has not been signed, it will boot the HashTool.efi to sign the vmlinuz-image binary.

The idea is, we take the systemd bootloader and make it the one that PreLoader will boot (the one in its same folder, named loader.efi). Then, we copy both the PreLoader (which is the archiso's bootx64.efi) and the HashTool (already with that name).

This way, with Secure Boot enabled, you will be able to boot your kernel whenever you wish to, signed or not, repeating the hash storing procedure on the next boot.

Extra steps

Enabling Touchpad

Ref: GitHub In order to enable full functionality of the touchpad (e.g. two-finger scrolling, right click), you need to Install the xf86-input-synaptics package, have the kernel patch applied as well as add the following to /etc/X11/xorg.conf.d/10-multitouch.conf:

Section "InputClass"
  Identifier "Default clickpad buttons"
  MatchDriver "synaptics"
  Option "ClickPad" "true"
  Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
  Option "SecondarySoftButtonAreas" "58% 0 0 15% 42% 58% 0 15%"
EndSection

Tuning the Pen

The pen buttons might not work out of the box. Install the xf86-input-wacom package and comment the MatchIsTablet section in /usr/share/X11/xorg.conf.d/10-evdev.conf. Furthermore add 1B96:1B05 Pen in the MatchProduct line of N-Trig in /usr/share/X11/xorg.conf.d/50-wacom.conf. Note that the purple bluetooth button is recognized but able to be bound to an action. Ref:Reddit

Virtual Keyboard

Depending on the desktop environment you are using, you might want to use different virtual keyboard. onboard provides a reliable and comfortable experience. A guide for optical tweaking is provided here. If you are using GNOME, these two extension (1, 2) provide a better integration.

Booting with Secure Boot Enabled

This article or section is a candidate for merging with Secure Boot.

Notes: This duplicates parts of the page as some of this is not really specific to the device. (Discuss in Talk:Microsoft Surface Pro 3)

The recommended bootloader for UEFI with Secure Boot enabled is systemd-boot

To boot with Secure Boot, you will need the following packages: efibootmgr efitools

See Surface Pro 3 and Secure Boot post-install

Copy /boot/EFI/systemd/systemd-bootx64.efi to /boot/EFI/systemd/loader.EFI. Copy /usr/lib/prebootloader/HashTool.efi and /usr/lib/prebootloader/PreLoader.efi to /boot/EFI/systemd/. Create an NVRAM entry for PreLoader.efi:

 efibootmgr -d /dev/sdX -p Y -c -L Preloader -l /EFI/systemd/PreLoader.efi

Verify the entry was made and that it is first in the boot order:

efibootmgr

Enrolling your kernel in the bootloader: Secure Boot Enroll HashTool.efi and vmlinuz-linux, and then reboot to system. You should now be able to boot with Secure Boot enabled.

Note:
  • Since PreLoader.efi is the default boot option per efibootmgr, if you change the kernel you will be presented with PreLoader to enroll the new kernel with HashTool again
  • Ensure that you add the entry in /boot/loader/entries/ so that you are presented the option to boot with the new kernel

Enabling Wi-Fi and Bluetooth

The package linux-firmware-marvell is required for the Wi-Fi and Bluetooth since the linux-firmware 20220119 update.

Accessibility

The appearance of the BIOS is pretty simple and not very colorful, so it might work well with OCR software.

The BIOS can be configured with a keyboard, mouse, or using the touch screen.

Troubleshooting

Invalid signature detected check secure boot policy in setup

This happened to me after deleting the Secure Boot database and initializing it with Microsoft & CAs. I also had to do the recovery of the BitLocker partition, but I would follow these steps:

  1. After the reset, switch off and try to boot from the SD/USB. If you do not succeed and get the message many times:
    1. Leaving all TPM & Secure Boot enabled and SSD Only alternate system order
    2. Do another database reset
    3. Enroll the Microsoft and CAs again
    4. reboot into SD/USB with volume down
    5. It should work now
  2. Follow steps in the Secure Boot installation
  3. After the full installation of Arch Linux, when you have it working, do the BitLocker recovery

If after doing these steps does not still work. Flash the Archiso image once more and try again,

Keyboard Cover not working

This can happen sometimes when you restart. The solution was to shutdown and reboot. (not restart)

Pen/Touchscreen issues in Xournal

When using the xf86-input-wacom package there is a bug in the last official release of xournalAUR (0.48.2) where it will incorrectly detect the Surface Pen as the touchscreen device. However it has been fixed in the latest Xournal source as per this bug. Installing the AUR package xournal-gitAUR builds the latest source including this fix. Note that you will need to select 'NTRG0001:01 1B96:1B05' as the touchscreen device (Options > Pen and Touch).