{"record":{"id":"3ee351721be89393","repo":"hashicorp/vagrant","slug":"the-privileged-setting-for-option-run-for-trig","errorCode":null,"errorMessage":"The `privileged` setting for option `run` for trigger command '%{command}' will be ignored and set to false.","messagePattern":"The `privileged` setting for option `run` for trigger command '%(.+?)' will be ignored and set to false\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugins/kernel_v2/config/vm_trigger.rb","lineNumber":238,"sourceCode":"                           trigger: @command,\n                           types: VALID_TRIGGER_TYPES.join(', '))\n        end\n\n        if @type == :command || !@type\n          commands = Vagrant.plugin(\"2\").manager.commands.keys.map(&:to_s)\n\n          if !commands.include?(@command) && @command != :all\n            machine.ui.warn(I18n.t(\"vagrant.config.triggers.bad_command_warning\",\n                                  cmd: @command))\n          end\n        end\n\n        if @run\n          errorz = @run.validate(machine)\n          errors.concat errorz[\"shell provisioner\"] if !errorz.empty?\n\n          if @run.privileged == true\n            machine.ui.warn(I18n.t(\"vagrant.config.triggers.privileged_ignored\",\n                                  command: @command))\n          end\n\n          if @run.powershell_args != \"\"\n            machine.ui.warn(I18n.t(\"vagrant.config.triggers.powershell_args_ignored\"))\n          end\n        end\n\n        if @run_remote\n          errorz = @run_remote.validate(machine)\n          errors.concat errorz[\"shell provisioner\"] if !errorz.empty?\n        end\n\n        if @name && !@name.is_a?(String)\n          errors << I18n.t(\"vagrant.config.triggers.name_bad_type\", cmd: @command)\n        end\n\n        if @info && !@info.is_a?(String)","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/kernel_v2/config/vm_trigger.rb#L220-L256","documentation":"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.","triggerScenarios":"A trigger block containing `t.run = { inline: \"...\", privileged: true }` in a Vagrantfile; the check runs during trigger validation.","commonSituations":"Copy-pasting shell-provisioner option hashes into trigger run options; assuming host-side commands can elevate via privileged.","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"],"exampleFix":"# before\nconfig.trigger.after :up do |t|\n  t.run = { inline: \"echo hi\", privileged: true }\nend\n# after (needs privilege in the guest)\nconfig.trigger.after :up do |t|\n  t.run_remote = { inline: \"echo hi\", privileged: true }\nend","handlingStrategy":"validation","validationCode":"# Lint trigger run hashes: no privileged key allowed\nraise \"privileged is ignored for trigger run\" if trigger_run.key?(:privileged)","typeGuard":"host_run_options = ->(h) { h.slice(:inline, :path, :args, :env, :powershell_elevated) } # privileged belongs only to run_remote","tryCatchPattern":null,"preventionTips":["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"],"tags":["vagrant","triggers","privileged","run-option"],"backgroundTag":"ignored-config-option","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}