Open1

Windows11 / Ubuntu22.04 デュアルブートと環境構築メモ

Takumi AsadaTakumi Asada

Windows11 / Ubuntu22.04 のデュアルブートとUbuntu PCの環境構築を、PC新調に伴い行ったメモになります。

各必要な箇所を適宜ご参照ください。

デュアルブート

基本は【上級者向け】Ubuntuをデュアルブートする《その1:既にWindowsが入っているSSD・HDDにUbuntuを入れる》に沿って行う

Win11(Bitlocker)+Ubuntu22.04だとDual Boot大変らしい


  1. Partitionを分割し、高速スタートアップを無効化(下記参考)

[Windows 11] 高速スタートアップを無効にする方法を教えてください。

  1. Ubuntu焼いたUSBを刺して、BIOS(F2キーで入る)からUbuntuを起動

Administer Secure Boot > Secure Boot Status = Disabledへ変更

USBからUbuntuを起動(ELECOMとかUSBの名前が出る)

UbuntuのGUI起動後、以下を設定していく

  1. Ubuntuの設定
  • Welcome: English / Insall Ubuntu

  • Keyboard layout : Japanese

  • Updates and other software:
    ☑ Normal installation
    ☑ Download updates while installing Ubuntu,
    ☑ Install third-party software for graphics and Wi-Fi hardware and additional media formats

  • Installatin type:

Install Ubuntu alongside Windows Boot Managerとあるが、something elseを選択

free spaceにExt4 journaling file systemMount Point: /を設定
Device for boot loader installationを/dev/nvme0n1 と使用しているHDDを選択する(1TBなら1TBとなっているデバイスを選択すること

  • Reference

初心者向けLinux入門:デュアルブートでubuntuをインストール

研究室のPC(Dell Precision M3800)でWindowsとUbuntuをデュアルブートする

Terminal 系

Terminator

terminal
sudo add-apt-repository ppa:mattrose/terminator
sudo apt update
sudo apt install terminator

Settings / Keyboard からView and Customize Shortcutsを選択し、ctrl alt tへTerminatorを設定しておく

  • Reference

ターミナル環境の構築: Terminatorのインストール

Ctrl + Alt + T opening terminator as 'X-terminal-emulator', not strictly 'terminator' on Ubuntu 18.04

sudo権限

sudo権限時のpasswardについて。

開発時は毎度入力が面倒なので、設定。
セキュリティの側面、一般ユーザー、rootユーザー等を考慮し、任意で設定する場合がある。

terminal
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

Terminalを開くと上記のようなエラーが出る場合、一旦スルーし

terminal
sudo visudo 

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL)NOPASSWD:ALL

とすれば、エラーとpass入力は省くことができる。

インストール系

  • VS Code

vscode Download page

インストール後、以下実行

terminal
cd ~/Downloads
sudo dpkg -i code_1.83.1-1696982868_amd64.deb
  • VS Code Extension

vscode-icons: アイコンが見やすくなる

Prettier - Code formatter: コード自動整形

Better Comments: TODO / ! Warning / ? Question / * Strongの色分け

indent-rainbow: インデントのカラー

Auto Rename Tag: <body></body>タグなどの名前自動変更

Git Graph: Gitツリーの表示

Trailing Spaces: 末尾のスペース強調

language-proto-webots: PROTO Syntax ハイライト

PlantUML: json, yamlのUML可視化

Draw.io Integration: drawio.pngなどでUML編集

Markdown All in One: Markdownの目次(TOC)作成

AsciiDoc: Asciidoc のライブプレビューやシンタックスハイライト

Marp for VS Code: スライド作成

LaTeX Workshop (James Yu) : LaTeX ビルド


  • Arduino IDE 2.x.x

Youtube(Chayan Mistry): Install Arduino IDE 2.x.x on Linux (Ubuntu)を見ながら進めると、簡単にArduino IDE 2.x.xの使用ができる

How to install Arduino IDE 2.0 on Ubuntu 20.04の記事と同様の内容。

  • Google Chome

Get Chrome for Linux から、Get Chrome for Linux > 64bit.deb (For Debian/Ubuntu) > Accept and installよりインストール

terminal
cd ~/Downloads
sudo apt install ./google-chrome-stable_current_amd64.deb
  • Zoom

Zoom: Linux への Zoom のインストールまたは更新ターミナルの使用よりzoom_amd64.debをインストール後、以下を実行

terminal
sudo apt install ./zoom_amd64.deb
  • Unity

Install the Unity Hub on Linuxを参考にする

terminal
wget -qO - https://hub.unity3d.com/linux/keys/public | gpg --dearmor | sudo tee /usr/share/keyrings/Unity_Technologies_ApS.gpg > /dev/null

sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/Unity_Technologies_ApS.gpg] https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'

sudo apt update
sudo apt-get install unityhub

Unity Hub へログイン後、Install Ubuntu Editorよりインストール

Add new license から Get a free personal licenseなどライセンスの種類を選択

  • 日本語文字

mozcをインストール後、再起動で英字/日本語入力が可能

terminal
sudo apt install ibus-mozc
  • SimpleScreenRecorder

https://zenn.dev/tasada038/scraps/cbcd721ee0a47b

  • ffmpeg
terminal
sudo apt install ffmpeg
  • ssh
terminal
sudo apt install net-tools
  • gnuplot
terminal
sudo apt install gnuplot
  • MeshLab
termianl
sudo apt install meshlab
  • LaTeX
terminal
sudo apt-get update
sudo apt-get install texlive-latex-extra -y
sudo apt-get install latexmk
latex --version

設定系

  • サーバ接続

フォルダからOther Locationsを選択し、Connect to Serverより以下を入力し接続する。

smb://192.168.xx.xx

ROS 関連

Humble

基本は公式通りだが、sudo apt upgradeを忘れずに実行する

https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html

termianl
sudo apt install -y python3-pip

Gazebo 11

Install Gazebo using Ubuntu packagesよりインストール

termianl
curl -sSL http://get.gazebosim.org | sh

以下で起動する。

termianl
gazebo

Ignition Gazebo 6: Fortress

Github: ros_gzよりIgnition Gazeboをインストール

termianl
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt-get update
sudo apt install ros-humble-ros-gz

以下で起動する。

termianl
ign gazebo

その他

  • mkv ⇔ mp4の変換
terminal
ffmpeg -i video1.mkv -q:v 1 video1.mp4
  • Ubuntu GUIが使えなくなり、CUIのみになった場合
termianl
sudo apt install --reinstall gdm3
  • ファイルシステムが壊れたら

外付けHDDが認識しなくなったとき、内部のシステムが破損している可能性があった

termianl
sudo apt install ntfs-3g
  • NVIDIA Driverのインストール

HDMIに反応しない / Setting > GraphicsがNVIDIA 対応になってないときは以下でも改善可能

Ubuntu 22.04でcudaインストールしPyTorchとTensorFlowをGPUで動かす方法

  • Bluetooth from Ubuntu PC

UbuntuでBluetoothをONにできない問題

SONY WH-1003などはBluetooh接続初回はペアリングモードにする

  • Hugo

gohugoio/hugoより、Linux OSの場合amd64.debをインストールする

termianl
cd ~/Downloads/ && wget https://github.com/gohugoio/hugo/releases/download/v0.120.3/hugo_0.120.3_linux-amd64.deb
sudo dpkg -i hugo_0.120.3_linux-amd64.deb

## or
sudo apt-get install hugo

hugo version
##  hugo v0.120.3-a4892a07b41b7b3f1f143140ee4ec0a9a5cf3970 linux/amd64 BuildDate=2023-11-01T17:57:00Z VendorInfo=gohugoio