MacにVirtualBoxとVagrantを入れて、Debian 9 "Stretch"を立ち上げる

タイトルの通り、MacVirtualBoxVagrantを入れて、Debian 9 “Stretch"を立ち上げていきます。


macOS Sierra 10.12.5 (16F73)
5.1.22 r115126 (Qt5.6.2)
Debian 9.0 "Stretch"


https://www.virtualbox.orgのDownloadsページから、OS X hostsのバイナリー、VirtualBox-5.1.22-115126-OSX.dmgをダウンロードしてインストールしました。



https://www.vagrantup.comのDownloadsページから、Mac OS X Universal (32 and 64-bit)の、vagrant_1.9.5_x86_64.dmgをダウンロードしてインストールしました。

Debian 9 “Stretch”

Discover Vagrant Boxes | Atlas by HashiCorp で、debianのboxを探してみると、debian/stretch64が公開されていましたので、これを使わせてもらいます。

$ vagrant init debian/stretch64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`` for more information on using Vagrant.


$ vagrant up --provider virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'debian/stretch64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'debian/stretch64'
    default: URL:
==> default: Adding box 'debian/stretch64' (v9.0.0) for provider: virtualbox
    default: Downloading:
==> default: Successfully added box 'debian/stretch64' (v9.0.0) for 'virtualbox'!
==> default: Importing base box 'debian/stretch64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'debian/stretch64' is up to date...
==> default: Setting the name of the VM: ansible_default_1498577443083_48557
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address:
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Installing rsync to the VM...
==> default: Rsyncing folder: /Users/*****/ansible/ => /vagrant

==> default: Machine 'default' has a post `vagrant up` message. This is a message
==> default: from the creator of the Vagrantfile, and not from Vagrant itself:
==> default: 
==> default: Vanilla Debian box. See for help and bug reports