LoginSignup
56

More than 5 years have passed since last update.

[メモ] VirtualBoxにて、Raspberry Pi Desktop(2017-11-16-rpd-x86-stretch版)

Last updated at Posted at 2018-01-11

image.png

概要

  • VirtualBoxにて、Raspberry Pi Desktop(2017-11-16-rpd-x86-stretch版) を入れたときのメモ
  • xrandrでスクリーンサイズを変更する、ってとこは、あとで見返しそう。
    =>[2018-03-14追記] VBoxLinuxAdditionsをインストール後、再起動で、サイズ変更可能(になったのかな??)。xrandr使わなくても、スクリーンサイズ変更可能。
  • [2018-03-14追記] aptにて、VBoxLinuxAdditionsをインストールする方法を記述。メニューView=>Virtual Screen 1 => お好みのサイズ、または、ウィンドウサイズ変更で、追従する。

環境

  • ホストOS: Windows 10 (1709) x64
  • VirtualBox v5.2.4 + Extension Pack
  • ゲストOS: DEBIAN STRETCH WITH RASPBERRY PI DESKTOP
    The Raspberry Pi Desktop OS for PC and Mac - based on Debian Stretch
    ↑ここから、2017-11-16-rpd-x86-stretch.isoをダウンロードしておく。

手順

VirtualBoxのインストール

# Chocolateyで、コマンドラインからインストールする。

  1. cmd.exe(Command Prompt) を管理者で開く。
  2. コピペ

    install_chocolatey
    @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
    
  3. コピペ

    virtualboxとgitとchocolateyのGUIをインストール(お好みで)
    cinst -y virtualbox git chocolateygui 
    
    • ExtensionPackも一緒に入るハズ.
    • git for windowsは、git bash から、sshなど使用する、カト...

Virtual Machine(仮想機)作成

  1. VirtualBox起動
  2. 仮想機作成 Menu: Machine > New (Create Virtual Machine)
    image.png

  3. name and operating system
    Name: 2017-11-16-rpd-x86-stretch
    Type: Linux
    Version: Debian (64-bit)
    image.png

  4. Memory size
    image.png

  5. Hard disk
    image.png

    • Hard disk file type
      image.png
    • Storage on physical hard disk
      固定か、可変か、お好みで。
      image.png
    • File locat ion and size
      16GBにしてみた。(お好みで)
      image.png
  6. 仮想機の設定

    • 作った仮想マシンをクリックして、Settingボタンを押す
      image.png
    • System > Processor : 2個に
      image.png
    • Storage: CDイメージを選択
      image.png
    • Choose Virtual Optical Disk File...にて、2017-11-16-rpd-x86-stretch.isoを選択
      image.png
    • Network > Adapter 1で、ホスト機からSSHできるように、Portforwadingの設定をする (ホスト127.0.01の2222/33389をゲスト10.0.2.15のSSH22/RDP3389へ、飛ばす)
      • [Port Forwarding]ボタンを押す
        image.png
      • 設定を入力
        image.png

仮想機へのインストール・設定

Raspberry Pi Desktop(x86)のインストール

  1. 仮想機スタート
  2. "Graphical install"を↑ ↓ で選んで、[Enter]を押す VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_34_08.png
  3. キーボード選択 (ちなみに、101キーは、US? ... American Englishは一番上にある) VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_34_31.png
  4. パーティション設定

    • ディスク全体使用:
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_35_53.png
    • ディスク選択:
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_35_58.png
    • 1パーティションで:
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_36_04.png
    • 確認:
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_36_11.png
    • Yesを選択:
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_36_22.png
  5. 待つ: パーティションが設定されて、インストールが進む

  6. ブートローダー(GRUB)の設定

    • Yesを選択:
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_45_50.png
    • /dev/sdaを選択:
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_45_58.png
  7. "Finish the installation"
    Continueを押す。

VirtualBox_2017-11-16-rpd-x86-stretch_14_01_2018_10_45_29.png

  1. 待つ:
    => インストール終了。おつかれさま(ここからスタートなんだけど..)

初期設定(パッケージ更新など)

  • 無事インストールされていると、こんな画面が出る:

    • GRUB
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_48_22.png
    • スプラッシュ画面:
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_48_34.png
    • デスクトップ画面:
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_11_48_54.png
  • パッケージ更新

    sudo sh -c 'apt update && apt upgrade -y && reboot'
    
  • ssh有効化(お好みで)

    • コマンドライン

      sudo systemctl enable ssh 
      sudo systemctl restart ssh 
      
    • GUIで
      VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_15_47_18.png

VBoxLinuxAdditionsのインストール

aptでインストール場合(おすすめ)

[2018-3-14追記]

こぴぺして待つ
echo 'deb http://ftp.debian.org/debian stretch-backports main contrib' | sudo tee /etc/apt/sources.list.d/stretch-backports.list \
  && sudo apt-get update \
  && sudo apt-get install -y virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11 \
  && sudo reboot

参考: How to install VirtualBox Guest Additions in a Debian virtual machine

Guest Additions CDimage使用(以前、記述してあった方法。こっちでもOK)

  1. ディスク挿入:
    VirtualBoxのMenu: Devices > Insert Guest Additions CD Images...
  2. 仮想機内でターミナルを開いて、コマンド実行:
    sudo bash /media/cdrom/VBoxLinuxAdditions.run
  3. 待つ
  4. 一応、再起動:
    sudo reboot
    VirtualBox_2017-11-16-rpd-x86-stretch_10_01_2018_13_54_51.png

その他

  1. コマンドラインから、スクリーンサイズ変更

    ターミナルを開いて
    # 
    xrandr -s 1024x768
    #
    # 画面が複数ある場合は、--outputなどを使う
    xrandr --output VGA-1 --mode 1366x768
    #
    # 使える解像度リストは、オプションなしで.
    xrandr
    

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
56