From 2faf976236a816719999e2465ae966e487a35eac Mon Sep 17 00:00:00 2001 From: Dmitry Borodaenko Date: Fri, 31 Oct 2014 12:50:36 -0700 Subject: [PATCH] Parametrize headless option for VirtualBox If you need to start VirtualBox VMs without a GUI, for example, on a remote computer, you can now set the 'headless' parameter in config.sh to '1'. DocImpact Closes-Bug: #1304345 Change-Id: I868fa67335506a5e048d37411f5d5795b560a338 --- config.sh | 3 +++ functions/vm.sh | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.sh b/config.sh index 45cd20e..8d25924 100755 --- a/config.sh +++ b/config.sh @@ -178,3 +178,6 @@ fi vm_slave_first_disk_mb=65535 vm_slave_second_disk_mb=65535 vm_slave_third_disk_mb=65535 + +# Set to 1 to run VirtualBox in headless mode +headless=0 diff --git a/functions/vm.sh b/functions/vm.sh index c620e78..6a3cff8 100755 --- a/functions/vm.sh +++ b/functions/vm.sh @@ -159,8 +159,11 @@ start_vm() { name=$1 # Just start it - #VBoxManage startvm $name --type headless - VBoxManage startvm $name + if [[ $headless == 1 ]]; then + VBoxManage startvm $name --type headless + else + VBoxManage startvm $name + fi } mount_iso_to_vm() {