@sakamotooooooo

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

Linuxの開発環境を構築しているのですが、CentOSが起動できず、Private Key以降が進みません。 解決方法を教えて下さい。

解決したいこと

Linuxの開発環境を構築しているのですが、CentOSが起動できず、Private Key以降が進みません。
解決方法を教えて下さい。

開発環境

  • OS : Windows 10 Home
  • VirtualBox (7.1.8)
  • vagrant (2.4.5)

発生している問題・エラー

C:\Vagrant>vagrant up --provision
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'CentOS65'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: Vagrant_default_1747486808701_37860
==> default: Fixed port collision for 22 => 2222. Now on port 2205.
==> 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) => 2205 (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:2205
    default: SSH username: vagrant
    default: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

自分で試したこと

とある教材内から学習中です。

centos65-x86_64-20140116.box
↑こちらのリンクが切れている?

古いタイプのものだった為、最新のものをダウンロードして使用しています。

ファイル名の指定を、ダウンロードしたものの名称に変更して、こちらに指定しています。

【教材内】

vagrant box add CentOS65 C:¥Vagrant¥centos65-x86_64-20140116.box

【こちらに変更】

vagrant box add CentOS65 C:\Vagrant\CentOS-Stream-Vagrant-10-20250506.2.x86_64.vagrant-libvirt.box

以下のサイトを参考に次のことを行いました。

・タイムアウト設定変更【Vagrantfileを、メモ帳で開き、追加して上書き保存】       

config.vm.boot_timeout = 1200

・ネットワークアダプタの設定変更【Vagrantfileを、メモ帳で開き、追加して上書き保存】  

config.vm.provider 'virtualbox' do |vb|
vb.customize ['modifyvm', :id, '--cableconnected1', 'on']

end

・vagrant upに--provisionオプションを付ける

・PCからVagrantをアンインストールし、再インストール

以下のサイトを参考にしましたが、手順がわからず実行できていません。

・SSH接続用鍵ファイルの初期化

IdentityFile プライベートキーの場所

不明です。エクスプローラーで検索すると処理中となり進まず、ヒットしません。

念のため、参考にエクスプローラー内の状況です。

Desktop Screenshot 2025.05.17 - 23.06.52.50.png

こちらの、PowerShellへの操作手順(実行するコマンド)がよくわからず、試せていません。

⇩??????????????

PowerShellで管理者として以下のコマンド実行、Hyper-Vをoffにする

PowerShell > bcdedit /set hypervisorlaunchtype off

その後PC再起動

PowerShell>bcdeditコマンド で確認してみると

PowerShell > hypervisorlaunchtype Off

(参照URL)

0 likes

7Answer

This answer has been deleted for violation of our Terms of Service.

This answer has been deleted for violation of our Terms of Service.

This answer has been deleted for violation of our Terms of Service.

Comments

  1. 自分で試したことのセクションに書いてありますが、 box は最新の CentOS Stream に置き換えたようですよ。また CentOS 7 はサポート期限が切れているので今さら使うべきではないと思います。

CentOS 8だろうが7だろうが6だろうがサポート期間切れなので、今から使うべきではないです。
どうしてもなんらかの理由(仕事でそのバージョンで動作検証が必要)でそのバージョンが必要であればVagrantは使わずに手動でインストールしましょう(EOLのバージョンのVagrant Boxイメージはメンテナンスされません)。

特にバージョン指定されているわけでなければ、メンテナンスされているバージョンを使った方がいいと思います。

  • CentOS Stream 9 (ただしサポート期間は短いので注意)
  • Rockey Linux 9
  • AlmaLinux 9
  • Ubuntu
    等々
0Like

This answer has been deleted for violation of our Terms of Service.

Your answer might help someone💌