Import device command/script for VirtualBox policy

molly_short
New Contributor

Hi,

I'm trying to accomplish the following: I've got a policy in Jamf that allows users to download the VirtualBox application from Self Service (that part works fine). When the application gets installed to an endpoint, I'd like to then import a device into VirtualBox.

I exported the device from VirtualBox as a .ova file, then created a package with this file via Composer and uploaded into Jamf, but for the life of me, I cannot get it to import. I've tried:

  • In the VirtualBox policy that contains the device package, using Files and Processes>Execute Command

vboxmanage import /Users/Shared/google_nexus_10.ova

(note: this command accomplishes the desired result when ran locally from Terminal)

  • Including this script in the policy to run "After" the device package installs

!/bin/bash

vboxmanage import /Users/Shared/google_nexus_10.ova

  • I also tried packaging the device in Composer with the above script as a postinstall

The Jamf policy details show the import command and script attempts as running successfully, however, the device does not actually import.

I'm tapped out with both my limited knowledge of scripting and Jamf, so truly any suggestions would be appreciated!

1 REPLY 1

molly_short
New Contributor

Jeremy Nelson from Jamf was able to resolve my issue. If anyone is curious, the fix was to run the script as the current user. So that resulted in this:

user=stat -f '%Su' /dev/console

su $user vboxmanage import /Users/Shared/google_nexus_10.ova