Ubuntuは半年に一度と比較的頻繁にリリースされており、常に最新の環境を使いたいと言うコアなユーザーには良いのだけれど、各リリースのサポート期間が9ヶ月と非常に短いため、安定した環境を長く使いたいと言うユーザには向いて居ない。そのため、通常のリリースとは別に約二年間に一度、LTS(Long Term Support)版がリリースされている。先日、その最新のLTS版であるUbuntu 16.04 Xenial Xerusがリリースされたので、この機会に早速試して見ることにした。
とは言え、新しいPCを用意してインストールする程の体力はなかったのでVagrant上に、である。
最初に用意した環境は下記の通り。
Mac OS El Capitan 10.11.4
Vagrant 1.8.1
VirtualBox 5.0.18
下記のようなコマンドでインストールと起動を行う。
mkdir xenial64 cd vagrant init ubuntu/xenial64; vagrant up --provider virtualbox
しかし、下記のようなメッセージが出て起動しない。
vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'ubuntu/xenial64' is up to date... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat default: Adapter 2: bridged ==> 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: 127.0.0.1:2222 default: SSH username: ubuntu default: SSH auth method: password The guest machine entered an invalid state while waiting for it to boot. Valid states are 'starting, running'. The machine is in the 'gurumeditation' state. Please verify everything is configured properly and try again. If the provider you're using has a GUI that comes with it, it is often helpful to open that and watch the machine, since the GUI often has more helpful error messages than Vagrant can retrieve. For example, if you're using VirtualBox, run `vagrant up` while the VirtualBox GUI is open. The primary issue for this error is that the provider you're using is not properly configured. This is very rarely a Vagrant issue.
しかも2回目以降はこうなる。
vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'ubuntu/xenial64' is up to date... ==> default: Clearing any previously set forwarded ports... There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below. Command: ["modifyvm", "43be4d09-5cca-4db0-82e7-6b57265af2f3", "--natpf1", "delete", "ssh"] Stderr: VBoxManage: error: The machine 'ubuntu-xenial-16.04-cloudimg' is already locked for a session (or being unlocked) VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 493 of file VBoxManageModifyVM.cpp
なんだこれはと思って、VirtualBox Managerで確認して見たところ、Guru Meditationと表示されている。
よくわからないがとりあえず、起動していない事は間違いない。VirtualBox Managerから仮想マシンを殺す事も出来なかったのでvagrant haltコマンドで終了させる。海外の掲示板などで見てみると、解決方法としてはVirtualboxを5.0.16にダウングレードすれば良いとのこと。
Ubuntu 16.04 (Xenial Xerus) | Hacker News
とりあえずietualBoxを5.0.16にダウングレードしてみることにした。そしてvagrant upした結果がこちら。
vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'ubuntu/xenial64' is up to date... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat default: Adapter 2: bridged ==> 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: 127.0.0.1:2222 default: SSH username: ubuntu default: SSH auth method: password default: Warning: Remote connection disconnect. Retrying... default: Warning: Remote connection disconnect. Retrying... default: Warning: Remote connection disconnect. Retrying... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... ==> default: Configuring and enabling network interfaces... The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! /sbin/ifdown eth1 2> /dev/null Stdout from the command: Stderr from the command: sudo: unable to resolve host ubuntu-xenial mesg: ttyname failed: Inappropriate ioctl for device
下記の部分で非常に時間がかかっていることと、
default: SSH auth method: password default: Warning: Remote connection disconnect. Retrying... default: Warning: Remote connection disconnect. Retrying... default: Warning: Remote connection disconnect. Retrying...
下記のメッセージが気になると言えば気になるのだけれど、vagrant sshコマンドで無事にsshログインする事が出来るようになった。
The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! /sbin/ifdown eth1 2> /dev/null Stdout from the command: Stderr from the command: sudo: unable to resolve host ubuntu-xenial mesg: ttyname failed: Inappropriate ioctl for device