ホストの電源を切る前の状態を保存する(Virtualbox / OpenSUSE)

ホストの電源を切る前の状態を保存する(Virtualbox / OpenSUSE)

/etc/sysconfig/vbox私は以前のバージョンのVirtualBox(3.2.6)で作業しています。ホストの起動時に起動したいだけに仮想マシンを追加できる編集内容があります。

現在、新しいバージョン4.2.6ではファイルを編集できません。サポートされなくなりました。調査するフォーラムで何かを見つけましたが、私には適していません。

cat /etc/default/virtualbox
# /etc/default/virtualbox
#
# -------------------------------------------------------------------------------------------------
# In the "SHUTDOWN_USERS" list all users for which a check for runnings VMs should be done during
# shutdown of "vboxdrv" resp. the server:
# SHUTDOWN_USERS="foo bar"
#
# Set "SHUTDOWN" to one of "poweroff", "acpibutton" or "savestate" depending on which of the
# shutdown methods for running VMs are wanted:
# SHUTDOWN="poweroff"
# SHUTDOWN="acpibutton"
# SHUTDOWN="savestate"
# -------------------------------------------------------------------------------------------------
#
#SHUTDOWN_USERS="foo bar"
#SHUTDOWN="savestate"
VBOXAUTOSTART_DB=/etc/vbox
#VBOXAUTOSTART_CONFIG=/etc/vbox/vbox.cfg
VBOXAUTOSTART_CONFIG=/etc/vbox/vboxauto.conf

これはvboxauto.conf

cat /etc/vbox/vboxauto.conf
# Default policy is to deny starting a VM, the other option is "allow".
default_policy = deny

root = {
    allow = true
}

それからこれを行います。

VBoxManage setproperty autostartdbpath /etc/vbox

この

VBoxManage modifyvm <the_machine> --autostart-enabled on

状態を見ようとすると

rcvboxes status
Virtualbox machines: no virtual machines running.                                                                                                                       skipped
vboxes.service - LSB: Autostart Virtual Box VMs
          Loaded: loaded (/etc/init.d/vboxes)
          Active: active (exited) since Tue, 2013-02-05 23:34:57 UYST; 32min ago
         Process: 30764 ExecStart=/etc/init.d/vboxes start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/vboxes.service

Feb 05 23:34:57 my.machine vboxes[30764]: Starting Virtualbox machines: no virtual machines configured..unused
Feb 05 23:34:57 my.machine systemd[1]: Started LSB: Autostart Virtual Box VMs.

VirtualBoxが私の仮想マシンを見ることができず、ヘッドレスのままになるのはなぜですか? 編集 30 - 5月

私はそれを次のように整理しました。/etc/sysconfig/vboxしかし、init.dで実行すると、次の結果が表示されます。

/etc/init.d/vboxes status
Virtualbox machines: no virtual machines running.                    skipped
vboxes.service - LSB: Autostart Virtual Box VMs
          Loaded: loaded (/etc/init.d/vboxes)
          Active: inactive (dead) since Sat, 2013-02-02 22:00:49 UYST; 1 day and 21h ago
         Process: 4155 ExecStop=/etc/init.d/vboxes stop (code=exited, status=0/SUCCESS)
         Process: 3955 ExecStart=/etc/init.d/vboxes start (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/vboxes.service

小さなテストを行い、スクリプトを/root/binに移動したところ、正常に動作しました。

./vboxes_test status
 test (user: root):                                       running (since 2013-02-04 21:55:46)                                                        running
 test (user: root):                                       running (since 2013-02-04 21:55:46)

小さなエディタ: それがこれまでに話していました...ホストを再起動すると、VMも同じことを行います。問題は、ホストの電源が切れたときにVMを再起動したくないことです。 :t*ホストがシャットダウンする前に、仮想マシンはsavestateを実行する必要があります。*。

小さなコメント: 以前にステートフルを実行してホストを再起動した場合は、VMが必要に応じて機能していた可能性があります。

どのように動作させるかについての情報はありますか?

ベストアンサー1

あなたが探しているコマンドは次のとおりです。

VBoxManage modifyvm <Machine Name> --autostop-type savestate

savestateの代替は次のとおりです[disabled|savestate|poweroff|acpishutdown]

それでも機能しない場合は、そのオプションを使用して、VMがトリガーを受信したときに状態も保存するacpishutdownようにVMを構成できると思います。acpishutdown

上記の方法が機能しない場合は、いつでも次のコマンドを使用して状態保存を手動で実行できます。

VBoxManage controlvm <vm> savestate

その後、ホストシステムを再起動します。

引用する

おすすめ記事