Skip to content

Ghaf Kill Switch

ghaf-killswitch is a command-line utility in Ghaf that enables runtime toggling of certain hardware devices. It supports listing known devices, disabling (blocking) them, and re-enabling (unblocking) them. This capability is useful for privacy control, resource isolation or dynamic hardware management within the Ghaf host/VM architecture.

It currently supports three device types:

KeywordDescription
micInternal Audio & microphone PCI devices (used by the audio-vm)
netWLAN / network PCI device (used by the net-vm)
camInternal camera device (used by the business-vm)
bluetoothBluetooth device (used by the audio-vm)

Note: Some hardware platforms may already include a physical camera kill switch (e.g. via Fn-key) which overrides software control.


Run ghaf-killswitch to control devices. General usage:

Terminal window
[ghaf@ghaf-host:~]$ sudo ghaf-killswitch <command> [device]

Where <command> is:

  • list — show all supported devices for kill switch functionality
  • block <device> — disable / remove the specified device
  • unblock <device> — enable / add the specified device
  • block --all - disable / remove all supported devices
  • unblock --all - enable / add all supported devices
  • status - Show block/unblock status of devices
  • help — show usage instructions
Terminal window
[ghaf@gui-vm:~]$ ghaf-killswitch list
Terminal window
[ghaf@gui-vm:~]$ ghaf-killswitch block mic

Run the below command to confirm:

Terminal window
[ghaf@gui-vm:~]$ nix-shell -p pulseaudio --run "pactl list sources short"
Terminal window
[ghaf@gui-vm:~]$ ghaf-killswitch block net

Check inside net-vm or GUI to confirm:

Terminal window
[ghaf@net-vm:~]$ nmcli device status
Terminal window
[ghaf@gui-vm:~]$ ghaf-killswitch block cam

Check inside business-vm to confirm:

Terminal window
[ghaf@business-vm:~]$ lsusb
Terminal window
[ghaf@gui-vm:~]$ ghaf-killswitch block bluetooth

Check inside audio-vm to confirm:

Terminal window
[ghaf@business-vm:~]$ lsusb
Terminal window
[ghaf@gui-vm:~]$ ghaf-killswitch status
mic: unblocked
net: unblocked
cam: blocked
bluetooth: blocked
Terminal window
[ghaf@gui-vm:~]$ ghaf-killswitch block --all
Terminal window
[ghaf@gui-vm:~]$ ghaf-killswitch unblock --all
  • GUI anomalies — audio UI elements may misbehave when mic is disabled.
  • Disabling the microphone will stop only internal audio playback and audio recording functionality.
  • Support for blocking external USB devices like camera, microphone is currently unavailable.