Monday, November 21, 2011

How to automatically start up a virtual machine in linux

I use ubuntu with fluxbox as my windows manger, so to automatically start an application, just do the following thing:

 1. Create a bash script to start the virtual machine named xpall
 root@dara-desktop:/home/dara/.fluxbox# cat /usr/bin/startup.sh
#!/bin/bash
echo darax | sudo -S vboxheadless -s xpall &

2. Store the script in /usr/bin/startup.sh with executable permission (755)
root@dara-desktop:/home/dara/.fluxbox# which startup.sh
/usr/bin/startup.sh



3. in fluxbox the start up file is ~/.fluxbox/apps , so add the last line in order to start our script automatically when we log in.
root@dara-desktop:/home/dara/.fluxbox# cat apps
[app] (name=fbrun)
  [Position]    (WINCENTER)    {0 0}
  [Layer]    {2}
[end]
[startup] {startup.sh}


----------------------------------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment