Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 17-Feb-2008, 03:19
Arcath
Guest
 
Posts: n/a
Default

There are a few steps to launching a program, so i decided id put all the commands i need into a bash command, but one of the commands needs to be run as root. so i thought no problem i just sudo it. But the command needs to be run in X so it doesnt ask for the root password, it just skips the command and launchs the app which promptly breaks.

So how in a bash command do i open the nice looking run command a super user dialog?

the command that i need to run is:

Code:
/etc/init.d/vboxdrv start
  #2 (permalink)  
Old 17-Feb-2008, 03:59
WJM
Guest
 
Posts: n/a
Default

If you want to launch programs in X for GNOME and KDE there are two commands you can use use, gnomesu and kdesu.

For the Virtual Box driver it could be easier to just add it as a module that gets loaded at boot using YaST > /etc/sysconfig Editor > System > Kernel > MODULES_LOADED_ON_BOOT , and file this last parameter vboxdrv (unless you don't always want it loaded).

Cheers,
Wj
  #3 (permalink)  
Old 17-Feb-2008, 04:27
Arcath
Guest
 
Posts: n/a
Default

yeah i was typing on auto pilot im gonna change "start" to "setup" so that i dont have to duck into terminal after kernel update to recompile the driver.
  #4 (permalink)  
Old 17-Feb-2008, 04:43
WJM
Guest
 
Posts: n/a
Default

Quote:
yeah i was typing on auto pilot im gonna change "start" to "setup" so that i dont have to duck into terminal after kernel update to recompile the driver.
[/b]
Ahh ok... that sounds like a good script It would be good when they find a solution that keeps track of what drivers and modules get added/setup with a certain kernel version so they automatically get re-added when updating the kernel.
But if it where that simple I guess it would have been there already.

Cheers,
Wj
  #5 (permalink)  
Old 18-Feb-2008, 03:21
Arcath
Guest
 
Posts: n/a
Default

ok this is the script that i wrote, it recompiles the Virtual Box Kernel module and then launches the given VM

Code:
#!/bin/bash
gnomesu /etc/init.d/vboxdrv setup
VBoxManage startvm "WindowsXP"
the "WindowsXP" bit need to be changed to the name of the VM that you are trying to boot.
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2