This script enables you to autocomplete command-line arguments when using
the VBoxManage
tool of VirtualBox with
Bash.
We recommend you install Homebrew. For a cleaner install,
we also recommend that you install Homebrew Cask and
then install VirtualBox with it, just running brew cask install virtualbox
.
Once you have Homebrew, install its general Bash completion infrastructure:
brew install bash-completion
Then, install this script:
cd $(brew --prefix)/etc/bash_completion.d
curl -LO https://raw.githubusercontent.com/bgandon/bash-completion-virtualbox/master/vboxmanage_completion.bash
As an alternative, you can install this script from a Git clone, which can help if you whant to share your improvements to the world:
mkdir ~/workspace && cd ~/workspace
git clone [email protected]:tfmalt/bash-completion-virtualbox.git
ln -s `pwd`/bash-completion-virtualbox/vboxmanage_completion.bash /usr/local/etc/bash_completion.d/
On OS X, a Homebrew Formula is still to be made.
You first need the bash completion infrastructure. Most Linux distributions have it installed by default. If not, then install it:
- Run
apt-get install bash-completion
on Debian-based distributions - Run
yum --enablerepo=epel install bash-completion.noarch
on CentOS, or equivalent for other RedHat-based distributions.
Copy the file vboxmanage_completion.bash
from this repo into /etc/bash_completion.d/
.
This folder contains the system completions configurations that will be run by
the new shells you'll open later.
cd /etc/bash_completion.d
sudo curl -LO https://raw.githubusercontent.com/bgandon/bash-completion-virtualbox/master/vboxmanage_completion.bash
For the completion to work in your current shell, source the completion file with
source /etc/bash_completion.d/vboxmanage_completion.bash
Add the content of vboxmanage_completion.bash
in ~/.bash_completion
,
except the first she-bang line (the one that starts with #!
).
For the completion to work in your current shell, source the completion file with
source ~/.bash_completion
Copyright © 2012, Thomas Malt
Copyright © 2015, Benjamin Gandon
All rights reserved.
For more details, this code is under the BSD 2 Clause (NetBSD) license.