Skip to content

Instantly share code, notes, and snippets.

@everm1nd
Created September 6, 2016 10:42
Show Gist options
  • Save everm1nd/9de0f146a7601391df575493ee57a014 to your computer and use it in GitHub Desktop.
Save everm1nd/9de0f146a7601391df575493ee57a014 to your computer and use it in GitHub Desktop.
Kill VBoxHeadless process in a hard way
# this is quite useful when Vagrant hangs and have no response for your commands via CLI
if [[ $(pgrep VBoxHeadless) ]]; then
echo 'Found VBoxHeadless processes:'
pgrep VBoxHeadless
echo 'Terminating...'
pkill -9 VBoxHeadless
if [[ $(pgrep VBoxHeadless) ]]; then
echo 'Still found VBoxHeadless running. Check this PIDs:'
pgrep VBoxHeadless
else
echo 'All processes killed. Yay!'
fi
else
echo 'No VBoxProcesses found'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment