$ vagrant box add bento/ubuntu-18.04
$ vagrant init bento/ubuntu-18.04
  • GUI用にVagrantfileを編集する
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at

  # Every Vagrant development environment requires a box. You can search for
  # boxes at = "bento/ubuntu-18.04"
  config.disksize.size = '64GB'

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # NOTE: This will enable public access to the opened port
  # "forwarded_port", guest: 80, host: 8080 "forwarded_port", guest: 8888, host: 8888 # jupyter用のポート設定

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine and only allow access
  # via to disable public access
  # "forwarded_port", guest: 80, host: 8080, host_ip: ""

  # Create a private network, which allows host-only access to the machine
  # using a specific IP. "private_network", ip: ""

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  config.vm.synced_folder "./shared", "/home/vagrant/shared"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  config.vm.provider "virtualbox" do |vb|
    vb.gui = true
    vb.memory = "4096"
    vb.cpus = 2
    vb.customize [
      "modifyvm", :id,
      "--vram", "256",
      "--clipboard", "bidirectional",
      "--draganddrop", "bidirectional",
      "--accelerate3d", "on",
      "--hwvirtex", "on",
      "--nestedpaging", "on",
      "--largepages", "on",
      "--ioapic", "on",
      "--chipset", "ich9",
      "--pae", "on",
      "--paravirtprovider", "kvm",
  # View the documentation for the provider you are using for more
  # information on available options.

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2

VirtualBoxで対象の仮想環境を選択して、設定 > ストレージ

$ sudo timedatectl set-timezone Asia/Tokyo
$ timedatectl # タイムゾーンを確認する
  • Ubuntuのデスクトップ環境(MATE)をインストール
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install ubuntu-mate-desktop
$ reboot
  • Guest Additionsのインストール
$ sudo apt install linux-headers-$(uname -r) build-essential dkms

ここでVirtualboxのメニューバーからデバイス > Guest Additions CDイメージの挿入

$ sudo mount /dev/cdrom /media/cdrom
$ sudo sh /media/cdrom/
$ reboot

Creating a Base Box - VirtualBox Provider - Vagrant by HashiCorp

  • 日本語化する


$sudo apt install ibus-mozc
$ reboot

Menu > Preference > Language Supportの「Use the same language choices for startup and the login screen.」からJapaneseを選択してインストールする。インストールが終わったら追加された「日本語」を一番上まで持ってくる。

・設定 > iBusの設定

・設定 > Mozcの設定
以下の2項目(各3個ある)の入力キーを全て「Ctrl Space」に変更する # 英字キーボードの場合

モード コマンド
直接入力 IMEを有効化
入力文字なし キャンセル後IMEを無効化


  • おまけ

Virtual BoxマネージャーでBOXを選択してから
設定 > ディスプレイ > リモートディスプレイで