8章. VBoxManage

原文はこちら

目次

8.1. 概要
8.2. コマンドの概要
8.3. 全般オプション
8.4. VBoxManage list
8.5. VBoxManage showvminfo
8.6. VBoxManage registervm / unregistervm
8.7. VBoxManage createvm
8.8. VBoxManage modifyvm
8.8.1. General settings
8.8.2. Networking settings
8.8.3. Miscellaneous settings
8.8.4. Video Capture settings
8.8.5. Remote machine settings
8.8.6. Teleporting settings
8.8.7. Debugging settings
8.8.8. USB card reader settings
8.8.9. Auto starting VMs during host system boot
8.9. VBoxManage clonevm
8.10. VBoxManage import
8.11. VBoxManage export
8.12. VBoxManage startvm
8.13. VBoxManage controlvm
8.14. VBoxManage discardstate
8.15. VBoxManage adoptstate
8.16. VBoxManage snapshot
8.17. VBoxManage closemedium
8.18. VBoxManage storageattach
8.19. VBoxManage storagectl
8.20. VBoxManage bandwidthctl
8.21. VBoxManage showmediuminfo
8.22. VBoxManage createhd
8.23. VBoxManage modifymedium
8.24. VBoxManage clonemedium
8.25. VBoxManage mediumproperty
8.26. VBoxManage encryptmedium
8.27. VBoxManage checkmediumpwd
8.28. VBoxManage convertfromraw
8.29. VBoxManage getextradata/setextradata
8.30. VBoxManage setproperty
8.31. VBoxManage usbfilter add/modify/remove
8.32. VBoxManage sharedfolder add/remove
8.33. VBoxManage guestproperty
8.34. VBoxManage guestcontrol
8.35. VBoxManage metrics
8.36. VBoxManage natnetwork
8.37. VBoxManage hostonlyif
8.38. VBoxManage dhcpserver
8.39. VBoxManage usbdevsource
8.40. VBoxManage debugvm
8.41. VBoxManage extpack

8.1. 概要

Section 1.16, “別のフロントエンド”で簡単にふれている通り、VBoxManageはVirtualBoxのコマンドライン・インタフェースです。これを使うと、ホストのオペレーティングシステムのコマンドラインからVirtualBoxを完全に制御することができます。 VBoxManageはグラフィカルユーザーインターフェース(GUI)で実装されているすべての機能を扱うことができるだけでなく、その他にも多くの機能を備えています。 仮想化エンジンの本当にすべての機能を扱える上に、GUIから(まだ)扱えない機能も扱えるのです。

次のことをしたいなら、コマンドラインを使う必要があるでしょう

  • メインのGUIとは違うユーザーインターフェイスを使う(例えば、VBoxSDLやVBoxHeadlessサーバー);

  • 仮想マシンに対するより詳細な設定や実験的な設定を行う

VBoxManageを使う際、主に2つのことを気に留めておく必要があります。 VBoxManage: 一つは、 VBoxManage 常に、「list」「createvm」「startvm」のような特有の「サブコマンド」と一緒に使うということです。VBoxManageで使えるサブコマンドの一覧は8章 VBoxManageに詳しく記しています。

もう一つは、ほとんどのサブコマンドにおいてサブコマンドの後に仮想マシンを指定する必要があるということです。これには2つの方法があります。

  • VirtualBoxのGUIで表示されている仮想マシン名で指定できます。その名前に空白を含む場合、ダブルクオートで名前全体を囲んでおく必要があります(コマンドラインの引数に空白を含む場合それが常に必要になるのと同じです)。

    例:

    VBoxManage startvm "Windows XP"
  • VirtualBoxが仮想マシンを参照するときに使う内部的な他と重複しない識別子「UUID」で仮想マシンを指定することもできます。 前述の「Windows XP」という名前を持つ仮想マシンが下記のようなUUIDを持っていることを想定してみてください。以下のコマンドは前述のコマンドと同じ意味を持ちます。

    VBoxManage startvm 670e746d-abea-4ba6-ad02-2a3b043810a5

VBoxManage list vmsとタイプすれば、現在登録されているすべての仮想マシンが名称とUUID付きで表示されます。

コマンドラインからVirtualBoxを制御する上でよく使われる事例をいくつか以下に示します。

  • 新たな仮想マシンをコマンドラインから作成し、今すぐVirtualBoxに登録するには以下のように--registerオプションつきでVBoxManage createvmコマンドを実行してください[37]

    $ VBoxManage createvm --name "SUSE 10.2" --register
    VirtualBox Command Line Management Interface Version 5.1.22
    (C) 2005-2017 Oracle Corporation
    All rights reserved.
    
    Virtual machine 'SUSE 10.2' is created.
    UUID: c89fc351-8ec6-4f02-a048-57f4d25288e5
    Settings file: '/home/username/.config/VirtualBox/Machines/SUSE 10.2/SUSE 10.2.xml'

    上記のコマンド出力から分かるように、新たなUUIDで新規仮想マシンが作成され、新たなXMLファイルも作成されています。

  • ある特定の仮想マシンに関する設定を表示するには VBoxManage showvminfoコマンドを使ってください。詳しい内容と事例は 8.5節 “VBoxManage showvminfo”をご覧ください。

  • 仮想マシンの電源がOFFになっているとき設定を変更するには、以下に示す事例のようにVBoxManage modifyvmコマンドを使ってください。

    VBoxManage modifyvm "Windows XP" --memory 512

    詳しくは8.8節 “VBoxManage modifyvm”をご覧ください。

  • ストレージ設定の変更(例:ストレージコントローラを追加した上で新たな仮想ディスクを追加する)を行うにはVBoxManage storagectlコマンドとVBoxManage storageattachコマンドを使ってください。詳しくは8.19節 “VBoxManage storagectl”8.18節 “VBoxManage storageattach”をご覧ください

  • 仮想マシンのoperationを制御するには以下のいずれかの方法を使ってください。

    • 現在電源がOFFになっている仮想マシンを起動するには、VBoxManage startvmコマンドを使ってください。詳しくは 8.12節 “VBoxManage startvm”をご覧ください。

    • 現在実行中の仮想マシンを一時停止したり保存したりするとき、また設定を変更する時はVBoxManage controlvmコマンドを使ってください。詳しくは8.13節 “VBoxManage controlvm”をご覧ください。

8.2. コマンドの概要

VBoxManageを引数なしで実行したとき、あるいは無効なコマンドを指定したとき、以下の書式情報が表示されます。 出力内容はホストのプラットフォームによって多少異なります。あるホストにおける実際の内容を確かめたいなら、そのホストでVBoxManageコマンドを実行し、利用可能なコマンド一覧を確認してみてください。

利用方法:

  VBoxManage [<全般オプション>] <コマンド>
 
 
全般オプション:
 
  [-v|--version]            バージョン番号を表示して終了する
  [-q|--nologo]             ロゴの表示を行わない
  [--settingspw <pw>]       設定時に必要となるパスワードを設定する
  [--settingspwfile <file>] パスワードを記したファイルを指定する
 
 
コマンド:
 
  list [--long|-l]          vms|runningvms|ostypes|hostdvds|hostfloppies|
                            intnets|bridgedifs|hostonlyifs|natnets|dhcpservers|
                            hostinfo|hostcpuids|hddbackends|hdds|dvds|floppies|
                            usbhost|usbfilters|systemproperties|extpacks|
                            groups|webcams|screenshotformats

  showvminfo                <uuid|仮想マシン名> [--details]
                            [--machinereadable]
  showvminfo                <uuid|仮想マシン名> --log <idx>

  registervm                <ファイル名>

  unregistervm              <uuid|仮想マシン名> [--delete]

  createvm                  --name <仮想マシン名>
                            [--groups <グループ名>, ...]
                            [--ostype <OS種別>]
                            [--register]
                            [--basefolder <パス>]
                            [--uuid <uuid>]

  modifyvm                  <uuid|仮想マシン名>
                            [--name <仮想マシン名>]
                            [--groups <グループ名>, ...]
                            [--description <説明>]
                            [--ostype <OS種別>]
                            [--iconfile <ファイル名>]
                            [--memory <メモリサイズMB単位>]
                            [--pagefusion on|off]
                            [--vram <ビデオメモリサイズMB単位>]
                            [--acpi on|off]
                            [--pciattach 03:04.0]
                            [--pciattach 03:04.0@02:01.0]
                            [--pcidetach 03:04.0]
                            [--ioapic on|off]
                            [--hpet on|off]
                            [--triplefaultreset on|off]
                            [--apic on|off]
                            [--x2apic on|off]
                            [--paravirtprovider none|default|legacy|minimal|
                                                hyperv|kvm]
                            [--paravirtdebug <キー=値> [,<キー=値> ...]]
                            [--hwvirtex on|off]
                            [--nestedpaging on|off]
                            [--largepages on|off]
                            [--vtxvpid on|off]
                            [--vtxux on|off]
                            [--pae on|off]
                            [--longmode on|off]
                            [--cpu-profile "host|Intel 80[86|286|386]"]
                            [--cpuid-portability-level <0..3>
                            [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]
                            [--cpuidremove <leaf>]
                            [--cpuidremoveall]
                            [--hardwareuuid <uuid>]
                            [--cpus <CPU数>]
                            [--cpuhotplug on|off]
                            [--plugcpu <id>]
                            [--unplugcpu <id>]
                            [--cpuexecutioncap <1-100>]
                            [--rtcuseutc on|off]
                            [--graphicscontroller none|vboxvga|vmsvga]
                            [--monitorcount <モニター数>]
                            [--accelerate3d on|off]
                            [--accelerate2dvideo on|off]
                            [--firmware bios|efi|efi32|efi64]
                            [--chipset ich9|piix3]
                            [--bioslogofadein on|off]
                            [--bioslogofadeout on|off]
                            [--bioslogodisplaytime <msec>]
                            [--bioslogoimagepath <imagepath>]
                            [--biosbootmenu disabled|menuonly|messageandmenu]
                            [--biosapic disabled|apic|x2apic]
                            [--biossystemtimeoffset <msec>]
                            [--biospxedebug on|off]
                            [--boot<1-4> none|floppy|dvd|disk|net>]
                            [--nic<1-N> none|null|nat|bridged|intnet|hostonly|
                                        generic|natnetwork]
                            [--nictype<1-N> Am79C970A|Am79C973|
                                            82540EM|82543GC|82545EM|
                                            virtio]
                            [--cableconnected<1-N> on|off]
                            [--nictrace<1-N> on|off]
                            [--nictracefile<1-N> <ファイル名>]
                            [--nicproperty<1-N> name=[value]]
                            [--nicspeed<1-N> <kbps>]
                            [--nicbootprio<1-N> <priority>]
                            [--nicpromisc<1-N> deny|allow-vms|allow-all]
                            [--nicbandwidthgroup<1-N> none|<name>]
                            [--bridgeadapter<1-N> none|<devicename>]
                            [--hostonlyadapter<1-N> none|<devicename>]
                            [--intnet<1-N> <network name>]
                            [--nat-network<1-N> <network name>]
                            [--nicgenericdrv<1-N> <driver>
                            [--natnet<1-N> <network>|default]
                            [--natsettings<1-N> [<mtu>],[<socksnd>],
                                                [<sockrcv>],[<tcpsnd>],
                                                [<tcprcv>]]
                            [--natpf<1-N> [<rulename>],tcp|udp,[<hostip>],
                                          <hostport>,[<guestip>],<guestport>]
                            [--natpf<1-N> delete <rulename>]
                            [--nattftpprefix<1-N> <prefix>]
                            [--nattftpfile<1-N> <file>]
                            [--nattftpserver<1-N> <ip>]
                            [--natbindip<1-N> <ip>
                            [--natdnspassdomain<1-N> on|off]
                            [--natdnsproxy<1-N> on|off]
                            [--natdnshostresolver<1-N> on|off]
                            [--nataliasmode<1-N> default|[log],[proxyonly],
                                                         [sameports]]
                            [--macaddress<1-N> auto|<mac>]
                            [--mouse ps2|usb|usbtablet|usbmultitouch]
                            [--keyboard ps2|usb
                            [--uart<1-N> off|<I/O base> <IRQ>]
                            [--uartmode<1-N> disconnected|
                                             server <pipe>|
                                             client <pipe>|
                                             tcpserver <port>|
                                             tcpclient <hostname:port>|
                                             file <file>|
                                             <devicename>]
                            [--lpt<1-N> off|<I/O base> <IRQ>]
                            [--lptmode<1-N> <devicename>]
                            [--guestmemoryballoon <balloonsize in MB>]
                            [--audio none|null|dsound|oss|alsa|pulse|
                                     oss|pulse|coreaudio]
                            [--audiocontroller ac97|hda|sb16]
                            [--audiocodec stac9700|ad1980|stac9221|sb16]
                            [--clipboard disabled|hosttoguest|guesttohost|
                                         bidirectional]
                            [--draganddrop disabled|hosttoguest]
                            [--vrde on|off]
                            [--vrdeextpack default|<name>
                            [--vrdeproperty <name=[value]>]
                            [--vrdeport <hostport>]
                            [--vrdeaddress <hostip>]
                            [--vrdeauthtype null|external|guest]
                            [--vrdeauthlibrary default|<name>
                            [--vrdemulticon on|off]
                            [--vrdereusecon on|off]
                            [--vrdevideochannel on|off]
                            [--vrdevideochannelquality <percent>]
                            [--usb on|off]
                            [--usbehci on|off]
                            [--usbxhci on|off]
                            [--usbrename <oldname> <newname>]
                            [--snapshotfolder default|<path>]
                            [--teleporter on|off]
                            [--teleporterport <port>]
                            [--teleporteraddress <address|empty>
                            [--teleporterpassword <password>]
                            [--teleporterpasswordfile <file>|stdin]
                            [--tracing-enabled on|off]
                            [--tracing-config <config-string>]
                            [--tracing-allow-vm-access on|off]
                            [--usbcardreader on|off]
                            [--autostart-enabled on|off]
                            [--autostart-delay <seconds>]
                            [--videocap on|off]
                            [--videocapscreens all|<screen ID> [<screen ID> ...]]
                            [--videocapfile <ファイル名>]
                            [--videocapres <width> <height>]
                            [--videocaprate <rate>]
                            [--videocapfps <fps>]
                            [--videocapmaxtime <ms>]
                            [--videocapmaxsize <MB>]
                            [--videocapopts <key=value> [,<key=value> ...]]
                            [--defaultfrontend default|<name>]

  clonevm                   <uuid|仮想マシン名>
                            [--snapshot <uuid>|<name>]
                            [--mode machine|machineandchildren|all]
                            [--options link|keepallmacs|keepnatmacs|
                                       keepdisknames]
                            [--name <name>]
                            [--groups <group>, ...]
                            [--basefolder <basefolder>]
                            [--uuid <uuid>]
                            [--register]

  import                    <ovfname/ovaname>
                            [--dry-run|-n]
                            [--options keepallmacs|keepnatmacs|importtovdi]
                            [more options]
                            (run with -n to have options displayed
                             for a particular OVF)

  export                    <machines> --output|-o <name>.<ovf/ova>
                            [--legacy09|--ovf09|--ovf10|--ovf20]
                            [--manifest]
                            [--iso]
                            [--options manifest|iso|nomacs|nomacsbutnat]
                            [--vsys <number of virtual system>]
                                    [--product <product name>]
                                    [--producturl <product url>]
                                    [--vendor <vendor name>]
                                    [--vendorurl <vendor url>]
                                    [--version <version info>]
                                    [--description <description info>]
                                    [--eula <license text>]
                                    [--eulafile <ファイル名>]

  startvm                   <uuid|仮想マシン名>...
                            [--type gui|sdl|headless|separate]

  controlvm                 <uuid|仮想マシン名>
                            pause|resume|reset|poweroff|savestate|
                            acpipowerbutton|acpisleepbutton|
                            keyboardputscancode <hex> [<hex> ...]|
                            setlinkstate<1-N> on|off |
                            nic<1-N> null|nat|bridged|intnet|hostonly|generic|
                                     natnetwork [<devicename>] |
                            nictrace<1-N> on|off |
                            nictracefile<1-N> <ファイル名> |
                            nicproperty<1-N> name=[value] |
                            nicpromisc<1-N> deny|allow-vms|allow-all |
                            natpf<1-N> [<rulename>],tcp|udp,[<hostip>],
                                        <hostport>,[<guestip>],<guestport> |
                            natpf<1-N> delete <rulename> |
                            guestmemoryballoon <balloonsize in MB> |
                            usbattach <uuid>|<address>
                                      [--capturefile <ファイル名>] |
                            usbdetach <uuid>|<address> |
                            clipboard disabled|hosttoguest|guesttohost|
                                      bidirectional |
                            draganddrop disabled|hosttoguest |
                            vrde on|off |
                            vrdeport <port> |
                            vrdeproperty <name=[value]> |
                            vrdevideochannelquality <percent> |
                            setvideomodehint <xres> <yres> <bpp>
                                            [[<display>] [<enabled:yes|no> |
                                              [<xorigin> <yorigin>]]] |
                            screenshotpng <file> [display] |
                            videocap on|off |
                            videocapscreens all|none|<screen>,[<screen>...] |
                            videocapfile <file>
                            videocapres <width>x<height>
                            videocaprate <rate>
                            videocapfps <fps>
                            videocapmaxtime <ms>
                            videocapmaxsize <MB>
                            setcredentials <username>
                                           --passwordfile <file> | <password>
                                           <domain>
                                           [--allowlocallogon <yes|no>] |
                            teleport --host <name> --port <port>
                                     [--maxdowntime <msec>]
                                     [--passwordfile <file> |
                                      --password <password>] |
                            plugcpu <id> |
                            unplugcpu <id> |
                            cpuexecutioncap <1-100>
                            webcam <attach [path [settings]]> | <detach [path]> | <list>
                            addencpassword <id>
                                           <password file>|-
                                           [--removeonsuspend <yes|no>]
                            removeencpassword <id>
                            removeallencpasswords

  discardstate              <uuid|仮想マシン名>

  adoptstate                <uuid|仮想マシン名> <state_file>

  snapshot                  <uuid|仮想マシン名>
                            take <name> [--description <desc>] [--live]
                                 [--uniquename Number,Timestamp,Space,Force] |
                            delete <uuid|snapname> |
                            restore <uuid|snapname> |
                            restorecurrent |
                            edit <uuid|snapname>|--current
                                 [--name <name>]
                                 [--description <desc>] |
                            list [--details|--machinereadable]
                            showvminfo <uuid|snapname>

  closemedium               [disk|dvd|floppy] <uuid|ファイル名>
                            [--delete]

  storageattach             <uuid|仮想マシン名>
                            --storagectl <name>
                            [--port <number>]
                            [--device <number>]
                            [--type dvddrive|hdd|fdd]
                            [--medium none|emptydrive|additions|
                                      <uuid|ファイル名>|host:<drive>|iscsi]
                            [--mtype normal|writethrough|immutable|shareable|
                                     readonly|multiattach]
                            [--comment <text>]
                            [--setuuid <uuid>]
                            [--setparentuuid <uuid>]
                            [--passthrough on|off]
                            [--tempeject on|off]
                            [--nonrotational on|off]
                            [--discard on|off]
                            [--hotpluggable on|off]
                            [--bandwidthgroup <name>]
                            [--forceunmount]
                            [--server <name>|<ip>]
                            [--target <target>]
                            [--tport <port>]
                            [--lun <lun>]
                            [--encodedlun <lun>]
                            [--username <username>]
                            [--password <password>]
                            [--initiator <initiator>]
                            [--intnet]

  storagectl                <uuid|仮想マシン名>
                            --name <name>
                            [--add ide|sata|scsi|floppy|sas|usb|pcie]
                            [--controller LSILogic|LSILogicSAS|BusLogic|
                                          IntelAHCI|PIIX3|PIIX4|ICH6|I82078|
                            [             USB|NVMe]
                            [--portcount <1-n>]
                            [--hostiocache on|off]
                            [--bootable on|off]
                            [--rename <name>]
                            [--remove]

  bandwidthctl              <uuid|仮想マシン名>
                            add <name> --type disk|network
                                --limit <megabytes per second>[k|m|g|K|M|G] |
                            set <name>
                                --limit <megabytes per second>[k|m|g|K|M|G] |
                            remove <name> |
                            list [--machinereadable]
                            (limit units: k=kilobit, m=megabit, g=gigabit,
                                          K=kilobyte, M=megabyte, G=gigabyte)

  showmediuminfo            [disk|dvd|floppy] <uuid|ファイル名>

  createmedium              [disk|dvd|floppy] --ファイル名 <ファイル名>
                            [--size <megabytes>|--sizebyte <bytes>]
                            [--diffparent <uuid>|<ファイル名>
                            [--format VDI|VMDK|VHD] (default: VDI)
                            [--variant Standard,Fixed,Split2G,Stream,ESX]

  modifymedium              [disk|dvd|floppy] <uuid|ファイル名>
                            [--type normal|writethrough|immutable|shareable|
                                    readonly|multiattach]
                            [--autoreset on|off]
                            [--property <name=[value]>]
                            [--compact]
                            [--resize <megabytes>|--resizebyte <bytes>]
                            [--move <full path to a new location>]
  clonemedium               [disk|dvd|floppy] <uuid|inputfile> <uuid|outputfile>
                            [--format VDI|VMDK|VHD|RAW|<other>]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--existing]

  mediumproperty            [disk|dvd|floppy] set <uuid|ファイル名>
                            <property> <value>

                            [disk|dvd|floppy] get <uuid|ファイル名>
                            <property>

                            [disk|dvd|floppy] delete <uuid|ファイル名>
                            <property>

  encryptmedium             <uuid|ファイル名>
                            [--newpassword <file>|-]
                            [--oldpassword <file>|-]
                            [--cipher <cipher identifier>]
                            [--newpasswordid <password identifier>]

  checkmediumpwd            <uuid|ファイル名>
                            <pwd file>|-

  convertfromraw            <ファイル名> <outputfile>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--uuid <uuid>]
  convertfromraw            stdin <outputfile> <bytes>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--uuid <uuid>]

  getextradata              global|<uuid|仮想マシン名>
                            <key>|enumerate

  setextradata              global|<uuid|仮想マシン名>
                            <key>
                            [<value>] (no value deletes key)

  setproperty               machinefolder default|<folder> |
                            hwvirtexclusive on|off |
                            vrdeauthlibrary default|<library> |
                            websrvauthlibrary default|null|<library> |
                            vrdeextpack null|<library> |
                            autostartdbpath null|<folder> |
                            loghistorycount <value>
                            defaultfrontend default|<name>
                            logginglevel <log setting>

  usbfilter                 add <index,0-N>
                            --target <uuid|仮想マシン名>|global
                            --name <string>
                            --action ignore|hold (global filters only)
                            [--active yes|no] (yes)
                            [--vendorid <XXXX>] (null)
                            [--productid <XXXX>] (null)
                            [--revision <IIFF>] (null)
                            [--manufacturer <string>] (null)
                            [--product <string>] (null)
                            [--remote yes|no] (null, VM filters only)
                            [--serialnumber <string>] (null)
                            [--maskedinterfaces <XXXXXXXX>]

  usbfilter                 modify <index,0-N>
                            --target <uuid|仮想マシン名>|global
                            [--name <string>]
                            [--action ignore|hold] (global filters only)
                            [--active yes|no]
                            [--vendorid <XXXX>|""]
                            [--productid <XXXX>|""]
                            [--revision <IIFF>|""]
                            [--manufacturer <string>|""]
                            [--product <string>|""]
                            [--remote yes|no] (null, VM filters only)
                            [--serialnumber <string>|""]
                            [--maskedinterfaces <XXXXXXXX>]

  usbfilter                 remove <index,0-N>
                            --target <uuid|仮想マシン名>|global

  sharedfolder              add <uuid|仮想マシン名>
                            --name <name> --hostpath <hostpath>
                            [--transient] [--readonly] [--automount]

  sharedfolder              remove <uuid|仮想マシン名>
                            --name <name> [--transient]

  guestproperty             get <uuid|仮想マシン名>
                            <property> [--verbose]

  guestproperty             set <uuid|仮想マシン名>
                            <property> [<value> [--flags <flags>]]

  guestproperty             delete|unset <uuid|仮想マシン名>
                            <property>

  guestproperty             enumerate <uuid|仮想マシン名>
                            [--patterns <patterns>]

  guestproperty             wait <uuid|仮想マシン名> <patterns>
                            [--timeout <msec>] [--fail-on-timeout]

  guestcontrol              <uuid|仮想マシン名> [--verbose|-v] [--quiet|-q]
                              [--username <name>] [--domain <domain>]
                              [--passwordfile <file> | --password <password>]

                              run [common-options]
                              [--exe <path to executable>] [--timeout <msec>]
                              [-E|--putenv <NAME>[=<VALUE>]] [--unquoted-args]
                              [--ignore-operhaned-processes] [--profile]
                              [--no-wait-stdout|--wait-stdout]
                              [--no-wait-stderr|--wait-stderr]
                              [--dos2unix] [--unix2dos]
                              -- <program/arg0> [argument1] ... [argumentN]]

                              start [common-options]
                              [--exe <path to executable>] [--timeout <msec>]
                              [-E|--putenv <NAME>[=<VALUE>]] [--unquoted-args]
                              [--ignore-operhaned-processes] [--profile]
                              -- <program/arg0> [argument1] ... [argumentN]]

                              copyfrom [common-options]
                              [--dryrun] [--follow] [-R|--recursive]
                              <guest-src0> [guest-src1 [...]] <host-dst>

                              copyfrom [common-options]
                              [--dryrun] [--follow] [-R|--recursive]
                              [--target-directory <host-dst-dir>]
                              <guest-src0> [guest-src1 [...]]

                              copyto [common-options]
                              [--dryrun] [--follow] [-R|--recursive]
                              <host-src0> [host-src1 [...]] <guest-dst>

                              copyto [common-options]
                              [--dryrun] [--follow] [-R|--recursive]
                              [--target-directory <guest-dst>]
                              <host-src0> [host-src1 [...]]

                              mkdir|createdir[ectory] [common-options]
                              [--parents] [--mode <mode>]
                              <guest directory> [...]

                              rmdir|removedir[ectory] [common-options]
                              [-R|--recursive]
                              <guest directory> [...]

                              removefile|rm [common-options] [-f|--force]
                              <guest file> [...]

                              mv|move|ren[ame] [common-options]
                              <source> [source1 [...]] <dest>

                              mktemp|createtemp[orary] [common-options]
                              [--secure] [--mode <mode>] [--tmpdir <directory>]
                              <template>

                              stat [common-options]
                              <file> [...]

  guestcontrol              <uuid|仮想マシン名> [--verbose|-v] [--quiet|-q]

                              list <all|sessions|processes|files> [common-opts]

                              closeprocess [common-options]
                              <   --session-id <ID>
                                | --session-name <name or pattern>
                              <PID1> [PID1 [...]]

                              closesession [common-options]
                              <  --all | --session-id <ID>
                                | --session-name <name or pattern> >

                              updatega|updateguestadditions|updateadditions
                              [--source <guest additions .ISO>]
                              [--wait-start] [common-options]
                              [-- [<argument1>] ... [<argumentN>]]

                              watch [common-options]

  metrics                   list [*|host|<仮想マシン名> [<metric_list>]]
                                                 (comma-separated)

  metrics                   setup
                            [--period <seconds>] (default: 1)
                            [--samples <count>] (default: 1)
                            [--list]
                            [*|host|<仮想マシン名> [<metric_list>]]

  metrics                   query [*|host|<仮想マシン名> [<metric_list>]]

  metrics                   enable
                            [--list]
                            [*|host|<仮想マシン名> [<metric_list>]]

  metrics                   disable
                            [--list]
                            [*|host|<仮想マシン名> [<metric_list>]]

  metrics                   collect
                            [--period <seconds>] (default: 1)
                            [--samples <count>] (default: 1)
                            [--list]
                            [--detach]
                            [*|host|<仮想マシン名> [<metric_list>]]

  natnetwork                add --netname <name>
                            --network <network>
                            [--enable|--disable]
                            [--dhcp on|off]
                            [--port-forward-4 <rule>]
                            [--loopback-4 <rule>]
                            [--ipv6 on|off]
                            [--port-forward-6 <rule>]
                            [--loopback-6 <rule>]

  natnetwork                remove --netname <name>

  natnetwork                modify --netname <name>
                            [--network <network>]
                            [--enable|--disable]
                            [--dhcp on|off]
                            [--port-forward-4 <rule>]
                            [--loopback-4 <rule>]
                            [--ipv6 on|off]
                            [--port-forward-6 <rule>]
                            [--loopback-6 <rule>]

  natnetwork                start --netname <name>

  natnetwork                stop --netname <name>

  natnetwork                list [<pattern>]

  hostonlyif                ipconfig <name>
                            [--dhcp |
                            --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |
                            --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]
                            create |
                            remove <name>

  dhcpserver                add|modify --netname <network_name> |
                                       --ifname <hostonly_if_name>
                            [--ip <ip_address>
                            --netmask <network_mask>
                            --lowerip <lower_ip>
                            --upperip <upper_ip>]
                            [--enable | --disable]

  dhcpserver                remove --netname <network_name> |
                                   --ifname <hostonly_if_name>

  usbdevsource              add <source name>
                            --backend <backend>
                            --address <address>
  usbdevsource              remove <source name>

VBoxManage debugvm <uuid|仮想マシン名> dumpvmcore [--ファイル名=name]

VBoxManage debugvm <uuid|仮想マシン名> info <item> [args...]

VBoxManage debugvm <uuid|仮想マシン名> injectnmi

VBoxManage debugvm <uuid|仮想マシン名> log [[--release] | [--debug]] [group-settings...]

VBoxManage debugvm <uuid|仮想マシン名> logdest [[--release] | [--debug]] [destinations...]

VBoxManage debugvm <uuid|仮想マシン名> logflags [[--release] | [--debug]] [flags...]

VBoxManage debugvm <uuid|仮想マシン名> osdetect

VBoxManage debugvm <uuid|仮想マシン名> osinfo

VBoxManage debugvm <uuid|仮想マシン名> osdmesg [--lines=lines]

VBoxManage debugvm <uuid|仮想マシン名> getregisters [--cpu=id] [reg-set.reg-name...]

VBoxManage debugvm <uuid|仮想マシン名> setregisters [--cpu=id] [reg-set.reg-name=value...]

VBoxManage debugvm <uuid|仮想マシン名> show [[--human-readable] | [--sh-export] | [--sh-eval] | [--cmd-set]] [settings-item...]

VBoxManage debugvm <uuid|仮想マシン名> stack [--cpu=id]

VBoxManage debugvm <uuid|仮想マシン名> statistics [--reset] [--descriptions] [--pattern=pattern]

VBoxManage extpack install [--replace] <tarball>

VBoxManage extpack uninstall [--force] <name>

VBoxManage extpack cleanup

Each time 各VBoxManageコマンドの実行で実行される処理するごとに is invoked, only one command can be executed. However, a command might support several subcommands which then can be invoked in one single call. The following sections provide detailed reference information on the different commands.

8.3. 全般オプション

  • -v|--version: このツールのバージョンを表示して終了する。

  • --nologo: ロゴ情報の出力を抑制する(スクリプト処理に有用)。

  • --settingspw: 設定パスワードを指定する。

  • --settingspwfile: 設定パスワードが書かれたファイルを指定する。

設定パスワードはセキュリティ上の理由から暗号化して保存する必要のある設定に使われます。今のところ、暗号化される設定項目はiSCSI初期化暗号だけです(詳しくは8.18節 “VBoxManage storageattach”を参照してください)。 As long as no settings password is specified, this information is stored in plain text. After using the --settingspw|--settingspwfile option once, it must be always used, otherwise the encrypted setting cannot be unencrypted.

8.4. VBoxManage list

The list command gives relevant information about your system and information about VirtualBox's current settings.

The following subcommands are available with VBoxManage list:

  • vms lists all virtual machines currently registered with VirtualBox. By default this displays a compact list with each VM's name and UUID; if you also specify --long or -l, this will be a detailed list as with the showvminfo command (see below).

  • runningvms lists all currently running virtual machines by their unique identifiers (UUIDs) in the same format as with vms.

  • ostypes lists all guest operating systems presently known to VirtualBox, along with the identifiers used to refer to them with the modifyvm command.

  • hostdvds, hostfloppies, respectively, list DVD, floppy, bridged networking and host-only networking interfaces on the host, along with the name used to access them from within VirtualBox.

  • intnets displays information about the internal networks.

  • bridgedifs, hostonlyifs, natnets and dhcpservers, respectively, list bridged network interfaces, host-only network interfaces, NAT network interfaces and DHCP servers currently available on the host. Please see Chapter 6, Virtual networking for details on these.

  • hostinfo displays information about the host system, such as CPUs, memory size and operating system version.

  • hostcpuids dumps the CPUID parameters for the host CPUs. This can be used for a more fine grained analyis of the host's virtualization capabilities.

  • hddbackends lists all known virtual disk back-ends of VirtualBox. For each such format (such as VDI, VMDK or RAW), this lists the back-end's capabilities and configuration.

  • hdds, dvds and floppies all give you information about virtual disk images currently in use by VirtualBox, including all their settings, the unique identifiers (UUIDs) associated with them by VirtualBox and all files associated with them. This is the command-line equivalent of the Virtual Media Manager; see Section 5.3, “The Virtual Media Manager”.

  • usbhost supplies information about USB devices attached to the host, notably information useful for constructing USB filters and whether they are currently in use by the host.

  • usbfilters lists all global USB filters registered with VirtualBox -- that is, filters for devices which are accessible to all virtual machines -- and displays the filter parameters.

  • systemproperties displays some global VirtualBox settings, such as minimum and maximum guest RAM and virtual hard disk size, folder settings and the current authentication library in use.

  • extpacks displays all VirtualBox extension packs currently installed; see Section 1.5, “Installing VirtualBox and extension packs” and Section 8.41, “VBoxManage extpack” for more information.

  • groups displays details of the VM Groups; see Section 1.9, “Using VM groups” for more information.

  • webcams displays a list of webcams attached to the running VM. The output format is a list of absolute paths or aliases that were used for attaching the webcams to the VM using the 'webcam attach' command.

  • screenshotformats displays a list of available screenshot formats.

8.5. VBoxManage showvminfo

The showvminfo command shows information about a particular virtual machine. This is the same information as VBoxManage list vms --long would show for all virtual machines.

You will get information that resembles the following example.

$ VBoxManage showvminfo "Windows XP"
VirtualBox Command Line Management Interface Version 5.1.22
(C) 2005-2017 Oracle Corporation
All rights reserved.

Name:            Windows XP
Guest OS:        Other/Unknown
UUID:            1bf3464d-57c6-4d49-92a9-a5cc3816b7e7
Config file:     /home/username/.config/VirtualBox/Machines/Windows XP/Windows XP.xml
Memory size:     512MB
VRAM size:       12MB
Number of CPUs:  2
Boot menu mode:  message and menu
Boot Device (1): DVD
Boot Device (2): HardDisk
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
...
    

Use the --machinereadable option to produce the same output, but in machine readable format: property="value" on a line by line basis, e.g.:

name="VBoxSDL --startvm OL7.2"
groups="/"
ostype="Oracle (64-bit)"
UUID="457af700-bc0a-4258-aa3c-13b03da171f2"
...
    

8.6. VBoxManage registervm / unregistervm

The registervm command allows you to import a virtual machine definition in an XML file into VirtualBox. The machine must not conflict with one already registered in VirtualBox and it may not have any hard or removable disks attached. It is advisable to place the definition file in the machines folder before registering it.

Note

When creating a new virtual machine with VBoxManage createvm (see below), you can directly specify the --register option to avoid having to register it separately.

The unregistervm command unregisters a virtual machine. If --delete is also specified, the following files will automatically be deleted as well:

  1. all hard disk image files, including differencing files, which are used by the machine and not shared with other machines;

  2. saved state files that the machine created, if any (one if the machine was in "saved" state and one for each online snapshot);

  3. the machine XML file and its backups;

  4. the machine log files, if any;

  5. the machine directory, if it is empty after having deleted all the above.

8.7. VBoxManage createvm

This command creates a new XML virtual machine definition file.

The --name <name> parameter is required and must specify the name of the machine. Since this name is used by default as the file name of the settings file (with the extension .xml) and the machine folder (a subfolder of the .config/VirtualBox/Machines folder - this folder name may vary depending on the operating system and the version of VirtualBox which you are using), it must conform to your host operating system's requirements for file name specifications. If the VM is later renamed, the file and folder names will change automatically.

However, if the --basefolder <path> option is used, the machine folder will be named <path>. In this case, the names of the file and the folder will not change if the virtual machine is renamed.

If the --group <group>, ... option is used, the machine will be assigned membership of the specified VM groups in the list. Note that group ids always start with a / and can be nested. By default, VMs are always assigned membership of the group /.

If the --ostype <ostype>: option is used, <ostype> specifies the guest operating system to run in the VM. To learn about the available OS options, run VBoxManage list ostypes .

If the --uuid <uuid>: option is used, <uuid> specifies the VM uuid. This must be unique within the namespace of the host, or that of the VM Group if it is assigned to a VM group membership. By default, a unique uuid within the appropriate namespace is automatically generated.

By default, this command only creates the XML file without automatically registering the VM with your VirtualBox installation. To register the VM instantly, use the optional --register option, or run VBoxManage registervm separately afterwards.

8.8. VBoxManage modifyvm

This command changes the properties of a registered virtual machine which is not running. Most of the properties that this command makes available correspond to the VM settings that VirtualBox graphical user interface displays in each VM's "Settings" dialog; these were described in Chapter 3, Configuring virtual machines. Some of the more advanced settings, however, are only available through the VBoxManage interface.

These commands require that the machine is powered off (neither running nor in "saved" state). Some machine settings can also be changed while a machine is running; those settings will then have a corresponding subcommand with the VBoxManage controlvm subcommand (see Section 8.13, “VBoxManage controlvm”).

8.8.1. General settings

The following general settings are available through VBoxManage modifyvm:

  • --name <name>: This changes the VM's name and possibly renames the internal virtual machine files, as described with VBoxManage createvm above.

  • --groups <group>, ...: This changes the group membership of a VM. Groups always start with a / and can be nested. By default VMs are in group /.

  • --description <desc>: This changes the VM's description, which is a way to record details about the VM in a way which is meaningful for the user. The GUI interprets HTML formatting, the command line allows arbitrary strings potentially containing multiple lines.

  • --ostype <ostype>: This specifies what guest operating system is supposed to run in the VM. To learn about the various identifiers that can be used here, use VBoxManage list ostypes.

  • --iconfile <ファイル名>: This specifies the absolute path on the host file system for the VirtualBox icon to be displayed in the VM.

  • --memory <memorysize>: This sets the amount of RAM, in MB, that the virtual machine should allocate for itself from the host. See the remarks in Section 1.7, “Creating your first virtual machine” for more information.

  • --pagefusion on|off: Enables/disables (default) the Page Fusion feature. The Page Fusion feature minimises memory duplication between VMs with similar configurations running on the same host. See Section 4.9.2, “Page Fusion” for details.

  • --vram <vramsize>: This sets the amount of RAM that the virtual graphics card should have. See Section 3.5, “Display settings” for details.

  • --acpi on|off; --ioapic on|off: These two determine whether the VM should have ACPI and I/O APIC support, respectively; see Section 3.4.1, “"Motherboard" tab” for details.

  • --pciattach <host PCI address [@ guest PCI bus address]>: Attaches a specified PCI network controller on the host to a PCI bus (can specify) on the guest. See Section 9.6, “PCI passthrough” for details.

  • --pcidetach <host PCI address>: Detaches a specified PCI network controller on the host from the attached PCI bus on the guest. See Section 9.6, “PCI passthrough” for details.

  • --hardwareuuid <uuid>: The UUID presented to the guest via memory tables (DMI/SMBIOS), hardware and guest properties. By default this is the same as the VM uuid. Useful when cloning a VM. Teleporting takes care of this automatically.

  • --cpus <cpucount>: This sets the number of virtual CPUs for the virtual machine (see Section 3.4.2, “"Processor" tab”). If CPU hot-plugging is enabled (see below), this then sets the maximum number of virtual CPUs that can be plugged into the virtual machines.

  • --cpuhotplug on|off: This enables CPU hot-plugging. When enabled, virtual CPUs can be added to and removed from a virtual machine while it is running. See Section 9.5, “CPU hot-plugging” for more information.

  • --plugcpu|unplugcpu <id>: If CPU hot-plugging is enabled (see above), this adds a virtual CPU to the virtual machines (or removes one). <id> specifies the index of the virtual CPU to be added or removed and must be a number from 0 to the maximum no. of CPUs configured with the --cpus option. CPU 0 can never be removed.

  • --cpuexecutioncap <1-100>: This setting controls how much cpu time a virtual CPU can use. A value of 50 implies a single virtual CPU can use up to 50% of a single host CPU.

  • --pae on|off: This enables/disables PAE (see Section 3.4.2, “"Processor" tab”).

  • --longmode on|off: This enables/disables long mode (see Section 3.4.2, “"Processor" tab”).

  • --cpu-profile <host|intel 80[86|286|386]>: Indicate the use of a profile for guest cpu emulation. Specify either one based on the host system CPU (host), or one from a number of older Intel Micro-architectures - 8086, 80286, 80386.

  • --hpet on|off: This enables/disables a High Precision Event Timer (HPET) which can replace the legacy system timers. This is turned off by default. Note that Windows supports a HPET only from Vista onwards.

  • --hwvirtex on|off: This enables or disables the use of hardware virtualization extensions (Intel VT-x or AMD-V) in the processor of your host system; see Section 10.3, “Hardware vs. software virtualization”.

  • --triplefaultreset on|off: This setting allows to reset the guest instead of triggering a Guru Meditation. Some guests raise a triple fault to reset the CPU so sometimes this is desired behavior. Works only for non-SMP guests.

  • --apic on|off: This setting enables(default)/disables IO APIC. With I/O APIC, operating systems can use more than 16 interrupt requests (IRQs) thus avoiding IRQ sharing for improved reliability. See Section 3.4.1, “"Motherboard" tab”.

  • --x2apic on|off: This setting enables(default)/disables CPU x2APIC support. CPU x2APIC support helps operating systems run more efficiently on high core count configurations, and optimizes interrupt distribution in virtualized environments. Disable when using host/guest operating systems incompatible with x2APIC support.

  • --paravirtprovider none|default|legacy|minimal|hyperv|kvm: This setting specifies which paravirtualization interface to provide to the guest operating system. Specifying none explicitly turns off exposing any paravirtualization interface. The option default, will pick an appropriate interface depending on the guest OS type while starting the VM. This is the default option chosen while creating new VMs. The legacy option is chosen for VMs which were created with older VirtualBox versions and will pick a paravirtualization interface while starting the VM with VirtualBox 5.0 and newer. The minimal provider is mandatory for Mac OS X guests, while kvm and hyperv are recommended for Linux and Windows guests respectively. These options are explained in detail under Section 10.4, “Paravirtualization providers”.

  • --paravirtdebug <key=value> [,<key=value> ...]: This setting specifies debugging options specific to the paravirtualization provider configured for this VM. Please refer to the provider specific options under Section 9.32, “Paravirtualized debugging” for a list of supported key-value pairs for each provider.

  • --nestedpaging on|off: If hardware virtualization is enabled, this additional setting enables or disables the use of the nested paging feature in the processor of your host system; see Section 10.3, “Hardware vs. software virtualization”.

  • --largepages on|off: If hardware virtualization and nested paging are enabled, for Intel VT-x only, an additional performance improvement of up to 5% can be obtained by enabling this setting. This causes the hypervisor to use large pages to reduce TLB use and overhead.

  • --vtxvpid on|off: If hardware virtualization is enabled, for Intel VT-x only, this additional setting enables or disables the use of the tagged TLB (VPID) feature in the processor of your host system; see Section 10.3, “Hardware vs. software virtualization”.

  • --vtxux on|off: If hardware virtualization is enabled, for Intel VT-x only, this setting enables or disables the use of the unrestricted guest mode feature for executing your guest.

  • --accelerate3d on|off: This enables, if the Guest Additions are installed, whether hardware 3D acceleration should be available; see Section 4.5.1, “Hardware 3D acceleration (OpenGL and Direct3D 8/9)”.

  • --accelerate2dvideo on|off: This enables, if the Guest Additions are installed, whether 2D video acceleration should be available; see Section 4.5.2, “Hardware 2D video acceleration for Windows guests”.

  • --chipset piix3|ich9: By default VirtualBox emulates an Intel PIIX3 chipset. Usually there is no reason to change the default setting unless it is required to relax some of its constraints; see Section 3.4.1, “"Motherboard" tab”.

  • You can influence the BIOS logo that is displayed when a virtual machine starts up with a number of settings. Per default, a VirtualBox logo is displayed.

    With --bioslogofadein on|off and --bioslogofadeout on|off, you can determine whether the logo should fade in and out, respectively.

    With --bioslogodisplaytime <msec> you can set how long the logo should be visible, in milliseconds.

    With --bioslogoimagepath <imagepath> you can, if you are so inclined, replace the image that is shown, with your own logo. The image must be an uncompressed 256 color BMP file without color space information (Windows 3.0 format). The image must not be bigger than 640 x 480.

  • --biosbootmenu disabled|menuonly|messageandmenu: This specifies whether the BIOS allows the user to select a temporary boot device. menuonly suppresses the message, but the user can still press F12 to select a temporary boot device.

  • --biosapic x2apic|apic|disabled: This specifies the firmware APIC level to be used. Options are: x2apic, apic or disabled (no apic or x2apic) respectively.

    Note that if x2apic is specified and x2apic is unsupported by the VCPU, biosapic downgrades to apic, if supported - otherwise to 'disabled'. Similarly, if apic is specified, and apic is unsupported results in a downgrade to 'disabled'.

  • --biossystemtimeoffset <ms>: This specifies a fixed time offset (milliseconds) of the guest relative to the host time. If the offset is positive, the guest time runs ahead of the host time.

  • --biospxedebug on|off: This option enables additional debugging output when using the Intel PXE boot ROM. The output will be written to the release log file (Section 12.1.2, “Collecting debugging information”.

  • --boot<1-4> none|floppy|dvd|disk|net: This specifies the boot order for the virtual machine. There are four "slots", which the VM will try to access from 1 to 4, and for each of which you can set a device that the VM should attempt to boot from.

  • --rtcuseutc on|off: This option lets the real-time clock (RTC) operate in UTC time (see Section 3.4.1, “"Motherboard" tab”).

  • --graphicscontroller none|vboxvga|vmsvga: This option specifies use of a graphics controller, and type chosen from vboxvga or vmsvga. Section 3.4.1, “"Motherboard" tab”).

  • --snapshotfolder default|<path>: This allows you to specify the folder in which snapshots will be kept for a virtual machine.

  • --firmware bios|efi|efi32|efi64: Specifies which firmware to be used to boot the VM: Available options are BIOS, or one of the EFI options: efi, efi32 or efi64. Use EFI options with care.

  • --guestmemoryballoon <size> sets the default size of the guest memory balloon, that is, memory allocated by the VirtualBox Guest Additions from the guest operating system and returned to the hypervisor for re-use by other virtual machines. <size> must be specified in megabytes. The default size is 0 megabytes. For details, see Section 4.9.1, “Memory ballooning”.

  • --defaultfrontend default|<name>: This allows you to specify the default frontend which will be used when starting this VM; see Section 8.12, “VBoxManage startvm” for details.

8.8.2. Networking settings

The following networking settings are available through VBoxManage modifyvm. With all these settings, the decimal number directly following the option name ("1-N" in the list below) specifies the virtual network adapter whose settings should be changed.

  • --nic<1-N> none|null|nat|natnetwork|bridged|intnet|hostonly|generic: With this, you can set, for each of the VM's virtual network cards, what type of networking should be available. They can be not present (none), not connected to the host (null), use network address translation (nat), use the new network address translation engine (natnetwork), bridged networking (bridged) or communicate with other virtual machines using internal networking (intnet), host-only networking (hostonly), or access rarely used sub-modes (generic). These options correspond to the modes which are described in detail in Section 6.2, “Introduction to networking modes”.

  • --nictype<1-N> Am79C970A|Am79C973|82540EM|82543GC|82545EM|virtio: This allows you, for each of the VM's virtual network cards, to specify which networking hardware VirtualBox presents to the guest; see Section 6.1, “Virtual networking hardware”.

  • --cableconnected<1-N> on|off: This allows you to temporarily disconnect a virtual network interface, as if a network cable had been pulled from a real network card. This might be useful for resetting certain software components in the VM.

  • With the "nictrace" options, you can optionally trace network traffic by dumping it to a file, for debugging purposes.

    With --nictrace<1-N> on|off, you can enable network tracing for a particular virtual network card.

    If enabled, you must specify with --nictracefile<1-N> <ファイル名> what file the trace should be logged to.

  • --nicproperty<1-N> <paramname>="paramvalue": This option, in combination with "nicgenericdrv" allows you to pass parameters to rarely-used network backends.

    Those parameters are backend engine-specific, and are different between UDP Tunnel and the VDE backend drivers. For example, please see Section 6.8, “UDP Tunnel networking”.

  • --nicspeed<1-N> <kbps>: If generic networking has been enabled for a virtual network card (see the --nic option above; otherwise this setting has no effect), this mode enables access to rarely used networking sub-modes, such as VDE network or UDP Tunnel. This option specifies the throughput rate in KBytes/sec.

  • --nicbootprio<1-N> <priority>: This specifies the order in which NICs are tried for booting over the network (using PXE). The priority is an integer in the 0 to 4 range. Priority 1 is the highest, priority 4 is low. Priority 0, which is the default unless otherwise specified, is the lowest.

    Note that this option only has effect when the Intel PXE boot ROM is used.

  • --nicpromisc<1-N> deny|allow-vms|allow-all: This allows you, for each of the VM's virtual network cards, to specify how the promiscuous mode is handled. This setting is only relevant for bridged networking. deny (default setting) hides any traffic not intended for this VM. allow-vms hides all host traffic from this VM but allows the VM to see traffic from/to other VMs. allow-all removes this restriction completely.

  • --nicbandwidthgroup<1-N> none|<name>: This removes/adds an assignment of a bandwidth group from/to the specified virtual network interface. Specifying none removes any current bandwidth group assignment from the specified virtual network interface. Specifying <name> adds an assignment of a bandwidth group to the specified virtual network interface.

    For details, please see Section 6.10, “Limiting bandwidth for network I/O”.

  • --bridgeadapter<1-N> none|<devicename>: If bridged networking has been enabled for a virtual network card (see the --nic option above; otherwise this setting has no effect), use this option to specify which host interface the given virtual network interface will use. For details, please see Section 6.5, “Bridged networking”.

  • --hostonlyadapter<1-N> none|<devicename>: If host-only networking has been enabled for a virtual network card (see the --nic option above; otherwise this setting has no effect), use this option to specify which host-only networking interface the given virtual network interface will use. For details, please see Section 6.7, “Host-only networking”.

  • --intnet<1-N> network: If internal networking has been enabled for a virtual network card (see the --nic option above; otherwise this setting has no effect), use this option to specify the name of the internal network (see Section 6.6, “Internal networking”).

  • --nat-network<1-N> <network name>: If the networking type is set to natnetwork (not nat) then this setting specifies the name of the NAT network this adapter is connected to.

  • --nicgenericdrv<1-N> <backend driver>: If generic networking has been enabled for a virtual network card (see the --nic option above; otherwise this setting has no effect), this mode allows you to access rarely used networking sub-modes, such as VDE network or UDP Tunnel.

  • --macaddress<1-N> auto|<mac>: With this option you can set the MAC address of a particular network adapter on the VM. Normally, each network adapter is assigned a random address by VirtualBox at VM creation.

8.8.2.1. NAT Networking settings.

The following NAT networking settings are available through VBoxManage modifyvm. With all these settings, the decimal number directly following the option name ("1-N" in the list below) specifies the virtual network adapter whose settings should be changed.

8.8.3. Miscellaneous settings

The following other hardware settings, such as serial port, audio, clipboard, drag and drop, monitor and USB settings are available through VBoxManage modifyvm:

  • --mouse <ps2|usb|usbtablet|usbmultitouch>: Specifies the mode of the mouse to be used in the VM. Available options are: ps2, usb, usbtablet, usbmultitouch.

  • --keyboard <ps2|usb>: Specifies the mode of the keyboard to be used in the VM. Available options are: ps2, usb.

  • --uart<1-N> off|<I/O base> <IRQ>: With this option you can configure virtual serial ports for the VM; see Section 3.9, “Serial ports” for an introduction.

  • --uartmode<1-N> <arg>: This setting controls how VirtualBox connects a given virtual serial port (previously configured with the --uartX setting, see above) to the host on which the virtual machine is running. As described in detail in Section 3.9, “Serial ports”, for each such port, you can specify <arg> as one of the following options:

    • disconnected: Even though the serial port is shown to the guest, it has no "other end" -- like a real COM port without a cable.

    • server <pipename>: On a Windows host, this tells VirtualBox to create a named pipe on the host named <pipename> and connect the virtual serial device to it. Note that Windows requires that the name of a named pipe begin with \\.\pipe\.

      On a Linux host, instead of a named pipe, a local domain socket is used.

    • client <pipename>: This operates just like server ..., except that the pipe (or local domain socket) is not created by VirtualBox, but assumed to exist already.

    • tcpserver <port>: This tells VirtualBox to create a TCP socket on the host with TCP <port> and connect the virtual serial device to it. Note that UNIX-like systems require ports over 1024 for normal users.

    • tcpclient <hostname:port>: This operates just like tcpserver ..., except that the TCP socket is not created by VirtualBox, but assumed to exist already.

    • file <file>: This redirects the serial port output to a raw file <file> specified by its absolute path on the host file system.

    • <devicename>: If, instead of the above, the device name of a physical hardware serial port of the host is specified, the virtual serial port is connected to that hardware port. On a Windows host, the device name will be a COM port such as COM1; on a Linux host, the device name will look like /dev/ttyS0. This allows you to "wire" a real serial port to a virtual machine.

  • --lptmode<1-N> <Device>: Specifies the Device Name of the parallel port that the Parallel Port feature will be using. Use this before --lpt. This feature is host operating system specific. For Windows hosts, use a device name like lpt1 while on Linux hosts you have to use a device name like /dev/lp0

  • --lpt<1-N> <I/O base> <IRQ>: Specifies the I/O address of the parallel port and the IRQ number that the Parallel Port feature will be using. Use this after --lptmod. I/O base address and IRQ are the values that guest sees i.e. the values avalable under guest Device Manager.

  • --audio none|null|dsound|oss|alsa|pulse|coreaudio: With this setting, you can specify whether the VM should have audio support, and – if so – which type. The list of supported audio types depends on the host and can be determined with VBoxManage modifyvm.

  • --audiocontroller ac97|hda|sb16: With this option, you can specify the audio controller to be used with this VM.

  • --audiocodec stac9700|ad1980|stac9221|sb16: With this option, you can specify the audio codec to be used with this VM.

  • --clipboard disabled|hosttoguest|guesttohost|bidirectional: With this setting, you can select if and how the guest or host operating system's clipboard should be shared with the host or guest; see Section 3.3, “General settings”. This requires that the Guest Additions be installed in the virtual machine.

  • --draganddrop disabled|hosttoguest|guesttohost|bidirectional: With this setting, you can select the current drag and drop mode being used between the host and the virtual machine; see Section 4.4, “Drag and Drop”. This requires that the Guest Additions be installed in the virtual machine.

  • --monitorcount <count>: This enables multi-monitor support; see Section 3.5, “Display settings”.

  • --usb on|off: This option enables or disables the VM's virtual USB controller; see Section 3.10.1, “USB settings” for details.

  • --usbehci on|off: This option enables or disables the VM's virtual USB 2.0 controller; see Section 3.10.1, “USB settings” for details.

  • --usbxhci on|off: This option enables or disables the VM's virtual USB 3.0 controller; see Section 3.10.1, “USB settings” for details.

  • --usbrename <oldname> <newname>: This option enables renaming of the VM's virtual USB controller from <oldname> to <newname>.

8.8.4. Video Capture settings

The following settings for changing video recording parameters are available through VBoxManage modifyvm.

  • --videocap on|off: This option enables or disables recording a VM session into a WebM/VP8 file. If this option is enabled, recording will start when the VM session is started.

  • --videocapscreens all|<screen ID> [<screen ID> ...]: This option allows to specify which screens of the VM are being recorded. Each screen is recorded into a separate file.

  • --videocapfile <ファイル名>: This option sets the ファイル名 VirtualBox uses to save the recorded content.

  • --videocapres <width>x<height>: This option sets the resolution (in pixels) of the recorded video.

  • --videocaprate <rate>: This option sets the bitrate in kilobits (kb) per second. Increasing this value makes the video look better for the cost of an increased file size.

  • --videocapfps <fps>: This option sets the maximum number of frames per second (FPS) to be recorded. Frames with a higher frequency will be skipped. Reducing this value increases the number of skipped frames and reduces the file size.

  • --videocapmaxtime <ms>: This option sets the maximum time in milliseconds the video capturing will be enabled since activation. The capturing stops when the defined time interval has elapsed. If this value is zero the capturing is not limited by time.

  • --videocapmaxsize <MB>: This option limits the maximum size of the captured video file (in MB). The capturing stops when the file size has reached the specified size. If this value is zero the capturing will not be limited by file size.

  • --videocapopts <key=value> [,<key=value> ...]: This format can be used to specify additional video capturing options. These options only are for advanced users and must be specified in a comma-separated key=value format, e.g. foo=bar,a=b.

8.8.5. Remote machine settings

The following settings that affect remote machine behavior are available through VBoxManage modifyvm:

  • --vrde on|off: This enables or disables the VirtualBox remote desktop extension (VRDE) server.

  • --vrdeproperty "TCP/Ports|Address=<value>" sets the port number(s) and IP address on the VM that the VRDE server can bind to.

    • For TCP/Ports, <value> should be a port or a range of ports that the VRDE server can bind to; "default" or "0" means port 3389, the standard port for RDP. For details, see the description for the --vrdeport option in Section 8.8.5, “Remote machine settings”.

    • For TCP/Address, <value> should be the IP address of the host network interface that the VRDE server will bind to. If specified, the server will accept connections only on the specified host network interface. For details, see the description for the --vrdeaddress option in Section 8.8.5, “Remote machine settings”.

  • --vrdeproperty "VideoChannel/Enabled|Quality|DownscaleProtection=<value>" sets the VRDP video redirection properties.

    • For VideoChannel/Enabled, <value> can be set to "1" switching the VRDP video channel on. For details, see Section 7.1.9, “VRDP video redirection”.

    • For VideoChannel/Quality, <value> should be set between 10 and 100% inclusive, representing a JPEG compression level on the VRDE server video channel. Lower values mean lower quality but higher compression. For details, see Section 7.1.9, “VRDP video redirection”.

    • For VideoChannel/DownscaleProtection, <value> can be set to "1" to enable the videochannel downscale protection feature. When enabled, if a video's size equals the shadow buffer size, then it is regarded as a full screen video, and is displayed; but if its size is between fullscreen and the downscale threshold - it is NOT displayed, as it could be an application window, which would be unreadable when downscaled. When the downscale protection feature is disabled, an attempt is always made to display videos.

  • --vrdeproperty "Client/DisableDisplay|DisableInput|DisableAudio|DisableUSB=1"

    disables one of the VRDE server features: Display, Input, Audio or USB respectively. To re-enable a feature, use e.g. "Client/DisableDisplay=". For details, see Section 7.1.10, “VRDP customization”.

  • --vrdeproperty "Client/DisableClipboard|DisableUpstreamAudio=1"

    disables one of the VRDE server features: Clipboard or UpstreamAudio respectively. To re-enable a feature, use e.g. "Client/DisableClipboard=". For details, see Section 7.1.10, “VRDP customization”.

  • --vrdeproperty "Client/DisableRDPDR=1"

    disables the VRDE server feature: RDP device redirection for smart cards. To re-enable this feature, use "Client/DisableRDPR=".

  • --vrdeproperty "H3DRedirect/Enabled=1"

    enables the VRDE server feature: 3D redirection. To re-disable this feature, use "H3DRedirect/Enabled=".

  • --vrdeproperty "Security/Method|ServerCertificate|ServerPrivateKey|CACertificate=<value>" sets the desired security method/Path of server certificate, path of server private key, path of CA certificate, used for a connection.

    • --vrdeproperty "Security/Method=<value>" sets the desired security method, which is used for a connection. Valid values are:

      • Negotiate - both Enhanced (TLS) and Standard RDP Security connections are allowed. The security method is negotiated with the client. This is the default setting.

      • RDP - only Standard RDP Security is accepted.

      • TLS - only Enhanced RDP Security is accepted. The client must support TLS.

      For details, see Section 7.1.6, “RDP encryption”.

    • --vrdeproperty "Security/ServerCertificate=<value>" where <value> is the absolute path of the server certificate. For details, see Section 7.1.6, “RDP encryption”.

    • --vrdeproperty "Security/ServerPrivateKey=<value>" where <value> is the absolute path of the server private key. For details, see Section 7.1.6, “RDP encryption”.

    • --vrdeproperty "Security/CACertificate=<value>" where <value> is the absolute path of the CA self signed certificate. For details, see Section 7.1.6, “RDP encryption”.

  • --vrdeproperty "Audio/RateCorrectionMode|LogPath=<value>" sets the Audio connection mode, or Path of the audio logfile.

    • --vrdeproperty "Audio/RateCorrectionMode=<value>" where <value> is the desired rate correction mode, allowed values are:

      • VRDP_AUDIO_MODE_VOID - no mode specified, use to unset any Audio mode already set.

      • VRDP_AUDIO_MODE_RC - rate correction mode.

      • VRDP_AUDIO_MODE_LPF - low pass filter mode.

      • VRDP_AUDIO_MODE_CS - client sync mode to prevent under/overflow of the client queue.

    • --vrdeproperty "Audio/LogPath=<value>" where <value> is the absolute path of the Audio log file.

  • --vrdeextpack default|<name>: Allows to specify the library to use for to access the VM remotely. The default is to use the RDP code which is part of the Oracle VM VirtualBox Extension Pack.

  • --vrdeport default|<ports>: A port or a range of ports the VRDE server can bind to; "default" or "0" means port 3389, the standard port for RDP. You can specify a comma-separated list of ports or ranges of ports. Use a dash between two port numbers to specify a range. The VRDE server will bind to one of available ports from the specified list. Only one machine can use a given port at a time. For example, the option --vrdeport 5000,5010-5012 will tell the server to bind to one of following ports: 5000, 5010, 5011 or 5012.

  • --vrdeaddress <IP address>: The IP address of the host network interface the VRDE server will bind to. If specified, the server will accept connections only on the specified host network interface.

    The setting can be used to specify whether the VRDP server should accept either IPv4 or IPv6 or both connections:

    • only IPv4: --vrdeaddress "0.0.0.0"

    • only IPv6: --vrdeaddress "::"

    • both IPv6 and IPv4 (default): --vrdeaddress ""

  • --vrdeauthtype null|external|guest: This allows you to choose whether and how authorization will be performed; see Section 7.1.5, “RDP authentication” for details.

  • --vrdeauthlibrary default|<name>: This allos to set the library used for RDP authentication, see Section 7.1.5, “RDP authentication” for details.

  • --vrdemulticon on|off: This enables multiple connections to the same VRDE server, if the server supports this feature; see Section 7.1.7, “Multiple connections to the VRDP server”.

  • --vrdereusecon on|off: This specifies the VRDE server behavior when multiple connections are disabled. When this option is enabled, the server will allow a new client to connect and will drop the existing connection. When this option is disabled (this is the default setting), a new connection will not be accepted if there is already a client connected to the server.

  • --vrdevideochannel on|off: This enables video redirection, if it is supported by the VRDE server; see Section 7.1.9, “VRDP video redirection”.

  • --vrdevideochannelquality <percent>: Sets the image quality for video redirection; see Section 7.1.9, “VRDP video redirection”.

8.8.6. Teleporting settings

With the following commands for VBoxManage modifyvm you can configure a machine to be a target for teleporting. See Section 7.2, “Teleporting” for an introduction.

  • --teleporter on|off: With this setting you turn on or off whether a machine waits for a teleporting request to come in on the network when it is started. If "on", when the machine is started, it does not boot the virtual machine as it would normally; instead, it then waits for a teleporting request to come in on the port and address listed with the next two parameters.

  • --teleporterport <port>, --teleporteraddress <address>: these must be used with --teleporter and tell the virtual machine on which port and address it should listen for a teleporting request from another virtual machine. <port> can be any free TCP/IP port number (e.g. 6000); <address> can be any IP address or hostname and specifies the TCP/IP socket to bind to. The default is "0.0.0.0", which means any address.

  • --teleporterpassword <password>: if this optional argument is given, then the teleporting request will only succeed if the source machine specifies the same password as the one given with this command.

  • --teleporterpasswordfile <password>: if this optional argument is given, then the teleporting request will only succeed if the source machine specifies the same password as the one specified in the file give with this command. Use stdin to read the password from stdin.

  • --cpuid <leaf> <eax> <ebx> <ecx> <edx>: Advanced users can use this command before a teleporting operation to restrict the virtual CPU capabilities that VirtualBox presents to the guest operating system. This must be run on both the source and the target machines involved in the teleporting and will then modify what the guest sees when it executes the CPUID machine instruction. This might help with misbehaving applications that wrongly assume that certain CPU capabilities are present. The meaning of the parameters is hardware dependent; please refer to the AMD or Intel processor manuals.

8.8.7. Debugging settings

The following settings are only relevant for low-level VM debugging. Regular users will never need these settings.

  • --tracing-enabled on|off: Enable the tracebuffer. This consumes some memory for the tracebuffer and adds extra overhead.

  • --tracing-config <config-string>: Allows to configure tracing. In particular this defines which group of tracepoints are enabled.

  • --tracing-allow-vm-access on|off: Enables/disables(default) VM access to the tracebuffer.

8.8.8. USB card reader settings

The following setting defines access to a USB Card Reader by the guest environment. USB card readers are typically used for accessing data on memory cards such as CompactFlash (CF), Secure Digital (SD) or MultiMediaCard (MMC).

  • --usbcardreader on|off: Enables/disables the USB card reader interface.

8.8.9. Auto starting VMs during host system boot

These settings configure the VM autostart feature, which automatically starts the VM at host system boot-up. Note that there are pre-requisites that need to be addressed before using this feature. See Section 9.24, “Starting virtual machines during system boot” for more details.

  • --autostart on|off: Enables/disables VM autostart at host system boot-up, using specified user name.

  • --autostart-delay <seconds>: Specifies a delay (seconds) following host system boot-up, before VM autostarts.

8.9. VBoxManage clonevm

This command creates a full or linked copy of an existing virtual machine.

The clonevm subcommand takes at least the name of the virtual machine which should be cloned. The following additional settings can be used to further configure the clone VM operation:

  • --snapshot <uuid>|<name>: Select a specific snapshot where the clone operation should refer to. Default is referring to the current state.

  • --mode machine|machineandchildren|all: Selects the cloning mode of the operation. If machine is selected (the default), the current state of the VM without any snapshots is cloned. In the machineandchildren mode the snapshot provided by --snapshot and all child snapshots are cloned. If all is the selected mode all snapshots and the current state are cloned.

  • --options link|keepallmacs|keepnatmacs|keepdisknames: Allows additional fine tuning of the clone operation. The first option defines that a linked clone should be created, which is only possible for a machine clone from a snapshot. The next two options allow to define how the MAC addresses of every virtual network card should be handled. They can either be reinitialized (the default), left unchanged (keepallmacs) or left unchanged when the network type is NAT (keepnatmacs). If you add keepdisknames all new disk images are called like the original ones, otherwise they are renamed.

  • --name <name>: Select a new name for the new virtual machine. Default is "Original Name Clone".

  • --groups <group>, ... Enables the clone to be assigned membership of the specified VM groups in the list. Note that group ids always start with a / and can be nested. By default, clones are always assigned membership of the group /.

  • --basefolder <basefolder>: Select the folder where the new virtual machine configuration should be saved in.

  • --uuid <uuid>: Select the UUID the new VM should have. This id has to be unique in the VirtualBox instance this clone should be registered. Default is creating a new UUID.

  • --register: Automatically register the new clone in this VirtualBox installation. If you manually want to register the new VM later, see Section 8.6, “VBoxManage registervm / unregistervm” for instructions how to do so.

8.10. VBoxManage import

This command imports a virtual appliance in OVF format by copying the virtual disk images and creating virtual machines in VirtualBox. See Section 1.14, “Importing and exporting virtual machines” for an introduction to appliances.

The import subcommand takes at least the path name of an OVF file as input and expects the disk images, if needed, in the same directory as the OVF file. A lot of additional command-line options are supported to control in detail what is being imported and modify the import parameters, but the details depend on the content of the OVF file.

It is therefore recommended to first run the import subcommand with the --dry-run or -n option. This will then print a description of the appliance's contents to the screen how it would be imported into VirtualBox, together with the optional command-line options to influence the import behavior.

Use of the --options link|keepallmacs|keepnatmacs|keepdisknames: option enables additional fine tuning of the clone operation. The first option defines that a linked clone should be created, which is only possible for a machine clone from a snapshot. The next two options enable specification of how the MAC addresses of every virtual network card should be handled. They can either be reinitialized (the default), left unchanged (keepallmacs) or left unchanged when the network type is NAT (keepnatmacs). If you add keepdisknames all new disk images are assigned the same names as the originals, otherwise they are renamed.

As an example, here is the screen output with a sample appliance containing a Windows XP guest:

VBoxManage import WindowsXp.ovf --dry-run
Interpreting WindowsXp.ovf...
OK.
Virtual system 0:
 0: Suggested OS type: "WindowsXP"
    (change with "--vsys 0 --ostype <type>"; use "list ostypes" to list all)
 1: Suggested VM name "Windows XP Professional_1"
    (change with "--vsys 0 --仮想マシン名 <name>")
 3: Number of CPUs: 1
    (change with "--vsys 0 --cpus <n>")
 4: Guest memory: 956 MB (change with "--vsys 0 --memory <MB>")
 5: Sound card (appliance expects "ensoniq1371", can change on import)
    (disable with "--vsys 0 --unit 5 --ignore")
 6: USB controller
    (disable with "--vsys 0 --unit 6 --ignore")
 7: Network adapter: orig bridged, config 2, extra type=bridged
 8: Floppy
    (disable with "--vsys 0 --unit 8 --ignore")
 9: SCSI controller, type BusLogic
    (change with "--vsys 0 --unit 9 --scsitype {BusLogic|LsiLogic}";
    disable with "--vsys 0 --unit 9 --ignore")
10: IDE controller, type PIIX4
    (disable with "--vsys 0 --unit 10 --ignore")
11: Hard disk image: source image=WindowsXp.vmdk,
      target path=/home/user/disks/WindowsXp.vmdk, controller=9;channel=0
    (change controller with "--vsys 0 --unit 11 --controller <id>";
    disable with "--vsys 0 --unit 11 --ignore")

As you can see, the individual configuration items are numbered, and depending on their type support different command-line options. The import subcommand can be directed to ignore many such items with a --vsys X --unit Y --ignore option, where X is the number of the virtual system (zero unless there are several virtual system descriptions in the appliance) and Y the item number, as printed on the screen.

In the above example, Item #1 specifies the name of the target machine in VirtualBox. Items #9 and #10 specify hard disk controllers, respectively. Item #11 describes a hard disk image; in this case, the additional --controller option indicates which item the disk image should be connected to, with the default coming from the OVF file.

You can combine several items for the same virtual system behind the same --vsys option. For example, to import a machine as described in the OVF, but without the sound card and without the USB controller, and with the disk image connected to the IDE controller instead of the SCSI controller, use this:

VBoxManage import WindowsXp.ovf
      --vsys 0 --unit 5 --ignore --unit 6 --ignore --unit 11 --controller 10

8.11. VBoxManage export

This command exports one or more virtual machines from VirtualBox into a virtual appliance in OVF format, including copying their virtual disk images to compressed VMDK. See Section 1.14, “Importing and exporting virtual machines” for an introduction to appliances.

The export command is simple to use: list the machine (or the machines) that you would like to export to the same OVF file and specify the target OVF file after an additional --output or -o option. Note that the directory of the target OVF file will also receive the exported disk images in the compressed VMDK format (regardless of the original format) and should have enough disk space left for them.

Beside a simple export of a given virtual machine, you can append several product information to the appliance file. Use --product, --producturl, --vendor, --vendorurl, --version and --description to specify this additional information. For legal reasons you may add a license text or the content of a license file by using the --eula and --eulafile option respectively. As with OVF import, you must use the --vsys X option to direct the previously mentioned options to the correct virtual machine.

For virtualization products which aren't fully compatible with the OVF standard 1.0 you can enable a OVF 0.9 legacy mode with the --legacy09 option. Other options are --ovf09, --ovf10, --ovf20.

To specify options controlling the exact content of the appliance file, you can use --options to request the creation of a manifest file (encouraged, allows detection of corrupted appliances on import), the additional export of DVD images, and the exclusion of MAC addresses. You can specify a list of options, e.g. --options manifest,nomacs. For details, check the help output of VBoxManage export.

8.12. VBoxManage startvm

This command starts a virtual machine that is currently in the "Powered off" or "Saved" states.

The optional --type specifier determines whether the machine will be started in a window or whether the output should go through VBoxHeadless, with VRDE enabled or not; see Section 7.1.2, “VBoxHeadless, the remote desktop server” for more information. The list of types is subject to change, and it's not guaranteed that all types are accepted by any product variant.

The global or per-VM default value for the VM frontend type will be taken if the type is not explicitly specified. If none of these are set, the GUI variant will be started.

The following values are allowed:

gui

Starts a VM showing a GUI window. This is the default.

headless

Starts a VM without a window for remote display only.

sdl

Starts a VM with a minimal GUI and limited features.

separate

Starts a VM with detachable UI (technically it is a headless VM with user interface in a separate process). This is an experimental feature as it lacks certain functionality at the moment (e.g. 3D acceleration will not work).

Note

If you experience problems with starting virtual machines with particular frontends and there is no conclusive error information, consider starting virtual machines directly by running the respective front-end, as this can give additional error information.

8.13. VBoxManage controlvm

The controlvm subcommand allows you to change the state of a virtual machine that is currently running. The following can be specified:

  • VBoxManage controlvm <vm> pause temporarily puts a virtual machine on hold, without changing its state for good. The VM window will be painted in gray to indicate that the VM is currently paused. (This is equivalent to selecting the "Pause" item in the "Machine" menu of the GUI).

  • Use VBoxManage controlvm <vm> resume to undo a previous pause command. (This is equivalent to selecting the "Resume" item in the "Machine" menu of the GUI.)

  • VBoxManage controlvm <vm> reset has the same effect on a virtual machine as pressing the "Reset" button on a real computer: a cold reboot of the virtual machine, which will restart and boot the guest operating system again immediately. The state of the VM is not saved beforehand, and data may be lost. (This is equivalent to selecting the "Reset" item in the "Machine" menu of the GUI).

  • VBoxManage controlvm <vm> poweroff has the same effect on a virtual machine as pulling the power cable on a real computer. Again, the state of the VM is not saved beforehand, and data may be lost. (This is equivalent to selecting the "Close" item in the "Machine" menu of the GUI or pressing the window's close button, and then selecting "Power off the machine" in the dialog).

    After this, the VM's state will be "Powered off". From there, it can be started again; see Section 8.12, “VBoxManage startvm”.

  • VBoxManage controlvm <vm> savestate will save the current state of the VM to disk and then stop the VM. (This is equivalent to selecting the "Close" item in the "Machine" menu of the GUI or pressing the window's close button, and then selecting "Save the machine state" in the dialog.)

    After this, the VM's state will be "Saved". From there, it can be started again; see Section 8.12, “VBoxManage startvm”.

  • VBoxManage controlvm <vm> acpipowerbutton will send an ACPI shutdown signal to the VM, as if the power button on a real computer had been pressed. So long as the VM is running a fairly modern guest operating system providing ACPI support, this should trigger a proper shutdown mechanism from within the VM.

  • VBoxManage controlvm <vm> keyboardputscancode <hex> [<hex>...] Sends commands using keycodes to the VM. Keycodes are documented in the public domain, e.g. http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html.

  • VBoxManage controlvm "VM name" teleport --hostname <name> --port <port> [--passwordfile <file> | --password <password>] makes the machine the source of a teleporting operation and initiates a teleport to the given target. See Section 7.2, “Teleporting” for an introduction. If the optional password is specified, it must match the password that was given to the modifyvm command for the target machine; see Section 8.8.6, “Teleporting settings” for details.

A few extra options are available with controlvm that do not directly affect the VM's running state:

  • The setlinkstate<1-N> operation connects or disconnects virtual network cables from their network interfaces.

  • nic<1-N> null|nat|bridged|intnet|hostonly|generic|natnetwork[<devicename>]: With this, you can set, for each of the VM's virtual network cards, what type of networking should be available. They can be not connected to the host (null), use network address translation (nat), bridged networking (bridged) or communicate with other virtual machines using internal networking (intnet) or host-only networking (hostonly) or natnetwork networking (natnetwork) or access to rarely used sub-modes (generic). These options correspond to the modes which are described in detail in Section 6.2, “Introduction to networking modes”.

  • With the "nictrace" options, you can optionally trace network traffic by dumping it to a file, for debugging purposes.

    With nictrace<1-N> on|off, you can enable network tracing for a particular virtual network card.

    If enabled, you must specify with --nictracefile<1-N> <ファイル名> what file the trace should be logged to.

  • nicpromisc<1-N> deny|allow-vms|allow-all: This allows you, for each of the VM's virtual network cards, to specify how the promiscious mode is handled. This setting is only relevant for bridged networking. deny (default setting) hides any traffic not intended for this VM. allow-vms hides all host traffic from this VM but allows the VM to see traffic from/to other VMs. allow-all removes this restriction completely.

  • nicproperty<1-N> <paramname>="paramvalue": This option, in combination with "nicgenericdrv" allows you to pass parameters to rarely-used network backends.

    Those parameters are backend engine-specific, and are different between UDP Tunnel and the VDE backend drivers. For example, please see Section 6.8, “UDP Tunnel networking”.

  • natpf<1-N> [<name>],tcp|udp,[<hostip>],<hostport>,[<guestip>], <guestport>: This option defines a NAT port-forwarding rule (please see Section 6.3.1, “Configuring port forwarding with NAT” for details).

  • natpf<1-N> delete <name>: This option deletes a NAT port-forwarding rule (please see Section 6.3.1, “Configuring port forwarding with NAT” for details).

  • The guestmemoryballoon<balloon size in MB> operation changes the size of the guest memory balloon, that is, memory allocated by the VirtualBox Guest Additions from the guest operating system and returned to the hypervisor for re-use by other virtual machines. This must be specified in megabytes. For details, see Section 4.9.1, “Memory ballooning”.

  • usbattach<uuid|address> [--capturefile <ファイル名>]

    and usbdetach <uuid|address> [--capturefile <ファイル名>] make host USB devices visible/invisible to the virtual machine on the fly, without the need for creating filters first. The USB devices can be specified by UUID (unique identifier) or by address on the host system. Use the --capturefile option to specify the absolute path of a file for writing activity logging data.

    You can use VBoxManage list usbhost to locate this information.

  • clipboard disabled|hosttoguest|guesttohost|bidirectional: With this setting, you can select if and how the guest or host operating system's clipboard should be shared with the host or guest; see Section 3.3, “General settings”. This requires that the Guest Additions be installed in the virtual machine.

  • draganddrop disabled|hosttoguest|guesttohost|bidirectional: With this setting, you can select the current drag and drop mode being used between the host and the virtual machine; see Section 4.4, “Drag and Drop”. This requires that the Guest Additions be installed in the virtual machine.

  • vrde on|off lets you enable or disable the VRDE server, if it is installed.

  • vrdeport default|<ports> changes the port or a range of ports that the VRDE server can bind to; "default" or "0" means port 3389, the standard port for RDP. For details, see the description for the --vrdeport option in Section 8.8.5, “Remote machine settings”.

  • vrdeproperty "TCP/Ports|Address=<value>" sets the port number(s) and IP address on the VM that the VRDE server can bind to.

    • For TCP/Ports, <value> should be a port or a range of ports that the VRDE server can bind to; "default" or "0" means port 3389, the standard port for RDP. For details, see the description for the --vrdeport option in Section 8.8.5, “Remote machine settings”.

    • For TCP/Address, <value> should be the IP address of the host network interface that the VRDE server will bind to. If specified, the server will accept connections only on the specified host network interface. For details, see the description for the --vrdeaddress option in Section 8.8.5, “Remote machine settings”.

  • vrdeproperty "VideoChannel/Enabled|Quality|DownscaleProtection=<value>" sets the VRDP video redirection properties.

    • For VideoChannel/Enabled, <value> can be set to "1" switching the VRDP video channel on. For details, see Section 7.1.9, “VRDP video redirection”.

    • For VideoChannel/Quality, <value> should be set between 10 and 100% inclusive, representing a JPEG compression level on the VRDE server video channel. Lower values mean lower quality but higher compression. For details, see Section 7.1.9, “VRDP video redirection”.

    • For VideoChannel/DownscaleProtection, <value> can be set to "1" to enable the videochannel downscale protection feature. When enabled, if a video's size equals the shadow buffer size, then it is regarded as a full screen video, and is displayed; but if its size is between fullscreen and the downscale threshold - it is NOT displayed, as it could be an application window, which would be unreadable when downscaled. When the downscale protection feature is disabled, an attempt is always made to display videos.

  • vrdeproperty "Client/DisableDisplay|DisableInput|DisableAudio|DisableUSB=1"

    disables one of the VRDE server features: Display, Input, Audio or USB respectively. To re-enable a feature, use e.g. "Client/DisableDisplay=". For details, see Section 7.1.10, “VRDP customization”.

  • vrdeproperty "Client/DisableClipboard|DisableUpstreamAudio=1"

    disables one of the VRDE server features: Clipboard or UpstreamAudio respectively. To re-enable a feature, use e.g. "Client/DisableClipboard=". For details, see Section 7.1.10, “VRDP customization”.

  • vrdeproperty "Client/DisableRDPDR=1"

    disables the VRDE server feature: RDP device redirection for smart cards. To re-enable this feature, use "Client/DisableRDPR=".

  • vrdeproperty "H3DRedirect/Enabled=1"

    enables the VRDE server feature: 3D redirection. To re-disable this feature, use "H3DRedirect/Enabled=".

  • vrdeproperty "Security/Method|ServerCertificate|ServerPrivateKey|CACertificate=<value>" sets the desired security method/Path of server certificate, path of server private key, path of CA certificate, used for a connection.

    • vrdeproperty "Security/Method=<value>" sets the desired security method, which is used for a connection. Valid values are:

      • Negotiate - both Enhanced (TLS) and Standard RDP Security connections are allowed. The security method is negotiated with the client. This is the default setting.

      • RDP - only Standard RDP Security is accepted.

      • TLS - only Enhanced RDP Security is accepted. The client must support TLS.

      For details, see Section 7.1.6, “RDP encryption”.

    • vrdeproperty "Security/ServerCertificate=<value>" where <value> is the absolute path of the server certificate. For details, see Section 7.1.6, “RDP encryption”.

    • vrdeproperty "Security/ServerPrivateKey=<value>" where <value> is the absolute path of the server private key. For details, see Section 7.1.6, “RDP encryption”.

    • vrdeproperty "Security/CACertificate=<value>" where <value> is the absolute path of the CA self signed certificate. For details, see Section 7.1.6, “RDP encryption”.

  • vrdeproperty "Audio/RateCorrectionMode|LogPath=<value>" sets the Audio connection mode, or Path of the audio logfile.

    • vrdeproperty "Audio/RateCorrectionMode=<value>" where <value> is the desired rate correction mode, allowed values are:

      • VRDP_AUDIO_MODE_VOID - no mode specified, use to unset any Audio mode already set.

      • VRDP_AUDIO_MODE_RC - rate correction mode.

      • VRDP_AUDIO_MODE_LPF - low pass filter mode.

      • VRDP_AUDIO_MODE_CS - client sync mode to prevent under/overflow of the client queue.

    • vrdeproperty "Audio/LogPath=<value>" where <value> is the absolute path of the Audio log file.

  • vrdevideochannelquality <percent>: Sets the image quality for video redirection; see Section 7.1.9, “VRDP video redirection”.

  • setvideomodehint requests that the guest system change to a particular video mode. This requires that the Guest Additions be installed, and will not work for all guest systems.

  • screenshotpng takes a screenshot of the guest display and saves it in PNG format.

  • videocap on|off enables or disables recording a VM session into a WebM/VP8 file.

  • videocapscreens all|<screen ID> [<screen ID> ...]] allows to specify which screens of the VM are being recorded. This setting cannot be changed while video capturing is enabled. Each screen is recorded into a separate file.

  • videocapfile <file> sets the ファイル名 VirtualBox uses to save the recorded content. This setting cannot be changed while video capturing is enabled.

  • videocapres <width> <height> sets the resolution (in pixels) of the recorded video. This setting cannot be changed while video capturing is enabled.

  • videocaprate <rate> sets the bitrate in kilobits (kb) per second. Increasing this value makes the video look better for the cost of an increased file size. This setting cannot be changed while video capturing is enabled.

  • videocapfps <fps> sets the maximum number of frames per second (FPS) to be recorded. Frames with a higher frequency will be skipped. Reducing this value increases the number of skipped frames and reduces the file size. This setting cannot be changed while video capturing is enabled.

  • videocapmaxtime <ms> sets the maximum time in milliseconds the video capturing will be enabled since activation. The capturing stops when the defined time interval has elapsed. If this value is zero the capturing is not limited by time. This setting cannot be changed while video capturing is enabled.

  • videocapmaxsize <MB> limits the maximum size of the captured video file (in MB). The capturing stops when the file size has reached the specified size. If this value is zero the capturing will not be limited by file size. This setting cannot be changed while video capturing is enabled.

  • videocapopts <key=value>[,<key=value> ...] can be used to specify additional video capturing options. These options only are for advanced users and must be specified in a comma-separated key=value format, e.g. foo=bar,a=b. This setting cannot be changed while video capturing is enabled.

  • The setcredentials operation is used for remote logons in Windows guests. For details, please refer to Section 9.2, “Automated guest logons”.

  • teleport --host <name> --port <port> can be used to configure a VM as a target for teleporting. <name> specifies the virtual machine name. <port> specifies the port on the virtual machine which should listen for a teleporting request from another virtual machine. It can be any free TCP/IP port number (e.g. 6000); See Section 7.2, “Teleporting” for an introduction.

    • --maxdowntime <msec>: Optional - specifies the maximum downtime (milliseconds) for the teleporting target VM.

    • --password <password>: Optional - indicates that the teleporting request will only succeed if the source machine specifies the same password as the one given with this command.

    • --passwordfile <password file>: Optional - indicates that the teleporting request will only succeed if the source machine specifies the same password as the one specified in the file given with this command. Use stdin to read the password from stdin.

  • plugcpu|unplugcpu <id>: If CPU hot-plugging is enabled, this adds a virtual CPU to the virtual machines (or removes one). <id> specifies the index of the virtual CPU to be added or removed and must be a number from 0 to the maximum no. of CPUs configured. CPU 0 can never be removed.

  • The cpuexecutioncap <1-100>: This operation controls how much cpu time a virtual CPU can use. A value of 50 implies a single virtual CPU can use up to 50% of a single host CPU.

  • webcam attach <path|alias> [<key=value>[;<key=value>...]]: This operation attaches a webcam to a running VM. Specify the absolute path of the webcam on the host operating system, or use its alias (obtained by using the command: VBoxManage list webcams).

    Note that alias '.0' means default video input device on the host operating system, '.1', '.2', etc. mean first, second, etc. video input device. The device order is host-specific.

    The optional settings parameter is a ';' delimited list of name/value pairs, enabling configuration of the emulated webcam device.

    The following settings are supported:

    MaxFramerate (default no maximum limit) - this specifies the highest rate (frames/sec) at which video frames are sent to the guest. Higher frame rates increase CPU load, so this setting can be useful when there is a need to reduce CPU load. Its default 'value' is 'no maximum limit', thus enabling the guest to use all frame rates supported by the host webcam.

    MaxPayloadTransferSize (default 3060 bytes) - this specifies the maximum number of bytes the emulated webcam can send to the guest in one buffer. The default is used by some webcams. Higher values can slightly reduce CPU load, if the guest is able to use larger buffers. Note that higher MaxPayloadTransferSize values may be not supported by some guest operating systems.

  • webcam detach <path|alias>: This operation detaches a webcam from a running VM. Specify the absolute path of the webcam on the host, or use its alias (obtained from webcam list below).

    Note the points below relating to specific Host Operating Systems:

    Windows hosts

    When the webcam device is detached from the host, the emulated webcam device is automatically detached from the guest.

    Mac OS X hosts

    OS X version 10.7 or newer is required.

    When the webcam device is detached from the host, the emulated webcam device remains attached to the guest and must be manually detached using the VBoxManage controlvm "VM name" webcam detach command.

    Linux hosts

    When the webcam is detached from the host, the emulated webcam device is automatically detached from the guest only if the webcam is streaming video. If the emulated webcam is inactive, it should be manually detached using the VBoxManage controlvm "VM name" webcam detach command.

  • webcam list: This operation lists webcams attached to the running VM. The output is a list of absolute paths or aliases that were used for attaching the webcams to the VM using the 'webcam attach' command above.

  • addencpassword <id> <password file>|- [--removeonsuspend <yes|no>]: This operation supplies an encrypted VM specified by <id> with the encryption password to enable a headless start. Either specify the absolute path of a password file on the host file system: <password file>, or use a '-' to instruct VBoxManage to prompt the user for the encryption password.

    --removeonsuspend <yes|no> specifies whether to remove/keep the password from/in VM memory when the VM is suspended. If the VM has been suspended and the password has been removed, the user needs to resupply the password before the VM can be resumed. This feature is useful in cases where the user doesn't want the password to be stored in VM memory, and the VM is suspended by a host suspend event.

    Note: On VirtualBox versions 5.0 and later, data stored on hard disk images can be transparently encrypted for the guest. VirtualBox uses the AES algorithm in XTS mode and supports 128 or 256 bit data encryption keys (DEK). The DEK is stored encrypted in the medium properties, and is decrypted during VM startup by supplying the encryption password.

    The "VBoxManage encryptmedium" operation is used to create a DEK encrypted medium. See Section 9.31.2, “Encrypting disk images” for details. When starting an encrypted VM from a VirtualBox GUI app, the user will be prompted for the encryption password.

    For a headless encrypted VM start, use:

    VBoxManage startvm "仮想マシン名" --type headless

    followed by:

    VBoxManage "仮想マシン名" controlvm "仮想マシン名" addencpassword ...

    to supply the encryption password required.

  • removeencpassword <id>: This operation removes encryption password authorization for password <id> for all encrypted media attached to the VM.

  • removeallencpasswords: This operation removes encryption password authorization for all passwords for all encrypted media attached to the VM.

8.14. VBoxManage discardstate

This command discards the saved state of a virtual machine which is not currently running, which will cause its operating system to restart next time you start it. This is the equivalent of pulling out the power cable on a physical machine, and should be avoided if possible.

8.15. VBoxManage adoptstate

If you have a saved state file (.sav) that is separate from the VM configuration, you can use this command to "adopt" the file. This will change the VM to saved state and when you start it, VirtualBox will attempt to restore it from the saved state file you indicated. This command should only be used in special setups.

8.16. VBoxManage snapshot

This command is used to control snapshots from the command line. A snapshot consists of a complete copy of the virtual machine settings, copied at the time when the snapshot was taken, and optionally a virtual machine saved state file if the snapshot was taken while the machine was running. After a snapshot has been taken, VirtualBox creates differencing hard disk for each normal hard disk associated with the machine so that when a snapshot is restored, the contents of the virtual machine's virtual hard disks can be quickly reset by simply dropping the pre-existing differencing files.

VBoxManage snapshot         <uuid|仮想マシン名>
                            take <name> [--description <desc>] [--live]
                                 [--uniquename Number,Timestamp,Space,Force] |
                            delete <uuid|snapname> |
                            restore <uuid|snapname> |
                            restorecurrent |
                            edit <uuid|snapname>|--current
                                 [--name <name>]
                                 [--description <desc>] |
                            list [--details|--machinereadable]
                            showvminfo <uuid|snapname>

The take operation takes a snapshot of the current state of the virtual machine. You must supply a name for the snapshot and can optionally supply a description. The new snapshot is inserted into the snapshots tree as a child of the current snapshot and then becomes the new current snapshot. The --description parameter allows to describe the snapshot. If --live is specified, the VM will not be stopped during the snapshot creation (live snapshotting).

The delete operation deletes a snapshot (specified by name or by UUID). This can take a while to finish since the differencing images associated with the snapshot might need to be merged with their child differencing images.

The restore operation will restore the given snapshot (specified by name or by UUID) by resetting the virtual machine's settings and current state to that of the snapshot. The previous current state of the machine will be lost. After this, the given snapshot becomes the new "current" snapshot so that subsequent snapshots are inserted under the snapshot from which was restored.

The restorecurrent operation is a shortcut to restore the current snapshot (i.e. the snapshot from which the current state is derived). This subcommand is equivalent to using the "restore" subcommand with the name or UUID of the current snapshot, except that it avoids the extra step of determining that name or UUID.

With the edit operation, you can change the name or description of an existing snapshot.

The list operation shows all snapshots of a virtual machine.

With the showvminfo operation, you can view the virtual machine settings that were stored with an existing snapshot.

8.17. VBoxManage closemedium

This commands removes a hard disk, DVD or floppy image from a VirtualBox media registry.[38]

VBoxManage closemedium      [disk|dvd|floppy] <uuid|ファイル名>
                            [--delete]

Optionally, you can request that the image be deleted. You will get appropriate diagnostics that the deletion failed, however the image will become unregistered in any case.

8.18. VBoxManage storageattach

This command attaches/modifies/removes a storage medium connected to a storage controller that was previously added with the storagectl command (see the previous section). The syntax is as follows:

VBoxManage storageattach    <uuid|仮想マシン名>
                            --storagectl <name>
                            [--port <number>]
                            [--device <number>]
                            [--type dvddrive|hdd|fdd]
                            [--medium none|emptydrive|additions|
                                      <uuid>|<ファイル名>|host:<drive>|iscsi]
                            [--mtype normal|writethrough|immutable|shareable
                                     readonly|multiattach]
                            [--comment <text>]
                            [--setuuid <uuid>]
                            [--setparentuuid <uuid>]
                            [--passthrough on|off]
                            [--tempeject on|off]
                            [--nonrotational on|off]
                            [--discard on|off]
                            [--hotpluggable on|off]
                            [--bandwidthgroup name|none]
                            [--forceunmount]
                            [--server <name>|<ip>]
                            [--target <target>]
                            [--tport <port>]
                            [--lun <lun>]
                            [--encodedlun <lun>]
                            [--username <username>]
                            [--password <password>]
                            [--initiator <initiator>]
                            [--intnet]

A number of parameters are commonly required; the ones at the end of the list are required only for iSCSI targets (see below).

The common parameters are:

uuid|仮想マシン名

The VM UUID or VM Name. Mandatory.

--storagectl

Name of the storage controller. Mandatory. The list of the storage controllers currently attached to a VM can be obtained with VBoxManage showvminfo; see Section 8.5, “VBoxManage showvminfo”.

--port

The number of the storage controller's port which is to be modified. Mandatory, unless the storage controller has only a single port.

--device

The number of the port's device which is to be modified. Mandatory, unless the storage controller has only a single device per port.

--type

Define the type of the drive to which the medium is being attached/detached/modified. This argument can only be omitted if the type of medium can be determined from either the medium given with the --medium argument or from a previous medium attachment.

--medium

Specifies what is to be attached. The following values are supported:

  • "none": Any existing device should be removed from the given slot.

  • "emptydrive": For a virtual DVD or floppy drive only, this makes the device slot behaves like a removeable drive into which no media has been inserted.

  • "additions": For a virtual DVD drive only, this attaches the VirtualBox Guest Additions image to the given device slot.

  • If a UUID is specified, it must be the UUID of a storage medium that is already known to VirtualBox (e.g. because it has been attached to another virtual machine). See Section 8.4, “VBoxManage list” for how to list known media. This medium is then attached to the given device slot.

  • If a ファイル名 is specified, it must be the full path of an existing disk image (ISO, RAW, VDI, VMDK or other), which is then attached to the given device slot.

  • "host:<drive>": For a virtual DVD or floppy drive only, this connects the given device slot to the specified DVD or floppy drive on the host computer.

  • "iscsi": For virtual hard disks only, this allows for specifying an iSCSI target. In this case, more parameters must be given; see below.

Some of the above changes, in particular for removeable media (floppies and CDs/DVDs), can be effected while a VM is running. Others (device changes or changes in hard disk device slots) require the VM to be powered off.

--mtype

Defines how this medium behaves with respect to snapshots and write operations. See Section 5.4, “Special image write modes” for details.

--comment

Any description that you want to have stored with this medium (optional; for example, for an iSCSI target, "Big storage server downstairs"). This is purely descriptive and not needed for the medium to function correctly.

--setuuid, --setparentuuid

Modifies the UUID or parent UUID of a medium before attaching it to a VM. This is an expert option. Inappropriate use can make the medium unusable or lead to broken VM configurations if any other VM is referring to the same media already. The most frequently used variant is --setuuid "", which assigns a new (random) UUID to an image. This is useful to resolve the duplicate UUID errors if one duplicated an image using file copy utilities.

--passthrough

For a virtual DVD drive only, you can enable DVD writing support (currently experimental; see Section 5.9, “CD/DVD support”).

--tempeject

For a virtual DVD drive only, you can configure the behavior for guest-triggered medium eject. If this is set to "on", the eject has only temporary effects. If the VM is powered off and restarted the originally configured medium will be still in the drive.

--nonrotational

This switch allows to enable the non-rotational flag for virtual hard disks. Some guests (i.e. Windows 7+) treat such disks like SSDs and don't perform disk fragmentation on such media.

--discard

This switch enables the auto-discard feature for the virtual hard disks. This specifies that a VDI image will be shrunk in response to the trim command from the guest OS. The following requirements must be met:

  • The disk format must be VDI.

  • The size of the cleared area must be at least 1MB.

  • VirtualBox will only trim whole 1MB blocks. The VDIs themselves are organized into 1MB blocks, so this will only work if the space being TRIM-med is at least a 1MB contiguous block at a 1MB boundary. On Windows, occasional defrag (with "defrag.exe /D"), or under Linux running "btrfs filesystem defrag" as a background cron job may be beneficial.

Notes: the Guest OS must be configured to issue trim command, and typically this means that the guest OS is made to 'see' the disk as an SSD. Ext4 supports -o discard mount flag; OSX probably requires additional settings. Windows ought to automatically detect and support SSDs - at least in versions 7, 8 and 10. Linux exFAT driver (courtesy of Samsung) supports the trim command.

It is unclear whether Microsoft's implementation of exFAT supports this feature, even though that file system was originally designed for flash.

Alternatively, there are ad hoc methods to issue trim, e.g. Linux fstrim command, part of util-linux package. Earlier solutions required a user to zero out unused areas, e.g. using zerofree, and explicitly compact the disk - only possible when the VM is offline.

--bandwidthgroup

Sets the bandwidth group to use for the given device; see Section 5.8, “Limiting bandwidth for disk images”.

--forceunmount

For a virtual DVD or floppy drive only, this forcibly unmounts the DVD/CD/Floppy or mounts a new DVD/CD/Floppy even if the previous one is locked down by the guest for reading. Again, see Section 5.9, “CD/DVD support” for details.

When "iscsi" is used with the --medium parameter for iSCSI support -- see Section 5.10, “iSCSI servers” --, additional parameters must or can be used:

--server

The host name or IP address of the iSCSI target; required.

--target

Target name string. This is determined by the iSCSI target and used to identify the storage resource; required.

--tport

TCP/IP port number of the iSCSI service on the target (optional).

--lun

Logical Unit Number of the target resource (optional). Often, this value is zero.

--encodedlun

Hex encoded Logical Unit Number of the target resource (optional). Often, this value is zero.

--username, --password

Username and password (initiator secret) for target authentication, if required (optional).

Note

Username and password are stored without encryption (i.e. in clear text) in the XML machine configuration file if no settings password is provided. When a settings password was specified the first time, the password is stored encrypted.

--initiator

iSCSI Initiator (optional). Note:

Microsoft iSCSI Initiator is a system, such as a server that attaches to an IP network and initiates requests and receives responses from an iSCSI target. The SAN components in Microsoft iSCSI Initiator are largely analogous to Fibre Channel SAN components, and they include the following:/

To transport blocks of iSCSI commands over the IP network, an iSCSI driver must be installed on the iSCSI host. An iSCSI driver is included with Microsoft iSCSI Initiator.

A gigabit Ethernet adapter that transmits 1000 megabits per second (Mbps) is recommended for the connection to an iSCSI target. Like standard 10/100 adapters, most gigabit adapters use a preexisting Category 5 or Category 6E cable that. Each port on the adapter is identified by a unique IP address.

An iSCSI target is any device that receives iSCSI commands. The device can be an end node, such as a storage device, or it can be an intermediate device, such as a network bridge between IP and Fibre Channel devices. Each port on the storage array controller or network bridge is identified by one or more IP addresses

--intnet

If specified, connect to the iSCSI target via Internal Networking. This needs further configuration which is described in Section 9.9.3, “Access iSCSI targets via Internal Networking”.

8.19. VBoxManage storagectl

This command attaches/modifies/removes a storage controller. After this, virtual media can be attached to the controller with the storageattach command (see the next section).

The syntax is as follows:

VBoxManage storagectl       <uuid|仮想マシン名>
                            --name <name>
                            [--add ide|sata|scsi|floppy|sas|usb|pcie]
                            [--controller LSILogic|LSILogicSAS|BusLogic|
                                          IntelAhci|PIIX3|PIIX4|ICH6|I82078|
                                          USB|NVMe]
                            [--portcount <1-30>]
                            [--hostiocache on|off]
                            [--bootable on|off]
                            [--rename <name>]
                            [--remove]

where the parameters mean:

uuid|仮想マシン名

The VM UUID or VM Name. Mandatory.

--name

Name of the storage controller. Mandatory.

--add

Define the type of the system bus to which the storage controller must be connected.

--controller

Allows to choose the type of chipset being emulated for the given storage controller.

--portcount

This determines how many ports the storage controller should support.

--hostiocache

Configures the use of the host I/O cache for all disk images attached to this storage controller. For details, please see Section 5.7, “Host I/O caching”.

--bootable

Selects whether this controller is bootable.

--rename

Sets the name of the storage controller.

--remove

Removes the storage controller from the VM config.

8.20. VBoxManage bandwidthctl

This command creates/deletes/modifies/shows bandwidth groups of the given virtual machine:

VBoxManage bandwidthctl    <uuid|仮想マシン名>
                           add <name> --type disk|network --limit <megabytes per second>[k|m|g|K|M|G] |
                           set <name> --limit <megabytes per second>[k|m|g|K|M|G] |
                           remove <name> |
                           list [--machinereadable]

The following subcommands are available:

  • add, creates a new bandwidth group of given type.

  • set, modifies the limit for an existing bandwidth group.

  • remove, destroys a bandwidth group.

  • list, shows all bandwidth groups defined for the given VM. Use --machinereadable option to produce the same output, but in machine readable format. This is of the form: name="value" on a line by line basis.

The parameters mean:

uuid|仮想マシン名

The VM UUID or VM Name. Mandatory.

--name

Name of the bandwidth group. Mandatory.

--type

Type of the bandwidth group. Mandatory. Two types are supported: disk and network. See Section 5.8, “Limiting bandwidth for disk images” or Section 6.10, “Limiting bandwidth for network I/O” for a description of a particular type.

--limit

Specifies the limit for the given group. Can be changed while the VM is running. The default unit is megabytes per second. The unit can be changed by specifying one of the following suffixes: k for kilobits/s, m for megabits/s, g for gigabits/s, K for kilobytes/s, M for megabytes/s, G for gigabytes/s.

Note

The network bandwidth limits apply only to the traffic being sent by virtual machines. The traffic being received by VMs is unlimited.

Note

To remove a bandwidth group it must not be referenced by any disks or adapters in running VM.

8.21. VBoxManage showmediuminfo

This command shows information about a medium, notably its size, its size on disk, its type and the virtual machines which use it.

Note

For compatibility with earlier versions of VirtualBox, the "showvdiinfo" command is also supported and mapped internally to the "showmediuminfo" command.

VBoxManage showmediuminfo     [disk|dvd|floppy] <uuid|ファイル名>

The medium must be specified either by its UUID (if the medium is registered) or by its ファイル名. Registered images can be listed by VBoxManage list hdds, VBoxManage list dvds, or VBoxManage list floppies, as appropriate. (see Section 8.4, “VBoxManage list” for more information).

8.22. VBoxManage createhd

This command creates a new medium. The syntax is as follows:

VBoxManage createmedium     [disk|dvd|floppy]    --ファイル名 <ファイル名>
                            [--size <megabytes>|--sizebyte <bytes>]
                            [--diffparent <uuid>|<ファイル名>
                            [--format VDI|VMDK|VHD] (default: VDI)
                            [--variant Standard,Fixed,Split2G,Stream,ESX]

where the parameters mean:

--ファイル名 <ファイル名>

Specifies a file name <ファイル名> as an absolute path on the host file system.. Mandatory.

--size <megabytes>

<megabytes> Specifies the image capacity, in 1 MB units. Optional.

--diffparent <uuid>|<ファイル名>

Specifies the differencing image parent, either as a UUID or by the absolute pathname of the file on the host file system. Useful for sharing a base box disk image among several VMs.

--format VDI|VMDK|VHD

Specifies the file format for the output file. Available options are VDI, VMDK, VHD. Default is VDI. Optional.

--variant Standard,Fixed,Split2G,Stream,ESX

Specifies any required file format variant(s) for the output file. It is a comma-separated list of variant flags. Not all combinations are supported, and specifying mutually incompatible flags results in an error message. Optional.

Note

For compatibility with earlier versions of VirtualBox, the "createvdi" command is also supported and mapped internally to the "createmedium" command.

8.23. VBoxManage modifymedium

With the modifymediumを使うと、作成したディスクイメージの属性を変更することができます。

VBoxManage modifymedium  [disk|dvd|floppy]    <uuid|ファイル名>
                         [--type normal|writethrough|immutable|shareable|
                                 readonly|multiattach]
                         [--autoreset on|off]
                         [--property <name=[値]>]
                         [--compact]
                         [--resize <MB単位でのサイズ値>|--resizebyte <バイト単位でのサイズ値>]
                         [--move <移動先のフルパス>

過去のバージョンとの互換性のため、「modifyvdi」コマンドと「modifyhd」コマンドも使えるようになっています。これらコマンドは内部で「modifymedium」コマンドに読み替えて処理されます。

変更を行うディスクのイメージはUUID(メディアが既にVirtualBoxに登録されている場合)またはファイル名で指定します。登録されているイメージの一覧は VBoxManage list hddsコマンド(詳しくは8.4節 “VBoxManage list”参照)で確認できます。 ファイル名は有効なパスで指定します。パスは絶対パスまたはカレントディレクトリからの相対パスで指定します。

以下のオプションが使えます。

  • --typeの引数を指定することにより、 既存のイメージのタイプを、通常、不変、ライトスルーなどの間で変換できます。 詳しくは5.4節 “特別なイメージ書き込みモード”を参照してください。

  • 不変(差分)ハードディスクのみ、--autoreset on|offオプションを利用でき、仮想マシン起動時に内容を自動で初期化するかどうかを設定できます(再掲しますが、詳しくは5.4節 “特別なイメージ書き込みモード”を参照してください)。初期値は「on」(初期化する)です。

  • --compactオプションを使うと、 ディスクイメージを圧縮することができます。例えば、ゼロだけを含むブロックを除去します。これによりサイズを動的に割り当てるよう設定されたイメージを再び小さくすることができます。仮想ディスクの論理サイズに影響を与えることなく、物理的なイメージのサイズを小さくすることができるのです。 この圧縮操作は基本イメージにもスナップショットの一部として作成された差分イメージにも適用できます。

    この操作を効果的に行うために、適切なソフトウェアツールを使いゼロで埋めたフリースペースをゲストシステムに作っておく必要があります。 Windowsゲストの場合、マイクロソフト社から提供されているsdeleteツールが使えます。 仮想ディスクイメージを圧縮する前にゲストでsdelete -zを実行し、空いたディスクスペースをゼロで埋めてください。 Linuxゲストの場合、ext2/ext3ファイルシステムに対して使える zerofreeユーティリティを使ってください。 Mac OS Xゲストの場合、端末から特権モード(rootユーザ権限)でdiskutil secureErase freespace 0 /コマンドを実行してください。

    圧縮操作が可能なのは今のところVDIイメージのみです。 A similar effect can be achieved by zeroing out free blocks and then cloning the disk to any other dynamically allocated format. You can use this workaround until compacting is also supported for disk formats other than VDI.

  • The --resize x option (where x is the desired new total space in megabytes) allows you to change the capacity of an existing image; this adjusts the logical size of a virtual disk without affecting the physical size much.[39] This currently works only for VDI and VHD formats, and only for the dynamically allocated variants, and can only be used to expand (not shrink) the capacity. For example, if you originally created a 10G disk which is now full, you can use the --resize 15360 command to change the capacity to 15G (15,360MB) without having to create a new image and copy all data from within a virtual machine. Note however that this only changes the drive capacity; you will typically next need to use a partition management tool inside the guest to adjust the main partition to fill the drive.

    The --resizebyte x option does almost the same thing, except that x is expressed in bytes instead of megabytes.

  • The --move <dest> option can be used to move an image to a different location <dest> on the host file system, specified by either the relative path to the current directory or absolute path.

8.24. VBoxManage clonemedium

このコマンドは仮想ディスク/DVD/フロッピーメディアを新たなUUIDで新規メディア(通常はイメージファイル)に複製します。 新規イメージは他のホストのシステムに転送したり、仮想メディアマネージャーを使って再びVirtualBoxに取り込んだりすることができます。 5.3節 “仮想メディアマネージャー”5.6節 “ディスクイメージの複製”もご覧ください。

VBoxManage clonemedium      [disk|dvd|floppy] <uuid|入力ファイル> <uuid|出力ファイル>

                            [--format VDI|VMDK|VHD|RAW|<その他>]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
			    [--existing]

複製元メディアだけではなく複製先となるイメージもUUID(メディアが登録済みである場合)やファイル名で指定する必要があります。 登録済みイメージの一覧はVBoxManage list hddsで確認できます(詳しくは8.4節 “VBoxManage list”をご覧ください)。 ファイル名は絶対パスまたはカレントディレクトリからの相対パスによる有効なパスで指定する必要があります。

以下のオプションが指定できます:

--format

出力ファイルのフォーマットとして、入力ファイルとは異なるフォーマットを指定できます。

--variant

出力ファイルのファイルフォーマットの変形を指定します。変形フラグはコンマで区切って指定します。すべての組み合わせが使える訳ではなく、使えない組み合わせを指定した場合はエラーメッセージを表示して終了します。

--existing

既存の対象メディアに対して複製を実行します。複製元メディアのうち複製先メディアに適合する部分のみが複製されます。これは複製先メディアが複製元メディアよりも小さいと一部分しかコピーされないことを、複製先の方が大きいとメディアの残り部分は変更されないことを意味します。

注意

以前のバージョンのVirtualBoxとの互換性のため、「clonevdi」コマンドも「clonehd」コマンドも使えるようになっています。内部的には「clonehd disk」コマンドに読み替えています。

8.25. VBoxManage mediumproperty

This command sets up, gets or deletes a medium property. The syntax is as follows:

VBoxManage mediumproperty [disk|dvd|floppy] set <uuid|ファイル名> 
                                                <property> <value>
  • Use <disk|dvd|floppy> to optionally specify the type of medium: disk (hard drive), dvd or floppy.

  • Use <uuid|ファイル名> to supply either the uuid or absolute path of the medium/image to be encrypted.

  • Use <property> to supply the name of the property.

  • Use <value> to supply the property value.

VBoxManage mediumproperty [disk|dvd|floppy] get <uuid|ファイル名> 
                                                <property>
  • Use <disk|dvd|floppy> to optionally specify the type of medium: disk (hard drive), dvd or floppy.

  • Use <uuid|ファイル名> to supply either the uuid or absolute path of the medium/image to be encrypted.

  • Use <property> to supply the name of the property.

VBoxManage mediumproperty [disk|dvd|floppy] delete <uuid|ファイル名> 
                                                   <property>
  • Use <disk|dvd|floppy> to optionally specify the type of medium: disk (hard drive), dvd or floppy.

  • Use <uuid|ファイル名> to supply either the uuid or absolute path of the medium/image.

  • Use <property> to supply the name of the property.

8.26. VBoxManage encryptmedium

This command is used to create a DEK encrypted medium/image. See Section 9.31.2, “Encrypting disk images”" for details.

The syntax is as follows:

VBoxManage encryptmedium <uuid|ファイル名> 
                         [--newpassword <file|->]
                         [--oldpassword <file|->]
                         [--cipher <cipher id>]
                         [--newpasswordid <password id>]
  • use <uuid|ファイル名> to supply the uuid or absolute path of the medium/image to be encrypted.

  • Use --newpassword <file|-> to supply a new encryption password; either specify the absolute pathname of a password file on the host operating system, or - to prompt you for the password on the command line. Always use the --newpasswordid option with this option.

  • use --oldpassword <file|-> to supply any old encryption password; either specify the absolute pathname of a password file on the host operating system, or - to prompt you for the old password on the command line.

    Use this option to gain access to an encrypted medium/image to change its password using --newpassword and/or change its encryption using --cipher.

  • Use --cipher <cipher> to specify the cipher to use for encryption; this can be either AES-XTS128-PLAIN64 or AES-AXTS256-PLAIN64.

    Use this option to change any existing encryption on the medium/image, or setup new encryption on it for the 1st time.

  • Use --newpasswordid <password id> to supply the new password identifier. This can be freely chosen by the user, and is used for correct identification when supplying multiple passwords during VM startup.

    If the user uses the same password when encrypting multiple images and also the same password identifier, the user needs to supply the password only once during VM startup.

8.27. VBoxManage checkmediumpwd

This command is used to check the current encryption password on a DEK encrypted medium/image. See Section 9.31.2, “Encrypting disk images”" for details.

The syntax is as follows:

VBoxManage checkmediumpwd <uuid|ファイル名> 
                                      <pwd file|->
  • Use <uuid|ファイル名> to supply the uuid or absolute path of the medium/image to be checked.

  • Use <pwd file|-> to supply the password identifier to be checked. Either specify the absolute pathname of a password file on the host operating system, or - to prompt you for the password on the command line.

8.28. VBoxManage convertfromraw

This command converts a raw disk image to a VirtualBox Disk Image (VDI) file. The syntax is as follows:

VBoxManage convertfromraw   <ファイル名> <outputfile>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--uuid <uuid>]
VBoxManage convertfromraw   stdin <outputfile> <bytes>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--uuid <uuid>]

where the parameters mean:

--bytes

The size of the image file, in bytes, provided through stdin.

--format

Select the disk image format to create. Default is VDI. Other options are VMDK and VHD.

--variant

Allow to choose a file format variant for the output file. It is a comma-separated list of variant flags. Not all combinations are supported, and specifying inconsistent flags will result in an error message.

--uuid

Allow to specifiy the UUID of the output file.

The second form forces VBoxManage to read the content for the disk image from standard input (useful for using that command in a pipe).

Note

For compatibility with earlier versions of VirtualBox, the "convertdd" command is also supported and mapped internally to the "convertfromraw" command.

8.29. VBoxManage getextradata/setextradata

These commands let you attach and retrieve string data to a virtual machine or to a VirtualBox configuration (by specifying global instead of a virtual machine name). You must specify a key (as a text string) to associate the data with, which you can later use to retrieve it. For example:

VBoxManage setextradata Fedora5 installdate 2006.01.01
VBoxManage setextradata SUSE10 installdate 2006.02.02

would associate the string "2006.01.01" with the key installdate for the virtual machine Fedora5, and "2006.02.02" on the machine SUSE10. You could retrieve the information as follows:

VBoxManage getextradata Fedora5 installdate

which would return

VirtualBox Command Line Management Interface Version 5.1.22
(C) 2005-2017 Oracle Corporation
All rights reserved.

Value: 2006.01.01

You could retrieve the information for all keys as follows:

VBoxManage getextradata Fedora5 enumerate

To remove a key, the setextradata command must be run without specifying data (only the key), for example:

VBoxManage setextradata Fedora5 installdate

8.30. VBoxManage setproperty

This command is used to change global settings which affect the entire VirtualBox installation. Some of these correspond to the settings in the "Global settings" dialog in the graphical user interface. The following properties are available:

machinefolder

This specifies the default folder in which virtual machine definitions are kept; see Section 10.1, “Where VirtualBox stores its files” for details.

hwvirtexclusive

This specifies whether VirtualBox will make exclusive use of the hardware virtualization extensions (Intel VT-x or AMD-V) of the host system's processor; see Section 10.3, “Hardware vs. software virtualization”. If you wish to share these extensions with other hypervisors running at the same time, you must disable this setting. Doing so has negative performance implications.

vrdeauthlibrary

This specifies which library to use when "external" authentication has been selected for a particular virtual machine; see Section 7.1.5, “RDP authentication” for details.

websrvauthlibrary

This specifies which library the web service uses to authenticate users. For details about the VirtualBox web service, please refer to the separate VirtualBox SDK reference (see Chapter 11, VirtualBox programming interfaces).

vrdeextpack

This specifies which library implements the VirtualBox Remote Desktop Extension.

loghistorycount

This selects how many rotated (old) VM logs are kept.

autostartdbpath

This selects the path to the autostart database. See Section 9.24, “Starting virtual machines during system boot”.

defaultfrontend

This selects the global default VM frontend setting. See Section 8.12, “VBoxManage startvm”.

logginglevel

This configures the VBoxSVC release logging details.[40]

8.31. VBoxManage usbfilter add/modify/remove

VBoxManage usbfilter        add <index,0-N>
                          --target <uuid|仮想マシン名>global
                          --name <string>
                          --action ignore|hold (global filters only)
                         [--active yes|no (yes)]
                         [--vendorid <XXXX> (null)]
                         [--productid <XXXX> (null)]
                         [--revision <IIFF> (null)]
                         [--manufacturer <string> (null)]
                         [--product <string> (null)]
                         [--remote yes|no (null, VM filters only)]
                         [--serialnumber <string> (null)]
                         [--maskedinterfaces <XXXXXXXX>]
    
VBoxManage usbfilter        modify <index,0-N>
                          --target <uuid|仮想マシン名>global
                         [--name <string>]
                         [--action ignore|hold (global filters only)]
                         [--active yes|no]
                         [--vendorid <XXXX>]
                         [--productid <XXXX>]
                         [--revision <IIFF>]
                         [--manufacturer <string>]
                         [--product <string>]
                         [--remote yes|no (null, VM filters only)]
                         [--serialnumber <string>]
                         [--maskedinterfaces <XXXXXXXX>]
    
VBoxManage usbfilter        remove <index,0-N>
                          --target <uuid|仮想マシン名>global
    

The usbfilter commands are used for working with USB filters in virtual machines, or global filters which affect the whole VirtualBox setup. Global filters are applied before machine-specific filters, and may be used to prevent devices from being captured by any virtual machine. Global filters are always applied in a particular order, and only the first filter which fits a device is applied. So for example, if the first global filter says to hold (make available) a particular Kingston memory stick device and the second to ignore all Kingston devices, that memory stick will be available to any machine with an appropriate filter, but no other Kingston device will.

When creating a USB filter using usbfilter add, you must supply three or four mandatory parameters. The index specifies the position in the list at which the filter should be placed. If there is already a filter at that position, then it and the following ones will be shifted back one place. Otherwise the new filter will be added onto the end of the list. The target parameter selects the virtual machine that the filter should be attached to or use "global" to apply it to all virtual machines. name is a name for the new filter and for global filters, action says whether to allow VMs access to devices that fit the filter description ("hold") or not to give them access ("ignore"). In addition, you should specify parameters to filter by. You can find the parameters for devices attached to your system using VBoxManage list usbhost. Finally, you can specify whether the filter should be active, and for local filters, whether they are for local devices, remote (over an RDP connection) or either.

When you modify a USB filter using usbfilter modify, you must specify the filter by index (see the output of VBoxManage list usbfilters to find global filter indexes and that of VBoxManage showvminfo to find indexes for individual machines) and by target, which is either a virtual machine or "global". The properties which can be changed are the same as for usbfilter add. To remove a filter, use usbfilter remove and specify the index and the target.

The following is a list of the additional usbfilter add and usbfilter modify options, with detailed explanations on how to use them.

  • --action ignore|holdSpecifies whether devices that fit the filter description are allowed access by machines ("hold"), or have access denied ("ignore"). Applies to global filters only.

  • --active yes|noSpecifies whether the USB Filter is active or temporarily disabled. For usbfilter create the default is active.

  • --vendorid <XXXX>|""Specifies a vendor ID filter - the string representation for the exact matching has the form XXXX, where X is the hex digit (including leading zeroes).

  • --productid <XXXX>|""Specifies a product ID filter - The string representation for the exact matching has the form XXXX, where X is the hex digit (including leading zeroes).

  • --revision <IIFF>|""Specifies a revision ID filter - the string representation for the exact matching has the form IIFF, where I is the decimal digit of the integer part of the revision, and F is the decimal digit of its fractional part (including leading and trailing zeros). Note that for interval filters, it's best to use the hex form, because the revision is stored as a 16 bit packed BCD value; so the expression int:0x0100-0x0199 will match any revision from 1.0 to 1.99 inclusive.

  • --manufacturer <string>|""Specifies a manufacturer ID filter, as a string.

  • --product <string>|""Specifies a product ID filter, as a string.

  • --remote yes|no""Specifies a remote filter - indicating whether the device is physically connected to a remote VRDE client or to a local host machine. Applies to VM filters only.

  • --serialnumber <string>|""Specifies a serial number filter, as a string.

  • --maskedinterfaces <XXXXXXXX>Specifies a masked interface filter, for hiding one or more USB interfaces from the guest. The value is a bit mask where the set bits correspond to the USB interfaces that should be hidden, or masked off. This feature only works on Linux hosts.

8.32. VBoxManage sharedfolder add/remove

VBoxManage sharedfolder     add <uuid|仮想マシン名>
                                --name <name> --hostpath <hostpath>
                                [--transient] [--readonly] [--automount]
	

このコマンドによりホストコンピュータの共有フォルダをゲストオペレーションシステムで共有することができます。この機能を使うには、この機能を提供するのに必要となるVirtualBox Guest Additionsをゲストシステムにインストールしておく必要があります。

Parameters are:

  • <uuid|仮想マシン名> Specifies the UUID or name of the VM whose guest operating system will be sharing folders with the host computer. Mandatory.

  • --name <name> Specifies the name of the share. Each share has a unique name within the namespace of the host operating system. Mandatory.

  • -hostpath <hostpath> Specifies the absolute path on the host operating system of the folder/directory to be shared with the guest operating system. Mandatory.

  • -transient Specifies that the share is 'transient', meaning that it can be added and removed at runtime and does not persist after the VM has stopped. Optional.

  • -readonly Specifies that the share has only read-only access to files at the host path.

    By default, shared folders have read/write access to the files at the host path. More specifically, on Linux distros - shared folders are mounted with 770 io permissions with root user and vboxsf as the group, and using this option the io permissions change to 700. Optional.

  • -automount Specifies that the share will be automatically mounted. On Linux distros, this will be to either /media/USER/sf_<name> or /media/sf_<name> - depending on your guest OS. Where <name> is the share name. Optional.

VBoxManage sharedfolder     remove <uuid|仮想マシン名>
                            --name <name> [--transient]

This command allows you to delete shared folders on the host computer shares with the guest operating systems. For this, the guest systems must have a version of the VirtualBox Guest Additions installed which supports this functionality.

Parameters are:

  • <uuid|仮想マシン名> Specifies the UUID or name of the VM whose guest operating system is sharing folders with the host computer. Mandatory.

  • --name <name> Specifies the name of the share to be removed. Each share has a unique name within the namespace of the host operating system. Mandatory.

  • -transient Specifies that the share is 'transient', meaning that it can be added and removed at runtime and does not persist after the VM has stopped. Optional.

共有フォルダについて詳しくは4.3.節 共有フォルダに記しています。

8.33. VBoxManage guestproperty

The "guestproperty" commands allow you to get or set properties of a running virtual machine. Please see Section 4.7, “Guest properties” for an introduction. As explained there, guest properties are arbitrary key/value string pairs which can be written to and read from by either the guest or the host, so they can be used as a low-volume communication channel for strings, provided that a guest is running and has the Guest Additions installed. In addition, a number of values whose keys begin with "/VirtualBox/" are automatically set and maintained by the Guest Additions.

The following subcommands are available (where <vm>, in each case, can either be a VM name or a VM UUID, as with the other VBoxManage commands):

  • enumerate <vm> [--patterns <pattern>]: This lists all the guest properties that are available for the given VM, including the value. This list will be very limited if the guest's service process cannot be contacted, e.g. because the VM is not running or the Guest Additions are not installed.

    If --patterns <pattern> is specified, it acts as a filter to only list properties that match the given pattern. The pattern can contain the following wildcard characters:

    • * (asterisk): represents any number of characters; for example, "/VirtualBox*" would match all properties beginning with "/VirtualBox".

    • ? (question mark): represents a single arbitrary character; for example, "fo?" would match both "foo" and "for".

    • | (pipe symbol): can be used to specify multiple alternative patterns; for example, "s*|t*" would match anything starting with either "s" or "t".

  • get <vm> <property> : This retrieves the value of a single property only. If the property cannot be found (e.g. because the guest is not running), this will print

    No value set!
  • set <vm> <property> [<value> [--flags <flags>]]: This allows you to set a guest property by specifying the key and value. If <value> is omitted, the property is deleted. With --flags you can optionally specify additional behavior (you can combine several by separating them with commas):

    • TRANSIENT: the value will not be stored with the VM data when the VM exits;

    • TRANSRESET: the value will be deleted as soon as the VM restarts and/or exits;

    • RDONLYGUEST: the value can only be changed by the host, but the guest can only read it;

    • RDONLYHOST: reversely, the value can only be changed by the guest, but the host can only read it;

    • READONLY: a combination of the two, the value cannot be changed at all.

  • wait <vm> <pattern> --timeout <timeout>: This waits for a particular value described by "pattern" to change or to be deleted or created. The pattern rules are the same as for the "enumerate" subcommand above.

  • delete <vm> <property> : Deletes a formerly set guest property.

8.34. VBoxManage guestcontrol

The guestcontrol commands enable control of the guest from the host. Please see Section 4.8, “Guest control” for an introduction.

guestcontrol has two sets of subcommands. The first set requires guest credentials to be specified, the second does not.

The first set of subcommands is of the form:

VBoxManage guestcontrol <uuid|仮想マシン名> <sub-command>
            [--username <name> ]
            [--passwordfile <file> | --password <password>]
            [--domain <domain> ]
            [-v|--verbose] [-q|quiet] ...
    

The "common-options" are:

           [--username <name> ]
           [--passwordfile <file> | --password <password>]
           [--domain <domain> ]
           [-v|--verbose] [-q|quiet] 
    

Where details of the common options for the first set of subcommands are:

<uuid|仮想マシン名>

Specifies the VM UUID or VM name. Mandatory.

--username <name>

Specifies the user name on guest OS under which the process should run. This user name must already exist on the guest OS. If unspecified, the host user name is used. Optional

--passwordfile <file>|--password

Specifies the absolute path on guest file system of password file containing the password for the specified user account or password for the specified user account. Optional. If both are omitted, empty password is assumed.

--domain <domain>

User domain for Windows guests. Optional.

-v|--verbose

Makes the subcommand execution more verbose. Optional

-q|--quiet

Makes the subcommand execution quieter. Optional.

The first set of subcommands:

  • run Executes a guest program - forwarding stdout, stderr and stdin to/from the host until it completes.

    VBoxManage guestcontrol <uuid|仮想マシン名> run [common-options]
                --exe <path to executable> [--timeout <msec>]
               [-E|--putenv <NAME>[=<VALUE>]] [--unquoted-args]
               [--ignore-operhaned-processes] [--profile]
               [--no-wait-stdout|--wait-stdout]
               [--no-wait-stderr|--wait-stderr]
               [--dos2unix] [--unix2dos]
                -- <program/arg0> [argument1] ... [argumentN]]
              
    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    --exe <path to executable>

    Specifies the absolute path of the executable on the guest OS file system. Mandatory. e.g.: C:\Windows\System32\calc.exe.

    --timeout <msec>

    Specifies the maximum time (microseconds) that the executable can run, during which VBoxManage receives its output. Optional. If unspecified, VBoxManage waits indefinitely for the process to end, or an error occurs.

    -E|--putenv <NAME>=<VALUE>

    Sets/modifies/unsets environment variable(s) in the environment in which the program will run. Optional.

    The guest process is created with the standard default guest OS environment. Use this option to modify that default environment. To set/modify a variable use: <NAME>=<VALUE>. To unset a variable use: <NAME>=

    Any spaces in names/values should be enclosed by quotes.

    To set/modify/unset multiple variables, use multiple instances of the --E|--putenv option.

    --unquoted-args

    Disables escaped double quoting (e.g. \"fred\") on arguments passed to the executed program. Optional.

    --ignore-operhaned-processes

    Ignore orphaned processes. Not yet implemented. Optional.

    --profile

    Use Profile. Not yet implemented. Optional.

    --no-wait-stdout|--wait-stdout

    Does not wait/waits until the guest process ends and receives its exit code and reason/flags. In the case of --wait-stdout - while the process runs, VBoxManage receives its stdout. Optional.

    --no-wait-stderr|--wait-stderr

    Does not wait/waits until the guest process ends and receives its exit code and reason/flags. In case of --wait-stderr - while the process runs, VBoxManage receives its stderr. Optional.

    --dos2unix

    Converts output from DOS/Windows guests to UNIX/Linux-compatible line endings (CR + LF → LF). Not yet implemented. Optional.

    --unix2dos

    Converts output from a UNIX/Linux guests to DOS/Windows-compatible line endings (LF → CR + LF). Not yet implemented. Optional.

    [-- <program/arg0> [<argument1>] ... [<argumentN>]]

    Specifies program name, followed by one or more arguments to pass to the program. Optional.

    Note: Any spaces in arguments should be enclosed by quotes.

    Note

    On Windows there are certain limitations for graphical applications; please see Chapter 14, Known limitations for more information.

    Examples:

    VBoxManage --nologo guestcontrol "My VM" execute --image "/bin/ls"
              --username foo --passwordfile bar.txt --wait-exit --wait-stdout -- -l /usr

    VBoxManage --nologo guestcontrol "My VM" execute --image "c:\\windows\\system32\\ipconfig.exe"
              --username foo --passwordfile bar.txt --wait-exit --wait-stdout

    Note that the double backslashes in the second example are only required on Unix hosts.

    Note

    For certain commands a user name of an existing user account on the guest must be specified; anonymous executions are not supported for security reasons. A user account password, however, is optional and depends on the guest's OS security policy or rules. If no password is specified for a given user name, an empty password will be used. On certain OSes like Windows the security policy may needs to be adjusted in order to allow user accounts with an empty password set. Also, global domain rules might apply and therefore cannot be changed.

    Starting at VirtualBox 4.1.2 guest process execution by default is limited to serve up to 5 guest processes at a time. If a new guest process gets started which would exceed this limit, the oldest not running guest process will be discarded in order to be able to run that new process. Also, retrieving output from this old guest process will not be possible anymore then. If all 5 guest processes are still active and running, starting a new guest process will result in an appropriate error message.

    To raise or lower the guest process execution limit, either the guest property /VirtualBox/GuestAdd/VBoxService/--control-procs-max-kept or VBoxService' command line by specifying --control-procs-max-kept needs to be modified. A restart of the guest OS is required afterwards. To serve unlimited guest processes, a value of 0 needs to be set (not recommended).

  • start Executes a guest program until it completes.

    VBoxManage guestcontrol <uuid|仮想マシン名> start [common-options]
               [--exe <path to executable>] [--timeout <msec>]
               [-E|--putenv <NAME>[=<VALUE>]] [--unquoted-args]
               [--ignore-operhaned-processes] [--profile]
                -- <program/arg0> [argument1] ... [argumentN]]
              

    Where the options are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    --exe <path to executable>

    Specifies the absolute path of the executable on the guest OS file system. Mandatory. e.g.: C:\Windows\System32\calc.exe

    --timeout <msec>

    Specifies the maximum time (microseconds) that the executable can run. Optional. If unspecified, VBoxManage waits indefinitely for the process to end, or an error occurs.

    -E|--putenv <NAME>=<VALUE>

    Sets/modifies/unsets environment variable(s) in the environment in which the program will run. Optional.

    The guest process is created with the standard default guest OS environment. Use this option to modify that default environment. To set/modify a variable use: <NAME>=<VALUE>. To unset a variable use: <NAME>=

    Any spaces in names/values should be enclosed by quotes.

    To set/modify/unset multiple variables, use multiple instances of the --E|--putenv option.

    --unquoted-args

    Disables escaped double quoting (e.g. \"fred\") on arguments passed to the executed program. Optional.

    --ignore-operhaned-processes

    Ignores orphaned processes. Not yet implemented. Optional.

    --profile

    Use a profile. Not yet implemented. Optional.

    [-- <program/arg0> [<argument1>] ... [<argumentN>]]

    Specifies program name, followed by one or more arguments to pass to the program. Optional.

    Note: Any spaces in arguments should be enclosed by quotes.

    Note

    On Windows there are certain limitations for graphical applications; please see Chapter 14, Known limitations for more information.

    Examples:

    VBoxManage --nologo guestcontrol "My VM" execute --image "/bin/ls"
              --username foo --passwordfile bar.txt --wait-exit --wait-stdout -- -l /usr

    VBoxManage --nologo guestcontrol "My VM" execute --image "c:\\windows\\system32\\ipconfig.exe"
              --username foo --passwordfile bar.txt --wait-exit --wait-stdout

    Note that the double backslashes in the second example are only required on Unix hosts.

    Note

    For certain commands a user name of an existing user account on the guest must be specified; anonymous executions are not supported for security reasons. A user account password, however, is optional and depends on the guest's OS security policy or rules. If no password is specified for a given user name, an empty password will be used. On certain OSes like Windows the security policy may needs to be adjusted in order to allow user accounts with an empty password set. Also, global domain rules might apply and therefore cannot be changed.

    Starting at VirtualBox 4.1.2 guest process execution by default is limited to serve up to 5 guest processes at a time. If a new guest process gets started which would exceed this limit, the oldest not running guest process will be discarded in order to be able to run that new process. Also, retrieving output from this old guest process will not be possible anymore then. If all 5 guest processes are still active and running, starting a new guest process will result in an appropriate error message.

    To raise or lower the guest process execution limit, either the guest property /VirtualBox/GuestAdd/VBoxService/--control-procs-max-kept or VBoxService' command line by specifying --control-procs-max-kept needs to be modified. A restart of the guest OS is required afterwards. To serve unlimited guest processes, a value of 0 needs to be set (not recommended).

  • copyfrom Copies files from the guest to the host file system. (Note - only with Guest Additions 4.0 or later installed).

    VBoxManage guestcontrol <uuid|仮想マシン名> copyfrom [common-options]
               [--dryrun] [--follow] [--R|recursive]
                --target-directory <host-dst-dir>
                <guest-src0> [<guest-src1> [...]] 

    Where the parameters are:

    <uid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    --dryrun

    Instructs VBoxManage to perform a dry run instead of an actual file copying operation. Optional.

    --follow

    Enables symlink following on the guest file system. Optional.

    -R|--recursive

    Enables recursive copying of files/directories from the specified guest file system directory. Optional.

    --target-directory <host-dst-dir>

    Specifies the absolute path of the host file system destination directory. Mandatory. e.g. C:\Temp.

    <guest-src0> [<guest-src1> [...]]

    Specifies the absolute path(s) of guest file system file(s) to be copied. Mandatory. e.g. C:\Windows\System32\calc.exe. Wildcards can be used in the expression(s), e.g. C:\Windows\System*\*.dll.

  • copyto Copies files from the host to the guest file system. (Note - only with Guest Additions 4.0 or later installed).

    VBoxManage guestcontrol <uuid|仮想マシン名> copyto [common-options]
               [--dryrun] [--follow] [--R|recursive]
                --target-directory <guest-dst>
                <host-src0> [<host-src1> [...]] 

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    --dryrun

    Instructs VBoxManage to perform a dry run instead of an actual file copying operation. Optional.

    --follow

    Enables symlink following on the host file system. Optional.

    -R|--recursive

    Enables recursive copying of files/directories from the specified host file system directory(ies). Optional.

    --target-directory <guest-dst>

    Specifies the absolute path of the guest file system destination directory. Mandatory. e.g. C:\Temp.

    <host-src0> [<host-src1> [...]]

    Specifies the absolute path(s) of host file system file(s) to be copied. Mandatory. e.g. C:\Windows\System32\calc.exe. Wildcards can be used in the expression(s), e.g. C:\Windows\System*\*.dll.

  • md|mkdir|createdir|createdirectory Creates one or more directory(ies) on the guest file system. (Note - only with Guest Additions 4.0 or later installed).

    VBoxManage guestcontrol <uuid|仮想マシン名>  md|mkdir|createdir|createdirectory [common-options]
                [--parents] [--mode <mode>]
                <guest-dir0> [<guest-dir1> [...]] 

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    --parents

    Creates any absent parent directory(ies) of the specified directory. Optional.

    e.g. If specified directory is D:\Foo\Bar and D:\Foo is absent, it will be created. In such a case, had the --parents option not been used, this command would have failed.

    --mode <mode>

    Specifies the permission mode on the specified directory(ies) (and any parents, where --parents option used). Currently octal modes (e.g. 0755) only are supported.

    <guest-dir0> [<guest-dir1> [...]]

    Specifies list of absolute path(s) of directory(ies) to be created on guest file system. Mandatory. e.g. D:\Foo\Bar.

    All parent directories must already exist unless switch --parents used. (e.g. in the above example D:\Foo). The specified user must have sufficient rights to create the specified directory(ies), and any parents that need to be created.

  • rmdir|removedir|removedirectory Deletes specified guest file system directories. (Only with installed Guest Additions 4.3.2 and later).

    VBoxManage guestcontrol <uuid|仮想マシン名> rmdir|removedir|removedirectory [common-options]
               [--recursive|-R]
                <guest-dir0> [<guest-dir1> [...]]
              

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    --recursive

    Recursively removes directories and contents. Optional.

    <guest-dir0> [<guest-dir1> [...]]

    Specifies list of the absolute path(s) of directory(ies) to be deleted on guest file system. Mandatory. Wildcards are allowed. e.g. D:\Foo\*Bar. The specified user must have sufficient rights to delete the specified directory(ies).

  • rm|removefile Deletes specified files on the guest file system. (Only with installed Guest Additions 4.3.2 and later).

    VBoxManage guestcontrol <uuid|仮想マシン名> rm|removefile [common-options]
               [-f|--force]
                <guest-file0> [<guest-file1> [...]] 

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    -f|--force

    Enforce operation (override any requests for confirmations). Optional.

    <guest-file0> [<guest-file1> [...]]

    Specifies list of absolute path(s) of file(s) to be deleted on guest file system. Mandatory. Wildcards are allowed. e.g. D:\Foo\Bar\text*.txt. The specified user should have sufficient rights to delete the specified file(s).

  • mv|move|ren|rename This subcommand renames file(s) and/or directory(ies) on the guest file system. (Only with installed Guest Additions 4.3.2 and later).

    VBoxManage guestcontrol <uuid|仮想マシン名> mv|move|ren|rename [common-options]
               <guest-source0> [<guest-source1> [...]] <guest-dest>

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    <guest-source0> [<guest-source1> [...]]

    Specifies absolute path(s) of file(s) and/or single directory to be moved/renamed on guest file system. Mandatory. Wildcards are allowed in file names(s). The specified user should have sufficient rights to access the specified file(s).

    <dest>

    Specifies the absolute path of the destination file/directory to which the file(s) are to be moved. Mandatory. If only one file to be moved, <dest> can be file or directory, else it must be a directory. The specified user must have sufficient rights to access the destination file/directory.

  • mktemp|createtemp|createtemporary Creates a temporary file/directory on the guest file system, to assist subsequent copying of files from the host to the guest file systems. By default, the file/directory is created in the guest's platform specific temp directory. Not currently supported. (Only with installed Guest Additions 4.2 and later).

    VBoxManage guestcontrol <uuid|仮想マシン名> mktemp|createtemp|createtemporary [common-options]
               [--directory] [--secure] [--mode <mode>] [--tmpdir <directory>]
                <template> 
                

    The parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    --directory

    Creates a temporary directory instead of a file, specified by the <template> parameter. Optional.

    --secure

    Enforces secure file/directory creation. Optional. The permission mode is set to 0755. Operation fails if it cannot be performed securely.

    --mode <mode>

    Specifies the permission mode of the specified directory. Optional. Currently only octal modes (e.g. 0755) are supported.

    --tmpdir <directory>

    Specifies the absolute path of the directory on the guest file system into which the file/directory specified in will be created. Optional. If unspecified, the platform-specific temp directory is used.

    <template>

    Specifies a file name without a directory path, containing at least one sequence comprising three consecutive 'X' characters, or ending in 'X'. Mandatory.

  • stat Displays file or file system status(es) on the guest.

    VBoxManage guestcontrol <uuid|仮想マシン名> stat [common-options]
               <file0> [<file1> [...]]

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    <file0> [<file1> [...]]

    Specifies absolute path(s) of file(s) and/or file system(s) on guest file system. Mandatory. e.g. /home/foo/a.out. The specified user should have sufficient rights to access the specified file(s)/file system(s).

The second set of subcommands is of the form:

VBoxManage guestcontrol <uuid|仮想マシン名> <sub-command>
           [-v|--verbose] [-q|quiet] ...
    

The "common-options" are:

            [-v|--verbose] [-q|--quiet] 
    

Where details of the common options for the second set of subcommands are:

-v|--verbose

Makes the sub-command execution more verbose. Optional.

-q|--quiet

Makes the sub-command execution quieter. Optional.

The second set of subcommands:

  • list Lists guest control configuration and status data, e.g. open guest sessions, guest processes and files.

    VBoxManage guestcontrol <uuid|仮想マシン名> list [common-opts]
               <all|sessions|processes|files> 

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    all|sessions|processes|files

    Indicates whether to list all available data or guest sessions, processes or files. Mandatory.

  • closeprocess Terminates guest processes specified by PID(s))running in guest session(s), specified by the session ID or name(s).

    VBoxManage guestcontrol <uuid|仮想マシン名> closeprocess [common-options]
               --session-id <ID> | --session-name <name or pattern>
               <PID0> [<PID1> [...]] 

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    --session-id <ID>

    Specifies the guest session by its ID. Optional.

    --session-name <name or pattern>

    Specifies the guest session by its name, or multiple sessions using a pattern containing wildcards. Optional.

    <PID0> [<PID1> [...]]

    Specifies a list of process identifiers (PIDs) of guest processes to be terminated. Mandatory.

  • closesession Closes specified guest sessions, specified either by session ID or name.

    VBoxManage guestcontrol <uuid|仮想マシン名> closesession [common-options]
               --session-id <ID> | --session-name <name or pattern> | --all 

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    --session-id <ID>

    Specifies the guest session to be closed by ID. Optional.

    --session-name <name or pattern>

    Specifies the guest session to be closed by name. Optional. Multiple sessions can be specified by using a pattern containing wildcards.

    --all

    Close all guest sessions. Optional.

  • updatega|updateadditions|updateguestadditions Ugrades Guest Additions already installed on the guest. (Only already installed Guest Additions 4.0 and later).

    VBoxManage guestcontrol <uuid|仮想マシン名> updatega|updateadditions|updateguestadditions [common-options]
               [--source <New .ISO path>]
               [--wait-start] 
               [-- <argument0> [<argument1> [...]]]

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

    --source <New .ISO path>

    Specifies the absolute path on guest file system of the .ISO file for Guest Additions update. Mandatory.

    --wait-start

    Indicates that VBoxManage starts the usual updating process on the guest and then waits until the actual Guest Additions updating begins, at which point VBoxManage self-terminates. Optional.

    Default behavior is that VBoxManage waits for completion of the Guest Additions update before terminating. Use of this option is sometimes necessary, as a running VBoxManage can affect the interaction between the installer and the guest OS.

    [-- <argument0> [<argument1> [...]]]

    Specifies optional command line arguments to be supplied to the Guest Additions updater. Useful for retrofitting features which are not currently installed.

    Arguments containing spaces should be enclosed by quotes.

  • watch This subcommand prints current guest control activity.

    VBoxManage guestcontrol <uuid|仮想マシン名> watch [common-options]
              

    Where the parameters are:

    <uuid|仮想マシン名>

    Specifies the VM UUID or VM name. Mandatory.

8.35. VBoxManage metrics

This command supports monitoring the usage of system resources. Resources are represented by various metrics associated with the host system or a particular VM. For example, the host system has a CPU/Load/User metric that shows the percentage of time CPUs spend executing in user mode over a specific sampling period.

Metric data is collected and retained internally; it may be retrieved at any time with the VBoxManage metrics query subcommand. The data is available as long as the background VBoxSVC process is alive. That process terminates shortly after all VMs and frontends have been closed.

By default no metrics are collected at all. Metrics collection does not start until VBoxManage metrics setup is invoked with a proper sampling interval and the number of metrics to be retained. The interval is measured in seconds. For example, to enable collecting the host processor and memory usage metrics every second and keeping the 5 most current samples, the following command can be used:

VBoxManage metrics setup --period 1 --samples 5 host CPU/Load,RAM/Usage

Metric collection can only be enabled for started VMs. Collected data and collection settings for a particular VM will disappear as soon as it shuts down. Use VBoxManage metrics list subcommand to see which metrics are currently available. You can also use --list option with any subcommand that modifies metric settings to find out which metrics were affected.

Note that the VBoxManage metrics setup subcommand discards all samples that may have been previously collected for the specified set of objects and metrics.

To enable or disable metrics collection without discarding the data VBoxManage metrics enable and VBoxManage metrics disable subcommands can be used. Note that these subcommands expect metrics, not submetrics, like CPU/Load or RAM/Usage as parameters. In other words enabling CPU/Load/User while disabling CPU/Load/Kernel is not supported.

The host and VMs have different sets of associated metrics. Available metrics can be listed with VBoxManage metrics list subcommand.

A complete metric name may include an aggregate function. The name has the following form: Category/Metric[/SubMetric][:aggregate]. For example, RAM/Usage/Free:min stands for the minimum amount of available memory over all retained data if applied to the host object.

Subcommands may apply to all objects and metrics or can be limited to one object or/and a list of metrics. If no objects or metrics are given in the parameters, the subcommands will apply to all available metrics of all objects. You may use an asterisk ("*") to explicitly specify that the command should be applied to all objects or metrics. Use "host" as the object name to limit the scope of the command to host-related metrics. To limit the scope to a subset of metrics, use a metric list with names separated by commas.

For example, to query metric data on the CPU time spent in user and kernel modes by the virtual machine named "test", you can use the following command:

VBoxManage metrics query test CPU/Load/User,CPU/Load/Kernel

The following list summarizes the available subcommands:

list

This subcommand shows the parameters of the currently existing metrics. Note that VM-specific metrics are only available when a particular VM is running.

setup

This subcommand sets the interval between taking two samples of metric data and the number of samples retained internally. The retained data is available for displaying with the query subcommand. The --list option shows which metrics have been modified as the result of the command execution.

enable

This subcommand "resumes" data collection after it has been stopped with disable subcommand. Note that specifying submetrics as parameters will not enable underlying metrics. Use --list to find out if the command did what was expected.

disable

This subcommand "suspends" data collection without affecting collection parameters or collected data. Note that specifying submetrics as parameters will not disable underlying metrics. Use --list to find out if the command did what was expected.

query

This subcommand retrieves and displays the currently retained metric data.

Note

The query subcommand does not remove or "flush" retained data. If you query often enough you will see how old samples are gradually being "phased out" by new samples.

collect

This subcommand sets the interval between taking two samples of metric data and the number of samples retained internally. The collected data is displayed periodically until Ctrl-C is pressed unless the --detach option is specified. With the --detach option, this subcommand operates the same way as setup does. The --list option shows which metrics match the specified filter.

8.36. VBoxManage natnetwork

NAT networks use the Network Address Translation (NAT) service - which works in a similar way to a home router. It groups systems using it into a network and prevents outside systems from directly accessing those inside, while letting systems inside communicate with each other and outside systems using TCP and UDP over IPv4 and IPv6.

A NAT service is attached to an internal network. Virtual machines to make use of one should be attached to it. The name of an internal network is chosen when the NAT service is created, and the internal network will be created if it does not already exist. An example command to create a NAT network:

VBoxManage natnetwork add --netname natnet1 --network "192.168.15.0/24" --enable

Here, "natnet1" is the name of the internal network to be used and "192.168.15.0/24" is the network address and mask of the NAT service interface. By default, in this static configuration - the gateway will be assigned the address 192.168.15.1 (the address after the interface address), though this is subject to change.

To add a DHCP server to the NAT network after creation:

VBoxManage natnetwork modify --netname natnet1 --dhcp on

Below are the subcommands for VBoxManage natnetwork

VBoxManage natnetwork add --netname <name>
                         [--network <network>]
                         [--enable|--disable]
                         [--dhcp on|off]
                         [--port-forward-4 <rule>]
                         [--loopback-4 <rule>]
                         [--ipv6 on|off]
                         [--port-forward-6 <rule>]
                         [--loopback-6 <rule>]
    

VBoxManage natnetwork add Creates a new internal network interface, and adds a NAT network service. This command is a prerequisite for enabling attachment of VMs to the NAT network. Parameters:

--netname <name>

Where <name> is the name of the new internal network interface on the host OS.

--network <network>

Where <network> specifies the static(default)/DHCP network address and mask of the NAT service interface.

--enable|--disable

Enables/disables the NAT network service.

--dhcp on|off

Enables/disables DHCP server specified by --netname; its use also indicates that it is a DHCP server.

--port-forward-4 <rule>

Enables IPv4 port forwarding, rule specified by <rule>.

--loopback-4 <rule>

Enables IPv4 loopback interface, rule specified by <rule>.

--ipv6 on|off

Enables/disables IPv6 (default is IPv4, disables gives IPv4).

--port-forward-6 <rule>

Enables IPv6 port forwarding, rule specified by <rule>.

--loopback-6 <rule>

Enables IPv6 loopback interface, rule specified by <rule>.

VBoxManage natnetwork remove --netname <name> 

VBoxManage natnetwork remove Removes a NAT network service, parameters:

--netname <name>

Where <name> specifies an existing NAT network service. Does not remove any DHCP server enabled on the network.

VBoxManage natnetwork modify --netname <name>
                            [--network <network>]
                            [--enable|--disable]
                            [--dhcp on|off]
                            [--port-forward-4 <rule>]
                            [--loopback-4 <rule>]
                            [--ipv6 on|off]
                            [--port-forward-6 <rule>]
                            [--loopback-6 <rule>]
    

VBoxManage natnetwork modify Modifies an existing NAT network service, parameters:

--netname <name>

Where <name> specifies an existing NAT network service.

--network <network>

Where <network> specifies the new static(default)/DHCP network address and mask of the NAT service interface.

--enable|--disable

Enables/disables the NAT network service.

--dhcp on|off

Enables (and if absent, adds)/disables (if any) DHCP server.

--port-forward-4 <rule>

Enables IPv4 port forwarding, rule specified by <rule>.

--loopback-4 <rule>

Enables IPv4 loopback interface, rule specified by <rule>.

--ipv6 on|off

Enables/disables IPv6 (default is IPv4, disables gives IPv4).

--port-forward-6 <rule>

Enables IPv6 port forwarding, rule specified by <rule>.

--loopback-6 <rule>

Enables IPv6 loopback interface, rule specified by <rule>.

VBoxManage natnetwork start --netname <name>
    

VBoxManage natnetwork start Starts specified NAT network service and any associated DHCP server, parameters:

--netname <name>

Where <name> specifies an existing NAT network service.

VBoxManage natnetwork stop --netname <name>
    

VBoxManage natnetwork stop Stops specified NAT network service and any DHCP server, parameters:

--netname <name>

Where <name> specifies an existing NAT network service.

VBoxManage natnetwork list [<pattern>] 

VBoxManage natnetwork list Lists all NAT network services with optional filtering, parameters:

[<pattern>]

Where <pattern> is optional filtering pattern.

8.37. VBoxManage hostonlyif

With "hostonlyif" you can change the IP configuration of a host-only network interface. For a description of host-only networking, please refer to Section 6.7, “Host-only networking”. Each host-only interface is identified by a name and can either use the internal DHCP server or a manual IP configuration (both IP4 and IP6).

The following list summarizes the available subcommands:

ipconfig "<name>"

Configure a hostonly interface

create

Creates a new vboxnet<N> interface on the host OS. This command is essential before you can attach VMs to host-only network.

remove vboxnet<N>

Removes a vboxnet<N> interface from the host OS.

8.38. VBoxManage dhcpserver

The "dhcpserver" commands allow you to control the DHCP server that is built into VirtualBox. You may find this useful when using internal or host-only networking. (Theoretically, you can enable it for a bridged network as well, but that will likely cause conflicts with other DHCP servers in your physical network.)

Use the following command line options:

  • If you use internal networking for a virtual network adapter of a virtual machine, use VBoxManage dhcpserver add --netname <network_name>, where <network_name> is the same network name you used with VBoxManage modifyvm <仮想マシン名> --intnet<X> <network_name>.

  • If you use host-only networking for a virtual network adapter of a virtual machine, use VBoxManage dhcpserver add --ifname <hostonly_if_name> instead, where <hostonly_if_name> is the same host-only interface name you used with VBoxManage modifyvm <仮想マシン名> --hostonlyadapter<X> <hostonly_if_name>.

    Alternatively, you can also use the --netname option as with internal networks if you know the host-only network's name; you can see the names with VBoxManage list hostonlyifs (see Section 8.4, “VBoxManage list” above).

The following additional parameters are required when first adding a DHCP server:

  • With --ip, specify the IP address of the DHCP server itself.

  • With --netmask, specify the netmask of the network.

  • With --lowerip and --upperip, you can specify the lowest and highest IP address, respectively, that the DHCP server will hand out to clients.

Finally, you must specify --enable or the DHCP server will be created in the disabled state, doing nothing.

After this, VirtualBox will automatically start the DHCP server for given internal or host-only network as soon as the first virtual machine which uses that network is started.

Reversely, use VBoxManage dhcpserver remove with the given --netname <network_name> or --ifname <hostonly_if_name> to remove the DHCP server again for the given internal or host-only network.

To modify the settings of a DHCP server created earlier with VBoxManage dhcpserver add, you can use VBoxManage dhcpserver modify for a given network or host-only interface name. This has the same parameters as VBoxManage dhcpserver add.

8.39. VBoxManage usbdevsource

The "usbdevsource" commands enables you to add and remove USB devices globally.

The following command adds a USB device.

VBoxManage usbdevsource add <source name>
                            --backend <backend>
                            --address <address>
    

Where the command line options are:

  • <source name> specifies the ID of the 'source' USB device to be added. Mandatory.

  • --backend <backend> specifies the USB proxy service backend to use. Mandatory.

  • --address <address> specifies the backend specific address. Mandatory.

The following command removes a USB device.

VBoxManage usbdevsource remove <source name>
    

Where the command line options are:

  • <source name> specifies the ID of the 'source' USB device to be removed. Mandatory.

8.40. VBoxManage debugvm

Introspection and guest debugging.

Synopsis

VBoxManage debugvm <uuid|仮想マシン名> dumpvmcore [--ファイル名=name]

VBoxManage debugvm <uuid|仮想マシン名> info <item> [args...]

VBoxManage debugvm <uuid|仮想マシン名> injectnmi

VBoxManage debugvm <uuid|仮想マシン名> log [[--release] | [--debug]] [group-settings...]

VBoxManage debugvm <uuid|仮想マシン名> logdest [[--release] | [--debug]] [destinations...]

VBoxManage debugvm <uuid|仮想マシン名> logflags [[--release] | [--debug]] [flags...]

VBoxManage debugvm <uuid|仮想マシン名> osdetect

VBoxManage debugvm <uuid|仮想マシン名> osinfo

VBoxManage debugvm <uuid|仮想マシン名> osdmesg [--lines=lines]

VBoxManage debugvm <uuid|仮想マシン名> getregisters [--cpu=id] [reg-set.reg-name...]

VBoxManage debugvm <uuid|仮想マシン名> setregisters [--cpu=id] [reg-set.reg-name=value...]

VBoxManage debugvm <uuid|仮想マシン名> show [[--human-readable] | [--sh-export] | [--sh-eval] | [--cmd-set]] [settings-item...]

VBoxManage debugvm <uuid|仮想マシン名> stack [--cpu=id]

VBoxManage debugvm <uuid|仮想マシン名> statistics [--reset] [--descriptions] [--pattern=pattern]

Description

The "debugvm" commands are for experts who want to tinker with the exact details of virtual machine execution. Like the VM debugger described in Section 12.1.3, “The built-in VM debugger”, these commands are only useful if you are very familiar with the details of the PC architecture and how to debug software.

Common options

The subcommands of debugvm all operate on a running virtual machine:

uuid|仮想マシン名

Either the UUID or the name (case sensitive) of a VM.

debugvm dumpvmcore

VBoxManage debugvm <uuid|仮想マシン名> dumpvmcore [--ファイル名=name]

Creates a system dump file of the specified VM. This file will have the standard ELF core format (with custom sections); see Section 12.1.4, “VM core format”.

This corresponds to the writecore command in the debugger.

--ファイル名=ファイル名

The name of the output file.

debugvm info

VBoxManage debugvm <uuid|仮想マシン名> info <item> [args...]

Displays info items relating to the VMM, device emulations and associated drivers.

This corresponds to the info command in the debugger.

info

Name of the info item to display. The special name help will list all the available info items and hints about optional arguments.

args

Optional argument string for the info item handler. Most info items does not take any extra arguments. Arguments not recognized are generally ignored.

debugvm injectnmi

VBoxManage debugvm <uuid|仮想マシン名> injectnmi

Causes a non-maskable interrupt (NMI) to be injected into the guest. This might be useful for certain debugging scenarios. What happens exactly is dependent on the guest operating system, but an NMI can crash the whole guest operating system. Do not use unless you know what you're doing.

debugvm log

VBoxManage debugvm <uuid|仮想マシン名> log [[--release] | [--debug]] [group-settings...]

Changes the group settings for either debug (--debug) or release (--release) logger of the VM process.

The group-settings are typically strings on the form em.e.f.l, hm=~0 and -em.f. Basic wildcards are supported for group matching. The all group is an alias for all the groups.

Please do keep in mind that the group settings are applied as modifications to the current ones.

This corresponds to the log command in the debugger.

debugvm logdest

VBoxManage debugvm <uuid|仮想マシン名> logdest [[--release] | [--debug]] [destinations...]

Changes the destination settings for either debug (--debug) or release (--release) logger of the VM process. For details on the destination format, the best source is src/VBox/Runtime/common/log/log.cpp.

The destinations is one or more mnemonics, optionally prefixed by "no" to disable them. Some of them take values after a ":" or "=" separator. Multiple mnemonics can be separated by space or given as separate arguments on the command line.

List of available destination:

file[=file], nofile

Specifies a log file. It no filname is given, one will be generated based on the current UTC time and VM process name and placed in the current directory of the VM process. Note that this will currently not have any effect if the log file has already been opened.

dir=directory, nodir

Specifies the output directory for log files. Note that this will currently not have any effect if the log file has already been opened.

history=count, nohistory

A non-zero value enables log historization, with the value specifying how many old log files to keep.

histsize=bytes

The max size of a log file before it is historized. Default is infinite.

histtime=seconds

The max age (in seconds) of a log file before it is historized. Default is infinite.

ringbuffer, noringbuffer

Only log to the log buffer until an explicit flush (e.g. via an assertion) occurs. This is fast and saves diskspace.

stdout, nostdout

Write the log content to standard output.

stdout, nostdout

Write the log content to standard error.

debugger, nodebugger

Write the log content to the debugger, if supported by the host OS.

com, nocom

Writes logging to the COM port. This is only applicable for raw-mode and ring-0 logging.

user, nouser

Custom destination which has no meaning to VM processes..

This corresponds to the logdest command in the debugger.

debugvm logflags

VBoxManage debugvm <uuid|仮想マシン名> logflags [[--release] | [--debug]] [flags...]

Changes the flags on either debug (--debug) or release (--release) logger of the VM process. Please note that the modifications are applied onto the existing changes, they are not replacing them.

The flags are a list of flag mnemonics, optionally prefixed by a "no", "!", "~" or "-" to negate their meaning. The "+" prefix can be used to undo previous negation or use as a separator, though better use whitespace or separate arguments for that.

List of log flag mnemonics, with their counter form where applicable (asterisk indicates defaults):

enabled*, disabled

Enables or disables logging.

buffered, unbuffered*

Enabling buffering of log output before it hits the destinations.

writethrough(/writethru)

Whether to open the destination file with writethru buffering settings or not.

flush

Enables flushing of the output file (to disk) after each log statement.

lockcnts

Prefix each log line with lock counts for the current thread.

cpuid

Prefix each log line with the ID of the current CPU.

pid

Prefix each log line with the current process ID.

flagno

Prefix each log line with the numberic flags corresponding to the log statement.

flag

Prefix each log line with the flag mnemonics corresponding to the log statement.

groupno

Prefix each log line with the log group number for the log statement producing it.

group

Prefix each log line with the log group name for the log statement producing it.

tid

Prefix each log line with the current thread identifier.

thread

Prefix each log line with the current thread name.

time

Prefix each log line with the current UTC wall time.

timeprog

Prefix each log line with the current monotonic time since the start of the program.

msprog

Prefix each log line with the current monotonic timestamp value in milliseconds since the start of the program.

ts

Prefix each log line with the current monotonic timestamp value in nanoseconds.

tsc

Prefix each log line with the current CPU timestamp counter (TSC) value.

rel, abs*

Selects the whether ts and tsc prefixes should be displayed as relative to the previous log line or as absolute time.

hex*, dec

Selects the whether the ts and tsc prefixes should be formatted as hexadecimal or decimal.

custom

Custom log prefix, has by default no meaning for VM processes.

usecrlf, uself*

Output with DOS style (CRLF) or just UNIX style (LF) line endings.

overwrite*, append

Overwrite the destination file or append to it.

This corresponds to the logflags command in the debugger.

debugvm osdetect

VBoxManage debugvm <uuid|仮想マシン名> osdetect

Make the VMM's debugger facility (re)-detect the guest operating system (OS). This will first load all debugger plug-ins.

This corresponds to the detect command in the debugger.

debugvm osinfo

VBoxManage debugvm <uuid|仮想マシン名> osinfo

Displays information about the guest operating system (OS) previously detected by the VMM's debugger facility.

debugvm osdmesg

VBoxManage debugvm <uuid|仮想マシン名> osdmesg [--lines=lines]

Displays the guest OS kernel log, if detected and supported.

--lines=lines

Number of lines of the log to display, counting from the end. The default is infinite.

debugvm getregisters

VBoxManage debugvm <uuid|仮想マシン名> getregisters [--cpu=id] [reg-set.reg-name...]

Retrieves register values for guest CPUs and emulated devices.

reg-set.reg-name

One of more registers, each having one of the following forms:

  1. register-set.register-name.sub-field

  2. register-set.register-name

  3. cpu-register-name.sub-field

  4. cpu-register-name

  5. all

The all form will cause all registers to be shown (no sub-fields). The registers names are case-insensitive.

--cpu=id

Selects the CPU register set when specifying just a CPU register (3rd and 4th form). The default is 0.

debugvm setregisters

VBoxManage debugvm <uuid|仮想マシン名> setregisters [--cpu=id] [reg-set.reg-name=value...]

Changes register values for guest CPUs and emulated devices.

reg-set.reg-name=value

One of more register assignment, each having one of the following forms:

  1. register-set.register-name.sub-field=value

  2. register-set.register-name=value

  3. cpu-register-name.sub-field=value

  4. cpu-register-name=value

The value format should be in the same style as what getregisters displays, with the exception that both octal and decimal can be used instead of hexadecimal.

--cpu=id

Selects the CPU register set when specifying just a CPU register (3rd and 4th form). The default is 0.

debugvm show

VBoxManage debugvm <uuid|仮想マシン名> show [[--human-readable] | [--sh-export] | [--sh-eval] | [--cmd-set]] [settings-item...]

Shows logging settings for the VM.

--human-readable

Selects human readable output.

--sh-export

Selects output format as bourne shell style export commands.

--sh-eval

Selects output format as bourne shell style eval command input.

--cmd-set

Selects output format as DOS style SET commands.

settings-item

What to display. One or more of the following:

  • logdbg-settings - debug log settings.

  • logrel-settings - release log settings.

  • log-settings - alias for both debug and release log settings.

debugvm stack

VBoxManage debugvm <uuid|仮想マシン名> stack [--cpu=id]

Unwinds the guest CPU stacks to the best of our ability. It is recommended to first run the osdetect command, as this gives both symbols and perhaps unwind information.

--cpu=id

Selects a single guest CPU to display the stack for. The default is all CPUs.

debugvm statistics

VBoxManage debugvm <uuid|仮想マシン名> statistics [--reset] [--descriptions] [--pattern=pattern]

Displays or resets VMM statistics.

Retrieves register values for guest CPUs and emulated devices.

--pattern=pattern

DOS/NT-style wildcards patterns for selecting statistics. Multiple patterns can be specified by using the '|' (pipe) character as separator.

--reset

Select reset instead of display mode.

8.41. VBoxManage extpack

Extension package management.

Synopsis

VBoxManage extpack install [--replace] <tarball>

VBoxManage extpack uninstall [--force] <name>

VBoxManage extpack cleanup

Description

extpack install

VBoxManage extpack install [--replace] <tarball>

Installs a new extension pack on the system. This command will fail if an older version of the same extension pack is already installed. The --replace option can be used to uninstall any old package before the new one is installed.

--replace

Uninstall existing extension pack version.

tarball

The file containing the extension pack to be installed.

extpack uninstall

VBoxManage extpack uninstall [--force] <name>

Uninstalls an extension pack from the system. The subcommand will also succeed in the case where the specified extension pack is not present on the system. You can use VBoxManage list extpacks to show the names of the extension packs which are currently installed.

--force

Overrides most refusals to uninstall an extension pack

name

The name of the extension pack to be uninstalled.

extpack cleanup

VBoxManage extpack cleanup

Used to remove temporary files and directories that may have been left behind if a previous install or uninstall command failed.

Examples

How to list extension packs:

$ VBoxManage list extpacks
Extension Packs: 1
Pack no. 0:   Oracle VM VirtualBox Extension Pack
Version:      4.1.12
Revision:     77218
Edition:
Description:  USB 2.0 Host Controller, VirtualBox RDP, PXE ROM with E1000 support.
VRDE Module:  VBoxVRDP
Usable:       true
Why unusable:

How to remove an extension pack:

$ VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully uninstalled "Oracle VM VirtualBox Extension Pack".


[38] Before VirtualBox 4.0, it was necessary to call VBoxManage openmedium before a medium could be attached to a virtual machine; that call "registered" the medium with the global VirtualBox media registry. With VirtualBox 4.0 this is no longer necessary; media are added to media registries automatically. The "closemedium" call has been retained, however, to allow for explicitly removing a medium from a registry.

[39] Image resizing was added with VirtualBox 4.0.