Tag: virtualbox Tag: 仮想化

VirtualBox

リンク

https://www.virtualbox.org/


ゲストOSが起動しない その1

 ゲストOSが起動しない時など、トラブルでうまく動かなかった時のメモなど。


仮想OSが起動しない

「modprobe vboxdrv」をrootで実行しないさいと出る

modprobe vboxdrv

 rootになって「modprobe vboxdrv」としても、改善しない。

$ sudo aptitude install linux-headers-`uname -r`
$ sudo dpkg-reconfigure virtualbox-ose-dkms


  • 2018-11-14 は、上記の「sudo dpkg-reconfigure virtualbox-ose-dkms」が処理できず、「sudo dpkg-reconfigure virtualbox-dkms」とした。
    $ sudo aptitude install linux-headers-`uname -r`
    $ sudo dpkg-reconfigure virtualbox-dkms




VirtualBox 6.0.0 をインストール

  • 2019-03-09

https://kledgeb.blogspot.com/2018/12/virtualbox-91-virtualbox-600guest.html
をそのまま参考にして、VirtualBoxを6.xにしました。

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib"
sudo apt update
sudo apt install virtualbox-6.0

仮想マシンを起動すると追加プログラム等を更新してくれました。
画面の雰囲気が少し変わりました。

VirtualBox6の管理画面


Ver 6.1.28

  • 2021-10-26

 このバージョンにしたら、USB2.0のドライバが見当たらないと警告が出て仮想PCが起動出来なくなった。USBは使っていないので一度無効にしてから、VirtualBoxのWEBサイトのダウンロードページから次の「 VirtualBox 6.1.28 Oracle VM VirtualBox Extension Pack」をダウンロードしてインストールしたら、USB3.0まで使えるようになった。

 VirtualBox 6.1.28 Oracle VM VirtualBox Extension Pack
  All supported platforms
 Support for USB 2.0 and USB 3.0 devices, VirtualBox RDP, disk encryption, NVMe and PXE boot for Intel cards. See this chapter from the User Manual for an introduction to this Extension Pack. The Extension Pack binaries are released under the VirtualBox Personal Use and Evaluation License (PUEL). Please install the same version extension pack as your installed version of VirtualBox.

 



コマンドでの管理について

 VBoxManageコマンドを使うと、仮想PCを起動、終了などが出来る。詳しくはマニュアルやネットを確認してください。実際のコマンドは、「vboxmanage」と全て小文字の場合もあります。

  • インストールされている仮想マシンの一覧表示
    $ VBoxManage list vms
    "Win7_2014" {2b9b839c-054e-4bdf-ac1a-7ebb7495c533}
    "WinXP_2014" {60d59f47-5773-4d2f-a29d-623914df3c72}
    "linuxmint182" {3acb3fde-8511-402b-b0ed-1cef7cfc1197}
    "konalinux40" {bf3a3a36-34ea-4296-9d9c-6390ce736ded}
    "orca01_1604" {4b4db6cb-3606-4f4b-897a-aa14240b189d}
  • 名前を指定して仮想マシンを起動
    VBoxManage startvm "WinXP_2014" --type headless
    VM "WinXP_2014" has been successfully started.
  • 起動中の仮想マシンを表示する
    $ VBoxManage list runningvms
    "WinXP_2014" {60d59f47-5773-4d2f-a29d-623914df3c72}




仮想OSが起動しない その2

  • 2019-04-08
  • バージョン6をインストール後に始めて起動しなくなった。
  • 以下の様に「RTR3InitEx failed with rc=-1912 (rc=-1912)」といったエラーが表示されてゲストOSが起動しなくなった。

画像の説明

対策

以下の様にして以前に利用していたファイルの残骸を削除。

# apt remove virtualbox-dkms
 # apt remove virtualbox-dkms
----- 中略 -----
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
 
 
vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-47-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
 
 
vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.15.0-47-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
 
depmod........
 
DKMS: uninstall completed.
 
------------------------------
Deleting module version: 5.2.18
completely from the DKMS tree.
------------------------------
Done.

さらに、エラーメッセージあるコマンドを起動して環境を構築?
すると、ゲストOSが起動出来た。

# /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
#


aptでインストール出来るように

  • 2020-10-04に6.1.14の新しい通知が表示されるようになりました。aptでインストールするように次の要領でバージョンアップ。

    2020-10-04

参考にしたページ

https://www.virtualbox.org/wiki/Linux_Downloads

  • rootになる
  • Oracleのaptキーを追加
    wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
    wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
  • /etc/apt/sources.list にURL追加
    最後に以下を追加しました。18.04なので「bionic」ですね。
    deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian bionic contrib
  • 実際にインストール
    apt update
    apt  install virtualbox-6.1