14 Commits

Author SHA1 Message Date
417fc3132f Updated modifyvm command. 2023-03-12 18:56:12 +01:00
d505a106fa Updated createvm command. 2023-03-12 18:53:20 +01:00
aa31561a45 Updated registervm command. 2023-03-12 18:51:07 +01:00
dda64a649c Updated showvminfo command. 2023-03-12 18:50:08 +01:00
4298237cf9 Changed a way how vboxmanage commands are obtained.
Starting from 7.x version of VirtualBox, vboxmanage command help gives
its usage with one or more lines per command, like:

  VBoxManage command <args> [--option1|--option2] [--option3=optarg ]

There is no need to get it as in old format from now on.
2023-03-12 18:44:37 +01:00
c7a5fc729c Bump to version 6.1.38 2022-10-08 09:12:03 +02:00
62d9078b23 Version bump 2022-08-29 10:20:38 +02:00
3f42dd2dc1 Version bump. 2022-07-25 11:15:06 +02:00
6ee3136033 Version bump. 2022-07-25 11:14:24 +02:00
cf367c093d Bump to 6.1.28.
There was a minor change regarding export command: --iso parameter has
been removed.
2021-12-07 21:21:57 +01:00
7174fe03db Bump to version 6.1.22.
There were cloud network command added.
2021-08-01 17:40:51 +02:00
f2d71065cb Removed trailing spaces. 2021-08-01 17:39:56 +02:00
82e2fade6b Change approach with getting commands out of help.
There are currently two ways for specify available commands in
vboxmanage help:

Usage:

  VBoxManage [<general option>] <command>
[..]
Commands:

  command1 ...

  command2 ...

and:

  VBoxManage command3 ...

  VBoxManage command4 ...

besides the fact how it is annoying for parsing the output (or lack of
having some way for machine readable format for commands), I have
treated the latter as a exception from general rule, but lately it
slowly moving towards the second form. In this patch it is adapted to
also parse second format instead of adding those commands manually.

Also, there was missing parameter added for sharedfolder add command.
2021-07-27 20:10:58 +02:00
8360d95123 Bump to 6.1.10 2020-07-21 14:30:48 +02:00
2 changed files with 285 additions and 181 deletions

View File

@@ -6,7 +6,7 @@ script. However, in some point of time I've decided to rewrite it almost from
scratch. scratch.
Current version of script was written and tested against VBoxManage in version Current version of script was written and tested against VBoxManage in version
6.1.6, and should contain all commands and their options. 6.1.38, and should contain all commands and their options.
Unlike other attempts, I've tried to make the script context aware. See the Unlike other attempts, I've tried to make the script context aware. See the
simple session with the VBoxManage command below, to have an idea how it works: simple session with the VBoxManage command below, to have an idea how it works:

View File

@@ -4,7 +4,7 @@
# URL: https://bitbucket.org/gryf/vboxmanage-bash-completion # URL: https://bitbucket.org/gryf/vboxmanage-bash-completion
# URL: https://github.com/gryf/vboxmanage-bash-completion # URL: https://github.com/gryf/vboxmanage-bash-completion
# License: 3-clause BSD-style license (see LICENSE file) # License: 3-clause BSD-style license (see LICENSE file)
# Version: 6.1.6 # Version: 6.1.38
_VBoxManage() { _VBoxManage() {
@@ -453,7 +453,7 @@ _VBoxManage() {
[[ ${item^^} == ${cur^^}* ]] && COMPREPLY+=("$item") [[ ${item^^} == ${cur^^}* ]] && COMPREPLY+=("$item")
done done
} }
_cloudprofiles_comp() { _cloudprofiles_comp() {
local profiles local profiles
local item local item
@@ -484,19 +484,15 @@ _VBoxManage() {
fi fi
fi fi
# all possible commands for the VBoxManage # all possible commands for the VBoxManage. Starting from VirtualBox 7.x all
# commands are listed as ` VBoxManage commandname ` in a help.
opts=$(VBoxManage -q help | \ opts=$(VBoxManage -q help | \
egrep -o "^\s\s[a-z]+ " | \ grep VBoxManage | \
grep -v VBoxManage | \ awk '{print $2}'| \
awk '{print $1}'| \ grep -v '\[' | \
sort | \ sort | \
uniq) uniq)
# Add some commands manually, since they are listed differently in
# vboxmanage help.
opts="${opts} mediumio debugvm unattended extpack clonevm snapshot
dhcpserver cloudprofile cloud"
if [[ ${cur} == "-q" || ${COMP_CWORD} -eq 1 ]] ; then if [[ ${cur} == "-q" || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0 return 0
@@ -691,14 +687,19 @@ _VBoxManage() {
;; ;;
cloud) cloud)
if [[ " ${COMP_WORDS[@]} " != *" --provider"* || if [ "${prev}" == "cloud" ]; then
items=(--provider --profile network)
elif [[ " ${COMP_WORDS[@]} " == *" network"* ]]; then
items=(update delete info)
elif [[ " ${COMP_WORDS[@]} " != *" --provider"* ||
" ${COMP_WORDS[@]} " != *" --profile"* ]]; then " ${COMP_WORDS[@]} " != *" --profile"* ]]; then
items=(--provider --profile) items=(--provider --profile)
else else
[[ " ${COMP_WORDS[@]} " != *" list"* && [[ " ${COMP_WORDS[@]} " != *" list"* &&
" ${COMP_WORDS[@]} " != *" instance"* && " ${COMP_WORDS[@]} " != *" instance"* &&
" ${COMP_WORDS[@]} " != *" network"* &&
" ${COMP_WORDS[@]} " != *" image"* ]] && " ${COMP_WORDS[@]} " != *" image"* ]] &&
items=(list instance image) items=(list instance image network)
fi fi
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
@@ -715,14 +716,18 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "instances images" -- ${cur}) ) COMPREPLY=( $(compgen -W "instances images" -- ${cur}) )
;; ;;
instance) instance)
COMPREPLY=( $(compgen -W "create info terminate start COMPREPLY=( $(compgen -W "create info terminate start
pause" -- ${cur}) ) pause" -- ${cur}) )
;; ;;
image) image)
COMPREPLY=( $(compgen -W "create info delete import COMPREPLY=( $(compgen -W "create info delete import
export" -- ${cur}) ) export" -- ${cur}) )
;; ;;
network) # TODO: differentiate between setup/create and update/delete/info
if [[ " ${COMP_WORDS[@]} " == *" --provider"* ]]; then
COMPREPLY=( $(compgen -W "setup create" -- ${cur}) )
fi
;;
esac esac
if [[ " ${COMP_WORDS[@]} " == *" list images"* ]]; then if [[ " ${COMP_WORDS[@]} " == *" list images"* ]]; then
@@ -732,8 +737,9 @@ _VBoxManage() {
fi fi
if [[ " ${COMP_WORDS[@]} " == *" instance create"* ]]; then if [[ " ${COMP_WORDS[@]} " == *" instance create"* ]]; then
items=(--domain-name --display-name --shape --subnet --publicip items=( --domain-name --display-name --shape --subnet
--boot-disk-size --privateip --public-ssh-key --launch-mode) --publicip --boot-disk-size --privateip --public-ssh-key
--launch-mode --cloud-init-script-path )
[[ " ${COMP_WORDS[@]} " != *" --image-id"* && [[ " ${COMP_WORDS[@]} " != *" --image-id"* &&
" ${COMP_WORDS[@]} " != *" --boot-volume-id"* ]] && " ${COMP_WORDS[@]} " != *" --boot-volume-id"* ]] &&
items+=(--image-id --boot-volume-id) items+=(--image-id --boot-volume-id)
@@ -746,7 +752,7 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "true false" -- ${cur}) ) COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
;; ;;
--launch-mode) --launch-mode)
COMPREPLY=( $(compgen -W "NATIVE EMULATED COMPREPLY=( $(compgen -W "NATIVE EMULATED
PARAVIRTUALIZED" -- ${cur}) ) PARAVIRTUALIZED" -- ${cur}) )
;; ;;
esac esac
@@ -757,7 +763,7 @@ _VBoxManage() {
" ${COMP_WORDS[@]} " == *" instance pause"* ]]; then " ${COMP_WORDS[@]} " == *" instance pause"* ]]; then
COMPREPLY=( $(compgen -W "--id" -- ${cur}) ) COMPREPLY=( $(compgen -W "--id" -- ${cur}) )
fi fi
if [[ " ${COMP_WORDS[@]} " == *" image create"* ]]; then if [[ " ${COMP_WORDS[@]} " == *" image create"* ]]; then
items=(--display-name --bucket-name --object-name --instance-id) items=(--display-name --bucket-name --object-name --instance-id)
@@ -769,13 +775,41 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "--id" -- ${cur}) ) COMPREPLY=( $(compgen -W "--id" -- ${cur}) )
fi fi
if [[ " ${COMP_WORDS[@]} " == *" image import"* ]]; then if [[ " ${COMP_WORDS[@]} " == *" image import"* ]]; then
COMPREPLY=( $(compgen -W "--id --bucket-name COMPREPLY=( $(compgen -W "--id --bucket-name
--object-name" -- ${cur}) ) --object-name" -- ${cur}) )
fi fi
if [[ " ${COMP_WORDS[@]} " == *" image export"* ]]; then if [[ " ${COMP_WORDS[@]} " == *" image export"* ]]; then
COMPREPLY=( $(compgen -W "--id --display-name --bucket-name COMPREPLY=( $(compgen -W "--id --display-name --bucket-name
--object-name" -- ${cur}) ) --object-name" -- ${cur}) )
fi fi
if [[ " ${COMP_WORDS[@]} " == *" network setup"* ]]; then
items=( --local-gateway-iso --gateway-os-name
--gateway-os-version --gateway-shape --tunnel-network-name
--tunnel-network-range --guest-additions-iso --proxy
--compartment-id )
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi
if [[ " ${COMP_WORDS[@]} " == *" network create"* ]]; then
items=( --name --network-id )
[[ " ${COMP_WORDS[@]} " != *" --enable"* &&
" ${COMP_WORDS[@]} " != *" --disable"* ]] &&
items+=(--enable --disable)
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi
if [[ " ${COMP_WORDS[@]} " == *" network update"* ]]; then
items=( --name --network-id )
[[ " ${COMP_WORDS[@]} " != *" --enable"* &&
" ${COMP_WORDS[@]} " != *" --disable"* ]] &&
items+=(--enable --disable)
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi
if [[ " ${COMP_WORDS[@]} " == *" network info"* ||
" ${COMP_WORDS[@]} " == *" network delete"* ]]; then
COMPREPLY=( $(compgen -W "--name" -- ${cur}) )
fi
;; ;;
controlvm) controlvm)
@@ -981,8 +1015,8 @@ _VBoxManage() {
;; ;;
createvm) createvm)
items=(--name --groups --ostype --register --basefolder --uuid items=( --basefolder --ciphercipher --default --group --name --ostype
--default) --password-idpassword-id --passwordfile --register --uuid )
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
else else
@@ -990,7 +1024,7 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
case "${prev}" in case "${prev}" in
--groups) --group)
COMPREPLY=() COMPREPLY=()
_group_comp _group_comp
;; ;;
@@ -1001,9 +1035,8 @@ _VBoxManage() {
--basefolder) --basefolder)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) ) COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
;; ;;
--variant) --passwordfile)
COMPREPLY=( $(compgen -W "Standard Fixed Split2G Stream COMPREPLY=( $(compgen -f -- ${cur}) )
ESX" -- ${cur}) )
;; ;;
esac esac
fi fi
@@ -1230,7 +1263,7 @@ _VBoxManage() {
;; ;;
"export") "export")
items=( --manifest --iso --options --vsys --cloud ) items=( --manifest --options --vsys --cloud --cloudinitscriptpath )
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms _vms_comp vms
elif [[ ${prev} == "--eulafile" ]]; then elif [[ ${prev} == "--eulafile" ]]; then
@@ -1256,7 +1289,7 @@ _VBoxManage() {
items+=(--vmname --cloudprofile --cloudshape --clouddomain items+=(--vmname --cloudprofile --cloudshape --clouddomain
--clouddisksize --cloudbucket --cloudocivcn --cloudocisubnet --clouddisksize --cloudbucket --cloudocivcn --cloudocisubnet
--cloudkeepobject --cloudlaunchinstance --cloudpublicip --cloudkeepobject --cloudlaunchinstance --cloudpublicip
--cloudprivateip --cloudlaunchmode) --cloudprivateip --cloudlaunchmode --cloudinitscriptpath )
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
@@ -1874,83 +1907,109 @@ _VBoxManage() {
;; ;;
modifyvm) modifyvm)
items=(--name --groups --description --ostype --iconfile --memory items=( --accelerate-2d-video --accelerate-3d --acpi --apic --audio
--pagefusion --vram --acpi --ioapic --hpet --audio-codec --audio-controller --audio-in --audio-out
--triplefaultreset --hwvirtex --nestedpaging --largepages --vtxvpid --autostart-delay --autostart-enabled --bios-apic
--vtxux --pae --longmode --cpuid-set --cpuid-remove --bios-bootm-enu --bios-logo-display-time --bios-logo-fade-in
--cpuidremoveall --hardwareuuid --cpus --cpuhotplug --plugcpu --bios-logo-fade-out --bios-logo-image-path --bios-pxe-debug
--unplugcpu --cpuexecutioncap --rtcuseutc --graphicscontroller --bios-system-time-offset --boot1 --boot2 --boot3 --boot4
--monitorcount --accelerate3d --accelerate2dvideo --firmware --bridge-adapter1 --bridge-adapter2 --bridge-adapter3
--chipset --bioslogofadein --bioslogofadeout --bioslogodisplaytime --bridge-adapter4 --bridge-adapter5 --bridge-adapter6
--bioslogoimagepath --biosbootmenu --biossystemtimeoffset --bridge-adapter7 --bridge-adapter8 --cable-connected1
--biospxedebug --boot1 --boot2 --boot3 --boot4 --nicbootprio1 --cable-connected2 --cable-connected3 --cable-connected4
--nicbandwidthgroup1 --bridgeadapter1 --bridgeadapter2 --cable-connected5 --cable-connected6 --cable-connected7
--bridgeadapter3 --bridgeadapter4 --bridgeadapter5 --bridgeadapter6 --cloud-network1 --cloud-network2 --cloud-network3
--bridgeadapter7 --bridgeadapter8 --hostonlyadapter1 --cloud-network4 --cable-connected8 --chipset --clipboard-mode
--hostonlyadapter2 --hostonlyadapter3 --hostonlyadapter4 --cpu-profile --cpu-execution-cap --cpu-hotplug
--hostonlyadapter5 --hostonlyadapter6 --hostonlyadapter7 --cpuid-portability-level --cpuid-remove --cpuid-set
--hostonlyadapter8 --intnet1 --intnet2 --intnet3 --intnet4 --intnet5 --cpuid-remove-all --cpus --default-frontend --description
--intnet6 --intnet7 --intnet8 --nat-network1 --nicgenericdrv1 --drag-and-drop --firmware --graphicscontroller --groups
--natnet1 --natsettings1 --nat-network2 --nicgenericdrv2 --natnet2 --guest-debug-address --guest-debug-io-provider
--natsettings2 --nat-network3 --nicgenericdrv3 --natnet3 --guest-debug-port --guest-debug-provider --guest-memory-balloon
--natsettings3 --nat-network4 --nicgenericdrv4 --natnet4 --hardware-uuid --host-only-adapter1 --host-only-adapter2
--natsettings4 --nat-network5 --nicgenericdrv5 --natnet5 --host-only-adapter3 --host-only-adapter4 --host-only-adapter5
--natsettings5 --nat-network6 --nicgenericdrv6 --natnet6 --host-only-adapter6 --host-only-adapter7 --host-only-adapter8
--natsettings6 --nat-network7 --nicgenericdrv7 --natnet7 --host-only-net1 --host-only-net2 --host-only-net3
--natsettings7 --nat-network8 --nicgenericdrv8 --natnet8 --host-only-net4 --host-only-net5 --host-only-net6
--natsettings8 --natpf1 --nic1 --nicpromisc1 --nicproperty1 --host-only-net7 --host-only-net8 --hpet --hwvirtex
--nictrace1 --nictracefile1 --natpf2 --nic2 --nicpromisc2 --ibpb-on-vm-entry --ibpb-on-vm-exit --icon-file --intnet1
--nicproperty2 --nictrace2 --nictracefile2 --natpf3 --nic3 --intnet2 --intnet3 --intnet4 --intnet5 --intnet6 --intnet7
--nicpromisc3 --nicproperty3 --nictrace3 --nictracefile3 --natpf4 --intnet8 --ioapic --iommu --keyboard --l1d-flush-on-sched
--nic4 --nicpromisc4 --nicproperty4 --nictrace4 --nictracefile4 --l1d-flush-on-vm-entry --large-pages --long-mode --lpt1
--natpf5 --nic5 --nicpromisc5 --nicproperty5 --nictrace5 --lpt-mode1 --mac-address1 --mac-address2 --mac-address3
--nictracefile5 --natpf6 --nic6 --nicpromisc6 --nicproperty6 --mac-address4 --mac-address5 --mac-address6 --mac-address7
--nictrace6 --nictracefile6 --natpf7 --nic7 --nicpromisc7 --mac-address8 --mds-clear-on-sched --mds-clear-on-vm-entry
--nicproperty7 --nictrace7 --nictracefile7 --natpf8 --nic8 --memory --monitor-count --mouse --name --nat-alias-mode1
--nicpromisc8 --nicproperty8 --nictrace8 --nictype1 --nictype2 --nat-alias-mode2 --nat-alias-mode3 --nat-alias-mode4
--nictype3 --nictype4 --nictype5 --nictype6 --nictype7 --nictype8 --nat-alias-mode5 --nat-alias-mode6 --nat-alias-mode7
--cableconnected1 --cableconnected2 --cableconnected3 --nat-alias-mode8 --nat-bind-ip1 --nat-bind-ip2 --nat-bind-ip3
--cableconnected4 --cableconnected5 --cableconnected6 --nat-bind-ip4 --nat-bind-ip5 --nat-bind-ip6 --nat-bind-ip7
--cableconnected7 --cableconnected8 --nicspeed1 --nicspeed2 --nat-bind-ip8 --nat-dns-host-resolver1 --nat-dns-host-resolver2
--nicspeed3 --nicspeed4 --nicspeed5 --nicspeed6 --nicspeed7 --nat-dns-host-resolver3 --nat-dns-host-resolver4
--nicspeed8 --nattftpprefix1 --nattftpprefix2 --nattftpprefix3 --nat-dns-host-resolver5 --nat-dns-host-resolver6
--nattftpprefix4 --nattftpprefix5 --nattftpprefix6 --nattftpprefix7 --nat-dns-host-resolver7 --nat-dns-host-resolver8
--nattftpprefix8 --nattftpfile1 --nattftpfile2 --nattftpfile3 --nat-dns-pass-domain1 --nat-dns-pass-domain2
--nattftpfile4 --nattftpfile5 --nattftpfile6 --nattftpfile7 --nat-dns-pass-domain3 --nat-dns-pass-domain4
--nattftpfile8 --nattftpserver1 --nattftpserver2 --nattftpserver3 --nat-dns-pass-domain5 --nat-dns-pass-domain6
--nattftpserver4 --nattftpserver5 --nattftpserver6 --nattftpserver7 --nat-dns-pass-domain7 --nat-dns-pass-domain8 --nat-dns-proxy1
--nattftpserver8 --natbindip1 --natbindip2 --natbindip3 --natbindip4 --nat-dns-proxy2 --nat-dns-proxy3 --nat-dns-proxy4
--natbindip5 --natbindip6 --natbindip7 --natbindip8 --nat-dns-proxy5 --nat-dns-proxy6 --nat-dns-proxy7
--natdnspassdomain1 --natdnspassdomain2 --natdnspassdomain3 --nat-dns-proxy8 --nat-localhostreachable1
--natdnspassdomain4 --natdnspassdomain5 --natdnspassdomain6 --nat-localhostreachable2 --nat-localhostreachable3
--natdnspassdomain7 --natdnspassdomain8 --natdnsproxy1 --nat-localhostreachable4 --nat-localhostreachable5
--natdnsproxy2 --natdnsproxy3 --natdnsproxy4 --natdnsproxy5 --nat-localhostreachable6 --nat-localhostreachable7
--natdnsproxy6 --natdnsproxy7 --natdnsproxy8 --natdnshostresolver1 --nat-localhostreachable8 --nat-net1 --nat-net2 --nat-net3
--natdnshostresolver2 --natdnshostresolver3 --natdnshostresolver4 --nat-net4 --nat-net5 --nat-net6 --nat-net7 --nat-net8
--natdnshostresolver5 --natdnshostresolver6 --natdnshostresolver7 --nat-network1 --nat-network2 --nat-network3 --nat-network4
--natdnshostresolver8 --nataliasmode1 --nataliasmode2 --nat-network5 --nat-network6 --nat-network7 --nat-network8
--nataliasmode3 --nataliasmode4 --nataliasmode5 --nataliasmode6 --nat-pf1 --nat-pf2 --nat-pf3 --nat-pf4 --nat-pf5 --nat-pf6
--nataliasmode7 --nataliasmode8 --macaddress1 --macaddress2 --nat-pf7 --nat-pf8 --nat-settings1 --nat-settings2
--macaddress3 --macaddress4 --macaddress5 --macaddress6 --nat-settings3 --nat-settings4 --nat-settings5 --nat-settings6
--macaddress7 --macaddress8 --mouse --keyboard --uart1 --uartmode1 --nat-settings7 --nat-settings8 --nat-tftp-file1 --nat-tftp-file2
--uart2 --uartmode2 --lpt1 --lptmode1 --guestmemoryballoon --audio --nat-tftp-file3 --nat-tftp-file4 --nat-tftp-file5
--audiocontroller --clipboard-mode --draganddrop --vrde --vrdeextpack --nat-tftp-file6 --nat-tftp-file7 --nat-tftp-file8
--vrdeproperty --vrdeport --vrdeaddress --vrdeauthtype --nat-tftp-prefix1 --nat-tftp-prefix2 --nat-tftp-prefix3
--vrdeauthlibrary --vrdemulticon --vrdereusecon --vrdevideochannel --nat-tftp-prefix4 --nat-tftp-prefix5 --nat-tftp-prefix6
--vrdevideochannelquality --usbohci --usbehci --snapshotfolder --nat-tftp-prefix7 --nat-tftp-prefix8 --nat-tftp-server1
--teleporter --teleporterport --teleporteraddress --nat-tftp-server2 --nat-tftp-server3 --nat-tftp-server4
--teleporterpassword --teleporterpasswordfile --tracing-enabled --nat-tftp-server5 --nat-tftp-server6 --nat-tftp-server7
--tracing-config --tracing-allow-vm-access --usbcardreader --nat-tftp-server8 --nested-hw-virt --nested-paging --nic1 --nic2
--autostart-enabled --autostart-delay --recording --recordingscreens --nic3 --nic4 --nic5 --nic6 --nic7 --nic8 --nic-bandwidth-group1
--recordingfile --recordingvideores --recordingvideorate --nic-boot-prio1 --nic-generic-drv1 --nic-generic-drv2
--recordingvideofps --recordingmaxtime --recordingmaxsize --nic-generic-drv3 --nic-generic-drv4 --nic-generic-drv5
--recordingopts --defaultfrontend --cpuid-portability-level --nic-generic-drv6 --nic-generic-drv7 --nic-generic-drv8
--paravirtprovider --audiocodec --usbxhci --usbrename --apic --nic-promisc1 --nic-promisc2 --nic-promisc3 --nic-promisc4
--x2apic --paravirtdebug --cpu-profile --biosapic --ibpb-on-vm-entry --nic-promisc5 --nic-promisc6 --nic-promisc7 --nic-promisc8
--ibpb-on-vm-exit --spec-ctrl --audioin --audioout --nic-property1 --nic-property2 --nic-property3 --nic-property4
--l1d-flush-on-sched --l1d-flush-on-vm-entry --mds-clear-on-sched --nic-property5 --nic-property6 --nic-property7 --nic-property8
--mds-clear-on-vm-entry --nested-hw-virt --uarttype1 --uarttype2 --nic-speed1 --nic-speed2 --nic-speed3 --nic-speed4 --nic-speed5
--system-uuid-le --vm-process-priority) --nic-speed6 --nic-speed7 --nic-speed8 --nic-trace1 --nic-trace2
--nic-trace3 --nic-trace4 --nic-trace5 --nic-trace6 --nic-trace7
--nic-trace8 --nic-trace-file1 --nic-trace-file2
--nic-trace-file3 --nic-trace-file4 --nic-trace-file5
--nic-trace-file6 --nic-trace-file7 --nic-trace-file8 --nic-type1
--nic-type2 --nic-type3 --nic-type4 --nic-type5 --nic-type6
--nic-type7 --nic-type8 --os-type --pae --page-fusion
--paravirt-debug --paravirt-provider --pci-attach --pci-detach
--plug-cpu --recording --recording-file --recording-max-size
--recording-max-time --recording-opts --recording-screens
--recording-video-fps --recording-video-rate
--recording-video-res --rtc-use-utc --snapshot-folder --spec-ctrl
--system-uuid-le --teleporter --teleporter-address
--teleporter-password --teleporter-password-file
--teleporter-port --testing-cfg-dwordidx --testing-enabled
--testing-mmio --tpm-location --tpm-type
--tracing-allow-vm-access --tracing-config --tracing-enabled
--triple-fault-reset --uart1 --uart2 --uart-mode1 --uart-mode2
--uart-type1 --uart-type2 --unplug-cpu --usb-card-reader
--usb-ehci --usb-ohci --usb-rename --usb-xhci
--virt-vmsave-vmload --vm-process-priority --vram --vrde
--vrde-address --vrde-auth-library --vrde-auth-type
--vrde-extpack --vrde-multi-con --vrde-port --vrde-property
--vrde-reuse-con --vrde-video-channel
--vrde-video-channel-quality --vtx-ux --vtx-vpid --x2apic )
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms _vms_comp vms
@@ -1963,37 +2022,30 @@ _VBoxManage() {
_group_comp _group_comp
;; ;;
--ostype) --os-type)
COMPREPLY=() COMPREPLY=()
_os_comp _os_comp
;; ;;
--pagefusion|--acpi|--ioapic|--hpet|--triplefaultreset|\ --accelerate-2d-video|--accelerate-3d|--acpi|--apic|\
--hwvirtex|--nestedpaging|--largepages|--vtxvpid|--vtxux|\ --audio-in|--audio-out|--autostart-enabled|\
--pae|--longmode|--cpuhotplug|--rtcuseutc|\ --bios-logo-fade-in|--bios-logo-fade-out|--bios-pxe-debug|\
--accelerate3d|--accelerate2dvideo|--bioslogofadein|\ --cable-connected1|--cable-connected2|--cable-connected3|\
--bioslogofadeout|--biospxedebug|--cableconnected1|\ --cable-connected4|--cable-connected5|--cable-connected6|\
--cableconnected2|--cableconnected3|--cableconnected4|\ --cable-connected7|--cable-connected8|--cpu-hotplug|--hpet|\
--cableconnected5|--cableconnected6|--cableconnected7|\ --hwvirtex|--ibpb-on-vm-entry|--ibpb-on-vm-exit|--ioapic|\
--cableconnected8|--nictrace1|--nictrace2|--nictrace3|\ --l1d-flush-on-sched|--l1d-flush-on-vm-entry|--large-pages|\
--nictrace4|--nictrace5|--nictrace6|--nictrace7|--nictrace8|\ --long-mode|--mds-clear-on-sched|--mds-clear-on-vm-entry|\
--natdnspassdomain1|--natdnspassdomain2|--natdnspassdomain3|\ --nat-dns-host-resolver[1-8]|--nat-dns-pass-domain[1-8]|\
--natdnspassdomain4|--natdnspassdomain5|--natdnspassdomain6|\ --nat-dns-proxy[1-8]|--nat-localhostreachable[1-8]|\
--natdnspassdomain7|--natdnspassdomain8|--natdnsproxy1|\ --nested-hw-virt|--nested-paging|--nic-trace[1-8]|--pae|\
--natdnsproxy2|--natdnsproxy3|--natdnsproxy4|--natdnsproxy5|\ --page-fusion|--recording|--rtc-use-utc|--spec-ctrl|\
--natdnsproxy6|--natdnsproxy7|--natdnsproxy8|\ --system-uuid-le|--teleporter|--testing-enabled|\
--natdnshostresolver1|--natdnshostresolver2|\ --testing-mmio|--tracing-allow-vm-access|--tracing-enabled|\
--natdnshostresolver3|--natdnshostresolver4|\ --triple-fault-reset|--usb-card-reader|--usb-ehci|\
--natdnshostresolver5|--natdnshostresolver6|\ --usb-ohci|--usb-xhci|--virt-vmsave-vmload|--vrde-multi-con|\
--natdnshostresolver7|--natdnshostresolver8|--vrde|\ --vrde-reuse-con|--vrde-video-channel|--vrde|--vtx-ux|\
--vrdemulticon|--vrdereusecon|--vrdevideochannel|--usbohci|\ --vtx-vpid|--x2apic)
--usbehci|--teleporter|--tracing-enabled|\
--tracing-allow-vm-access|--usbcardreader|\
--autostart-enabled|--recording|--usbxhci|--apic|--x2apic|\
--ibpb-on-vm-entry|--ibpb-on-vm-exit|--spec-ctrl|--audioin|\
--audioout|--l1d-flush-on-sched|--l1d-flush-on-vm-entry|\
--mds-clear-on-sched|--mds-clear-on-vm-entry|\
--nested-hw-virt|--system-uuid-le)
COMPREPLY=( $(compgen -W "on off" -- ${cur}) ) COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
;; ;;
@@ -2011,7 +2063,7 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "ich9 piix3" -- ${cur}) ) COMPREPLY=( $(compgen -W "ich9 piix3" -- ${cur}) )
;; ;;
--biosbootmenu) --bios-boot-menu)
COMPREPLY=( $(compgen -W "disabled menuonly COMPREPLY=( $(compgen -W "disabled menuonly
messageandmenu" -- ${cur}) ) messageandmenu" -- ${cur}) )
;; ;;
@@ -2023,15 +2075,16 @@ _VBoxManage() {
--nic[1-8]) --nic[1-8])
COMPREPLY=( $(compgen -W "none null nat bridged intnet COMPREPLY=( $(compgen -W "none null nat bridged intnet
hostonly generic natnetwork" -- ${cur}) ) hostonly hostonlynet generic natnetwork cloud" \
-- ${cur}) )
;; ;;
--nictype[1-8]) --nic-type[1-8])
COMPREPLY=( $(compgen -W "Am79C970A Am79C973 Am79C960 COMPREPLY=( $(compgen -W "Am79C970A Am79C973 82540EM
82540EM 82543GC 82545EM virtio" -- ${cur}) ) 82543GC 82545EM virtio" -- ${cur}) )
;; ;;
--nicpromisc[1-8]) --nic-promisc[1-8])
COMPREPLY=( $(compgen -W "deny allow-vms allow-all" \ COMPREPLY=( $(compgen -W "deny allow-vms allow-all" \
-- ${cur}) ) -- ${cur}) )
;; ;;
@@ -2043,7 +2096,7 @@ _VBoxManage() {
COMPREPLY+=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY+=( $(compgen -W "$result" -- ${cur}) )
;; ;;
--bridgeadapter[1-8]) --bridge-adapter[1-8])
COMPREPLY=() COMPREPLY=()
_bridgedif_comp _bridgedif_comp
_get_excluded_items "none" _get_excluded_items "none"
@@ -2067,16 +2120,16 @@ _VBoxManage() {
_natnet_comp _natnet_comp
;; ;;
--natnet[1-8]) --nat-net[1-8])
COMPREPLY=() COMPREPLY=()
_natnet_comp _natnet_comp
;; ;;
--natpf[1-8]) --nat-pf[1-8])
COMPREPLY=( $(compgen -W "delete" -- ${cur}) ) COMPREPLY=( $(compgen -W "delete" -- ${cur}) )
;; ;;
--nataliasmode[1-8]) --nat-alias-mode[1-8])
COMPREPLY=( $(compgen -W "default" -- ${cur}) ) COMPREPLY=( $(compgen -W "default" -- ${cur}) )
;; ;;
@@ -2086,7 +2139,7 @@ _VBoxManage() {
--mouse) --mouse)
COMPREPLY=( $(compgen -W "ps2 usb usbtablet COMPREPLY=( $(compgen -W "ps2 usb usbtablet
usbmultitouch" -- ${cur}) ) usbmultitouch usbmtscreenpluspad" -- ${cur}) )
;; ;;
--keyboard) --keyboard)
@@ -2097,36 +2150,32 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "off" -- ${cur}) ) COMPREPLY=( $(compgen -W "off" -- ${cur}) )
;; ;;
--uartmode[1-2]) --uart-mode[1-2])
COMPREPLY=( $(compgen -W "disconnected server client COMPREPLY=( $(compgen -W "disconnected serverpipe
tcpserver tcpclient file" -- ${cur}) ) clientpipe tcpserverport tcpclienthostname:port
filefilename device-name" -- ${cur}) )
;; ;;
--uarttype[1-2]) --uart-type[1-2])
COMPREPLY=( $(compgen -W "16450 16550A COMPREPLY=( $(compgen -W "16450 16550A
16750" -- ${cur}) ) 16750" -- ${cur}) )
;; ;;
--audio) --audio)
COMPREPLY=( $(compgen -W "none null oss alsa pulse" \ COMPREPLY=( $(compgen -W "none null dsound was oss alsa
-- ${cur}) ) pulse coreaudio" -- ${cur}) )
;; ;;
--audiocontroller) --audio-controller)
COMPREPLY=( $(compgen -W "ac97 hda sb16" -- ${cur}) ) COMPREPLY=( $(compgen -W "ac97 hda sb16" -- ${cur}) )
;; ;;
--audiocodec) --audio-codec)
COMPREPLY=( $(compgen -W "stac9700 ad1980 stac9221 COMPREPLY=( $(compgen -W "stac9700 ad1980 stac9221
sb16" -- ${cur}) ) sb16" -- ${cur}) )
;; ;;
--clipboard-mode) --clipboard-mode|--drag-and-drop)
COMPREPLY=( $(compgen -W "disabled hosttoguest
guesttohost bidirectional" -- ${cur}) )
;;
--draganddrop)
COMPREPLY=( $(compgen -W "disabled hosttoguest COMPREPLY=( $(compgen -W "disabled hosttoguest
guesttohost bidirectional" -- ${cur}) ) guesttohost bidirectional" -- ${cur}) )
;; ;;
@@ -2141,7 +2190,7 @@ _VBoxManage() {
-- ${cur}) ) -- ${cur}) )
;; ;;
--paravirtprovider) --paravirt-provider)
COMPREPLY=( $(compgen -W "none default legacy minimal COMPREPLY=( $(compgen -W "none default legacy minimal
hyperv kvm" -- ${cur}) ) hyperv kvm" -- ${cur}) )
;; ;;
@@ -2150,28 +2199,77 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "0 1 2 3" -- ${cur}) ) COMPREPLY=( $(compgen -W "0 1 2 3" -- ${cur}) )
;; ;;
# TODO: figure out right completion for:
# host | Intel 8086 | Intel 80286 | Intel 80386
--cpu-profile) --cpu-profile)
COMPREPLY=( $(compgen -W "host 8086 80286 80386" \ COMPREPLY=( $(compgen -W "host 8086 80286 80386" \
-- ${cur}) ) -- ${cur}) )
;; ;;
--biosapic) --bios-apic)
COMPREPLY=( $(compgen -W "disabled apic x2apic" \ COMPREPLY=( $(compgen -W "disabled apic x2apic" \
-- ${cur}) ) -- ${cur}) )
;; ;;
--teleporterpasswordfile|--iconfile|--recordingfile)
COMPREPLY=( $(compgen -f -- ${cur}) ) --teleporter-password-file|--icon-file|--recording-file|\
;; --bios-logo-image-path|--nic-trace-file[1-8]|\
--nictracefile[1-8]) --nat-tftp-file[1-8])
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
--nattftpfile[1-8])
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
;; ;;
--vm-process-priority) --vm-process-priority)
COMPREPLY=( $(compgen -W "default flat low normal high" \ COMPREPLY=( $(compgen -W "default flat low normal high" \
-- ${cur}) ) -- ${cur}) )
;; ;;
--recording-screens)
COMPREPLY=( $(compgen -W "all none" -- ${cur}) )
;;
--cloud-network[1-4]=network-name)
COMPREPLY=( )
;;
--default-frontend)
COMPREPLY=( $(compgen -W "default" -- ${cur}) )
;;
--guest-debug-io-provider)
COMPREPLY=( $(compgen -W "none tcp udp ipcdefault" \
-- ${cur}) )
;;
--guest-debug-provider)
COMPREPLY=( $(compgen -W "none native gdb kd" \
-- ${cur}) )
;;
--iommu)
COMPREPLY=( $(compgen -W "none automatic amd intel" \
-- ${cur}) )
;;
--snapshot-folder)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
;;
--teleporter-address)
COMPREPLY=( )
;;
--tpm-type)
COMPREPLY=( $(compgen -W "none 1.2 2.0 host swtpm" \
-- ${cur}) )
;;
--vrde-auth-type)
COMPREPLY=( $(compgen -W "null external guest" \
-- ${cur}) )
;;
--vrde-extpack)
COMPREPLY=( $(compgen -W "default" -- ${cur}) )
;;
esac esac
fi fi
;; ;;
@@ -2235,6 +2333,14 @@ _VBoxManage() {
COMPREPLY=( $(compgen -o plusdirs -f -X '!*.vbox' -- ${cur}) ) COMPREPLY=( $(compgen -o plusdirs -f -X '!*.vbox' -- ${cur}) )
[[ ${#COMPREPLY[@]} = 1 && "${COMPREPLY[0]}" != *".vbox" ]] && \ [[ ${#COMPREPLY[@]} = 1 && "${COMPREPLY[0]}" != *".vbox" ]] && \
COMPREPLY[0]="${COMPREPLY[0]}/" COMPREPLY[0]="${COMPREPLY[0]}/"
else
if [[ $prev == "--passwordfile" ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
else
local items=( --passwordfile )
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi
fi fi
;; ;;
@@ -2304,7 +2410,7 @@ _VBoxManage() {
case "${subcommand}" in case "${subcommand}" in
add) add)
items=(--name --hostpath --transient --readonly items=(--name --hostpath --transient --readonly
--automount) --automount --auto-mount-point)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
@@ -2350,18 +2456,16 @@ _VBoxManage() {
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms _vms_comp vms
else else
if [[ " ${COMP_WORDS[@]} " == *" --log "* ]]; then local items=( --details --machinereadable --log --password-id
COMPREPLY=() --password --password-idid --passwordfile )
elif [[ " ${COMP_WORDS[@]} " == *" --details "* || _get_excluded_items "${items[@]}"
" ${COMP_WORDS[@]} " == *" --machinereadable "* ]]; then COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
local items=(--details --machinereadable)
_get_excluded_items "${items[@]}" case "${prev}" in
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) --log|--passwordfile)
else COMPREPLY=( $(compgen -f -- ${cur}) )
local items=(--details --machinereadable --log) ;;
_get_excluded_items "${items[@]}" esac
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi
fi fi
;; ;;