Vagrant: `vagrant up` turning on internal mic on macOS 10.14.1 Mojave

Created on 19 Nov 2018  ·  5Comments  ·  Source: hashicorp/vagrant

Vagrant version

Vagrant 2.2.1

Host operating system

macOS 10.14.1 Mojave

Guest operating system

https://box.scotch.io/

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

  config.vm.box = "scotch/box"
  config.vm.network "private_network", ip: "192.168.33.10"
  config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

  ## Project-specific settings
  config.vm.hostname = "my.domain.dev"
  config.vm.provision :shell, path: "bootstrap.sh"

end

Please note, if you are using Homestead or a different Vagrantfile format, we
may be unable to assist with your issue. Try to reproduce the issue using a
vanilla Vagrantfile first.

Debug output

Provide a link to a GitHub Gist containing the complete debug output:
https://gist.github.com/johnstephens/15a2043de3bd2fc3e802fe56c121c6c4

Expected behavior

I expect the virtual machine to boot without activating my internal microphone.

Actual behavior

About midway through booting my virtual machine, the internal mic on my computer becomes active.

Steps to reproduce

  1. vagrant up
providevirtualbox

Most helpful comment

@johnstephens Yes, this is from the scotch/box settings. From the box.ovf file it shows that it enables audio, but does not disable audioin so it is enabled by default:

<AudioAdapter driver="CoreAudio" enabled="true"/>

You can compare this with the bento/ubuntu-18.04 box which has audio enabled, but disables both audioin and audioout:

<AudioAdapter driver="CoreAudio" enabled="true" enabledIn="false" enabledOut="false"/>

After I spin the scotch/box up locally, I can go into the VirtualBox GUI and open the settings for the newly created guest. Under the audio section, there are two checkboxes for extended features that are "Enable Audio Output" and "Enable Audio Input". By default both of these are checked. After adding the customize above and running a vagrant reload, the "Enable Audio Input" is no longer checked.

Another option you can try if that is not working for you is to simply disable audio completely for the guest:

Vagrant.configure("2") do |config|
  config.vm.box = "scotch/box"
  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--audio", "none"]
  end
end

Please note in the customize line above the :id value should not be changed, it is a special value that is automatically replaced when the command is run.

Cheers!

All 5 comments

Hi there,

The setting will be dependent on the box in use. Vagrant does not do any modification to audio settings by default. You can disable audio in by using the customize option in your Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "scotch/box"
  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--audioin", "off"]
  end
end

Cheers!

Thank you, @chrisroberts!
This came as a surprise to me because I never saw my internal microphone get activated by launching a virtual machine before upgrading to Mojave. I'm delighted to learn that it's configurable!

I tried using the _exact_ configuration you set forth above—without anything else from my own Vagrantfile—and launching the box still turns on my internal mic.

I've looked over the documentation for VBoxManage here— https://www.virtualbox.org/manual/ch08.html —and I couldn't find anything obvious to help me troubleshoot this. I also examined my application preferences for VirtualBox, and couldn't find any relevant settings to toggle.

Would you suspect that this behavior is introduced by scotch/box? Is there anything else you could suggest that I look into?

Thank you again, and thanks in advance for _any_ guidance you can offer!

@johnstephens Yes, this is from the scotch/box settings. From the box.ovf file it shows that it enables audio, but does not disable audioin so it is enabled by default:

<AudioAdapter driver="CoreAudio" enabled="true"/>

You can compare this with the bento/ubuntu-18.04 box which has audio enabled, but disables both audioin and audioout:

<AudioAdapter driver="CoreAudio" enabled="true" enabledIn="false" enabledOut="false"/>

After I spin the scotch/box up locally, I can go into the VirtualBox GUI and open the settings for the newly created guest. Under the audio section, there are two checkboxes for extended features that are "Enable Audio Output" and "Enable Audio Input". By default both of these are checked. After adding the customize above and running a vagrant reload, the "Enable Audio Input" is no longer checked.

Another option you can try if that is not working for you is to simply disable audio completely for the guest:

Vagrant.configure("2") do |config|
  config.vm.box = "scotch/box"
  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--audio", "none"]
  end
end

Please note in the customize line above the :id value should not be changed, it is a special value that is automatically replaced when the command is run.

Cheers!

Thank you! Disabling audio entirely using the --audio "none" flag seems to have worked.

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings