hashicorp/vagrant · warning
The `privileged` setting for option `run` for trigger comman
Error message
The `privileged` setting for option `run` for trigger command '%{command}' will be ignored and set to false. What it means
A trigger's `run` option executes a host-side shell command where the shell provisioner's `privileged` flag has no meaning. When run.privileged == true, validation warns that it will be ignored and set to false for the host execution.
Source
Thrown at plugins/kernel_v2/config/vm_trigger.rb:238
trigger: @command,
types: VALID_TRIGGER_TYPES.join(', '))
end
if @type == :command || !@type
commands = Vagrant.plugin("2").manager.commands.keys.map(&:to_s)
if !commands.include?(@command) && @command != :all
machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning",
cmd: @command))
end
end
if @run
errorz = @run.validate(machine)
errors.concat errorz["shell provisioner"] if !errorz.empty?
if @run.privileged == true
machine.ui.warn(I18n.t("vagrant.config.triggers.privileged_ignored",
command: @command))
end
if @run.powershell_args != ""
machine.ui.warn(I18n.t("vagrant.config.triggers.powershell_args_ignored"))
end
end
if @run_remote
errorz = @run_remote.validate(machine)
errors.concat errorz["shell provisioner"] if !errorz.empty?
end
if @name && !@name.is_a?(String)
errors << I18n.t("vagrant.config.triggers.name_bad_type", cmd: @command)
end
if @info && !@info.is_a?(String)View on GitHub (pinned to 35f3160f4a)
Solutions
- Remove privileged from the run option hash (it is ignored for host-side execution)
- If you actually need privileged execution in the guest, use `t.run_remote = { inline: "...", privileged: true }`, which runs through the shell provisioner on the machine
Example fix
# before
config.trigger.after :up do |t|
t.run = { inline: "echo hi", privileged: true }
end
# after (needs privilege in the guest)
config.trigger.after :up do |t|
t.run_remote = { inline: "echo hi", privileged: true }
end Defensive patterns
Strategy: validation
Validate before calling
# Lint trigger run hashes: no privileged key allowed raise "privileged is ignored for trigger run" if trigger_run.key?(:privileged)
Type guard
host_run_options = ->(h) { h.slice(:inline, :path, :args, :env, :powershell_elevated) } # privileged belongs only to run_remote Prevention
- Keep separate mental models: run = host-side, run_remote = guest-side provisioner
- Only copy option hashes into run_remote
- Need root on the host? Handle elevation inside the inline command instead
When it happens
Trigger: A trigger block containing `t.run = { inline: "...", privileged: true }` in a Vagrantfile; the check runs during trigger validation.
Common situations: Copy-pasting shell-provisioner option hashes into trigger run options; assuming host-side commands can elevate via privileged.
Related errors
- The setting `powershell_args` is not supported for the trigg
- There was an error parsing the Vagrantfile: No config was gi
- vagrant.trigger.abort
- The command '%{cmd}' was not found for this trigger.
- `false` is not a valid option for the `abort` option for a t
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/3ee351721be89393.
Report an issue: GitHub.