1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

VirtualBoxのVMでLinuxの開発環境を作る

Posted at

これはなに

社給のWindows PCでの開発がつらくなってきたので、VirtualBoxのVMでUbuntu16.04を動かして、開発環境として使ってみることにしました。
せっかくなので、設定周りをVagrantを使ってファイルで管理でできるようにして、随時更新して行くことにします。

まずは、gnome3のデスクトップ環境をインストールする設定を書いたもの(きっとポートフォワードの設定とか、今後足していくと思います)。

Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

    # base box
    config.vm.box = "bento/ubuntu-16.04"

    # shared folder
    config.vm.synced_folder "./data", "/vagrant_data"

    # VirtualBox VM options
    config.vm.provider "virtualbox" do |vb|
        vb.name = "ubuntu"
        vb.cpus = "2"
        vb.memory = "8192"
        # GUI settings
        #vb.gui = true
        vb.customize [
            "modifyvm", :id,
            "--vram", "256",
            "--accelerate3d", "on",
            "--hwvirtex", "on",
            "--nestedpaging", "on",
            "--largepages", "on",
            "--ioapic", "on",
            "--pae", "on",
            "--paravirtprovider", "kvm",
        ]
    end

    # desktop environment provisioner (gnome3)
    config.vm.provision "shell", inline: <<-SHELL
        sudo apt-get -y update
        sudo add-apt-repository -y ppa:gnome3-team/gnome3-staging
        sudo add-apt-repository -y ppa:gnome3-team/gnome3
        sudo apt-get -y install ubuntu-gnome-desktop
        sudo dpkg-reconfigure gdm3
    SHELL

end

使い方

  1. VirtualBox、Vagrantをインストールしておく
  2. 適当なフォルダに上記Vagrantfileを配置
  3. 上記フォルダをカレントにして、vagrant up。処理が終わるまでしばらく待つ
  4. 再起動。vagrant reload

参考リンク:

1
2
2

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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?