LoginSignup
7
2

More than 3 years have passed since last update.

Surface Book 2 15インチでUbuntu 18.04を使う(Windowsとデュアルブート)

Last updated at Posted at 2020-02-11

動機

画面が分離すること、GPUを搭載していることから、Surface Book 2のデュアルブート化は高難易度です。
成功するまで苦労したので、メモとして記事を書きます。

環境

Microsoft Surface Book 2 15''

CPU:Core i7 8650U 1.90GHz 4core/8thread
RAM:16 GB
GPU:GeForce GTX 1060 Max-Q
SSD:256 GB

手順

準備

SecureBootを無効化

  1. PCの電源を切る
  2. ボリューム下げるボタンを押しながら電源ボタンを押す(ボリューム下げるボタンは押したまま)
  3. Surfcaeロゴが出たら、ボリューム下げるボタンを離す
  4. SecurityタブのSecure BootDisabledに変更

BitLockerを解除(設定している場合)

Windows側の設定です。デフォルトだと有効になってた気がします。

Ubuntuインストール

これは普通のPCにデュアルブートする場合と同じようにやれば大丈夫です。

カーネルの更新

標準のカーネルだとCPUが異常発熱するなどの不具合があるため、有志の方が作ったsurface用のカーネルをインストールします。

注意1

ver5.4以降のカーネルだと画面タッチが使えません。最新版だとver5.5がインストールされるため、画面タッチが使えません。

注意2 (2020/3/5追記)

ver5.3.* だとNVIDIA Docker内でGPUを使用する事ができず,ダウングレードしました.ver4.19.*であれば使用できました.

バージョンを指定してインストールする場合(画面タッチを使う場合はこちら)

debファイルをダウンロード

ver 4.19*の場合

github linux-surfaceからv.4.19.*の~.debとなっているファイル3つをダウンロードし、インストール

ver5.3*の場合

github linux-surfaceからv.5.3*の~.debとなっているファイル3つをダウンロードし、インストール

再起動

最新のカーネルをインストールする場合(画面タッチは使えません)

wget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc \
    | sudo apt-key add -
sudo apt-get update && sudo apt-get install linux-headers-surface linux-image-surface linux-libc-dev-surface surface-ipts-firmware linux-surface-secureboot-mok libwacom-surface
reboot

参考:https://github.com/linux-surface/linux-surface/wiki/Installation-and-Setup
参考:https://turlucode.com/how-to-install-ubuntu-18-04-on-surface-book-2/

Surface独自のパッケージをインストール

リポジトリの登録

wget -qO - https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc \
    | sudo apt-key add -
echo "deb [arch=amd64] https://pkg.surfacelinux.com/debian release main" | sudo tee /etc/apt/sources.list.d/linux-surface.list
sudo apt-get update

様々なパッケージをインストール

画面タッチに対応させるためのモジュールなどが含まれます。

sudo apt-get install  surface-ipts-firmware linux-surface-secureboot-mok libwacom-surface

DTX Driverのインストール

これは画面を取り外したり、再接続したりするのに必要です。

このサイトから~.debファイルをダウンロードし、インストール
下記の通りコマンドを打って設定。

systemctl enable surface-dtx-daemon.service

参考:https://github.com/linux-surface/surface-dtx-daemon

surface controlのインストール

これはdGPUをオンにしたり、電源モードを切り替えたりするときに使用します。

このサイトから~.debファイルをダウンロードし、インストール

参考:https://github.com/linux-surface/surface-control
参考:https://github.com/linux-surface/linux-surface/issues/46

NVIDIAドライバーのインストール

dgpuをオン

surface dgpu set on

準備

sudo apt-get update && sudo apt-get upgrade

リポジトリの追加

sudo add-apt-repository ppa:graphics-drivers/ppa

インストール可能なドライバ一覧を表示

ubuntu-drivers devices

ドライバをインストール

どれをインストールするかは、環境や使用ソフトの依存関係などで決めるてください。
私はDockerを使用しているので、依存関係は無視し、最新より1つ古いものをインストールしています。

sudo apt install -y nvidia-***
sudo apt install nvidia-driver-430

再起動

再起動後、nvidia-smiでGPUを確認できれば成功です。

解像度の調整

Surface Book 2は解像度が高いため、デフォルト設定だと見にくいです。しかし、Ubuntu 18.04はスケーリングが100%か200%しかなく、ちょうどよい設定ができません。そこで、下記コマンドを使います。

xrandr --newmode "2160x1440_60.00"  263.50  2160 2320 2552 2944  1440 1443 1453 1493 -hsync +vsync && \
DISP=$(xrandr | grep -e " connected [^(]" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/") && \
xrandr --addmode $DISP 2160x1440_60.00

ただし、これは再起動するとリセットされてしまうので、起動時に自動設定されるようにします。

sudo gedit /etc/profile.d/xrandr.sh

xrandr.shを開き、下記シェルスクリプトを作成します。

#!/bin/sh

xrandr --newmode "2160x1440_60.00"  263.50  2160 2320 2552 2944  1440 1443 1453 1493 -hsync +vsync && \
DISP=$(xrandr | grep -e " connected [^(]" | sed -e "s/\([A-Z0-9]\+\) connected.*/\1/") && \
xrandr --addmode $DISP 2160x1440_60.00

これで再起動してみてください。再起動後も設定が反映されていればOKです。

参考サイト:https://elsal.hatenadiary.org/entry/20090106/1231241592

Bluetoothマウスの接続

なぜか初期状態だと再起動後の再接続ができなかったので、下記手順に従い、設定を行います。

設定ファイルを開く

sudo gedit /etc/bluetooth/main.conf

設定ファイルの変更

  • #[Policy]のコメントアウトを外す
  • #AutoEnable=falseAutoEnable=trueにする

参考サイト:https://askubuntu.com/questions/839014/ubuntu-16-04-lts-cant-get-bluetooth-mouse-to-work

トラブルシューティング

Secure Bootを有効に戻せない

UEFIでSecure Bootの設定を戻そうとした時、下記のようなエラーが出ました。

The system failed to update the secure boot certificate keyset.

この場合、Ubuntu上のターミナルで下記を実行することで解決しました。

sudo rm /sys/firmware/efi/efivars/dump*

この後、再起動してUEFIを起動すると、Secure Bootを変更できます。

参考サイト1:https://gitter.im/linux-surface/support?at=5d737ceabe4a3f13fd023a3c
参考サイト2:https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#UEFI_variables

7
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
2