start script with sudo rights
I have a script to load needed kernel modules and then start virtualbox with 'default' image. It works fine if started from command line, but fails when started through a keyboard shortcut.
Edit:
The problem seems to be that the kernel modules are not loaded in the same shell virtualbox is started. How can I start a (temporary) shell with sudo rights through bindsym shortcut?
line to start script in ~/.3/config
set psst --no-startup-id
bindsym $sup+b exec $psst sudo -u $USER sh -c /develop/scripts/start-vbox.sh
bash script: start-vbox.sh
#!/bin/bash
########################################
# script to start virtual box
# automatically load kernel modules
# and start virtual win7 image
########################################
cd /home/can/develop/scripts
# load kernel module
sudo modprobe vboxdrv
sudo modprobe -a vboxnetadp vboxnetflt
# start vbox with defined image
vboxmanage startvm Win7x64
Please excuse me, if a similar question already has been posted, but I couldn't figure it out yet.