質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Q&A

解決済

3回答

3545閲覧

vagrant+virtualbox内に構築したcentos+php+gulpなどの環境とhtmlなどの静的ファイルを抽出したいです。

ruuusaamarki

総合スコア468

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

0グッド

0クリップ

投稿2016/09/29 14:10

編集2016/09/30 04:58

###前提・実現したいこと
vagrant+virtualbox内に構築したcentos+php+gulpなどの環境とhtmlなどの静的ファイルを抽出したいです。

前提としてvagrant up, vagrant packageができない状態で
virtualboxもアイコンをクリックしても起動しない状態です。

windows10上に環境を構築しています。

###発生している問題・エラーメッセージ
vagrant upでは以下のように出ます。
vagrant halt → vagrant upでも同様です。
vagrant reloadも同様でした。

vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'bento/centos-6.7' is up to date... ==> default: A newer version of the box 'bento/centos-6.7' is available! You currently ==> default: have version '2.2.3'. The latest is version '2.2.7'. Run ==> default: `vagrant box update` to update. ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat default: Adapter 2: hostonly ==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... The guest machine entered an invalid state while waiting for it to boot. Valid states are 'starting, running'. The machine is in the 'aborted' 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.

vagrant suspend → vagrant resumeでは以下のように出ます。

vagrant resume ==> default: Waiting for machine to boot. This may take a few minutes... The guest machine entered an invalid state while waiting for it to boot. Valid states are 'restoring, running'. The machine is in the 'aborted' 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.

vagrant packageでは以下のように出ます。

==> default: Clearing any previously set forwarded ports... The Vagrant virtual environment you are trying to package must be powered off.

vagrant statusでは以下のように出ています。

Current machine states: default aborted (virtualbox) The VM is in an aborted state. This means that it was abruptly stopped without properly closing the session. Run `vagrant up` to resume this virtual machine. If any problems persist, you may have to destroy and restart the virtual machine.

vagrant halt、vagrant suspendでは

何も表示されずプロンプトがでます。

###試したこと
vagrantfileと.vagrantディレクトリをmac(もう一台のPC)に移動。(こちらでもvagrant+virtualboxで環境を構築している。)
C:\Users\usa\VirtualBox VMsディレクトリもmacに移動。
その後ターミナルでvagrantfileを置いたディレクトリでvagrantupするもエラー発生。

The VirtualBox VM was created with a user that doesn't match the current user running Vagrant. VirtualBox requires that the same user be used to manage the VM that was created. Please re-run Vagrant with that user. This is not a Vagrant issue. The UID used to create the VM was: 0 Your UID is: 501

###色々検索したり調査して出てきた疑問(実行してこじれると困るので実行していないもの)
・vagrantもvirtualboxもディレクトリは残っているのでその中にデータはないのか。(最悪静的ファイルのみだけでも抽出したい)
・virtualboxのディレクトリ内にexeファイルがたくさんあるがこれのどれかで解決する方法はないものか。
・プログラムのアンインストールまたは変更でvirtualboxを右クリックすると「アンインストール」「変更」「修復」と出るがこれはどのような処理をするのか。

わかりずらい部分がありましたら修正させていただきます。
よろしくお願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

imutakaoru

2016/09/30 01:52

vagrant packageで失敗するということはゲストOSがpoweroffではないということです。 vagrant statusコマンドでステータスはどう見えますか? vagrant haltコマンドで停止できますか?
ruuusaamarki

2016/09/30 05:04

コメントありがとうございます。 おっしゃる通りvirtualboxが何らかの原因で入ったままになっているということで、PCそのものの電源を切ってみたりしていますがだめでした。(バッテリーを外すというのも有効なんでしょうかね。後でやってみます。)statusコマンドとhaltはやってみました。haltは何も表示されず次のプロンプトが数秒で表示されます。またなにかお気づきの点がありましたらお願いいたします。
guest

回答3

0

ベストアンサー

teratailの画像アップロード機能が500 Internal Server Errorを返却して使用できないので、外部サイトにVMのディスクを別のVMにアタッチする方法のキャプチャアップロードしました。

http://5.gigafile.nu/1008-g62ea08ad1db0f8b256e832e6aeb73869

投稿2016/09/30 16:06

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2016/09/30 16:08

あとはmountコマンドアタッチするだけです。 やる前にレスキューしたいVMのストレージはコピーしておくことをお勧めします。
ruuusaamarki

2016/10/02 02:42

度々のコメントありがとうございます! vagrantfileと.vagrantディレクトリをmac(もう一台のPC)に移動 C:\Users\usa\VirtualBox VMsディレクトリをmacに移動。 mac側ではvirtualboxのguiが立ち上がったので そちらからご提示のキャプチャを参考に 新規VMマシンを構築し、VirtualBox VMsディレクトリから .vmdkファイルを割り当てると無事たちあがり 中の環境もそのまま移行できていました! ありがとうございました!
guest

0

あまり好ましくはないですが、VirtualBoxが起動したままになっているのであれば、以下のサイトを参考に起動している仮想マシンを停止して、再起動してみたらどうでしょう?
ちなみにVBoxManageコマンドはC:\Program Files\Oracle\VirtualBoxでshiftキーを押しながら右クリックし「コマンドウィンドウをここで開く」を選択して開いたウィンドウで実行できます。

コマンドラインから Virtual Box の仮想マシンを停止する方法

投稿2016/09/30 11:40

Takuma_Tanaka

総合スコア128

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ruuusaamarki

2016/09/30 15:33

コメントありがとうございます! ご教授いただいたディレクトリにて VBoxManage list runningvms を実行してみましたが プロンプトが表示されるだけでした。 もしまたお心当たりがありましたらお願いいたします。
guest

0

Vagarantを経由せずにVirtual Boxから起動したらどうなるでしょうか?
最悪、動かなくなったVMのストレージを、新規VMにマウントしてやればファイルをレスキューすることは可能だと思います。

投稿2016/09/30 07:24

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ruuusaamarki

2016/09/30 15:26

コメントありがとうございます! virtual Boxのみの起動もできない状態(クリックしても少し読み込みリングが回るだけ) になってしまっています。 VMのストレージ(virtualboxのストレージ)ディレクトリを検索してみましたがわかりませんでした。もしご存知でしたらご教授いただけましたら幸いです。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問