Linux startup

Posted on 2014-11-18
Last Modified: 2014-11-21
I want to start a virtualbox virtual machine at startup in Lubuntu. I created my virtual machine, and in Lubuntu, in xterm, if I run

/usr/bin/VirtualBox --startvm vm1 --fullscreen

it starts the virtual machine no problem. So I made a VERY simple script, ( I'm embarrassed to say I made a script. That would suggest I know HOW to script, which I don't ) but anyhow, the "script" is  

/usr/bin/VirtualBox --startvm vm1 --fullscreen

and I saved it to


and in xterm, I run


and again, it starts and runs the virtual machine, no problems. So I read that if you put commands in


above the exit 0 line, it will run the command at startup. I also saw that you need the '&' (without quotes ) after the command to make it run in the background so that Lubuntu can continue to load, and not wait for your command. I tried

/usr/bin/VirtualBox --startvm vm1 --fullscreen &

above the exit 0 line, which didn't work, and tried


above the exit 0 line, and it still doesn't start the virtual machine.
Any ideas what I am doing wrong?
Question by:JeffBeall
  • 3
  • 2
LVL 34

Expert Comment

by:Seth Simmons
ID: 40451368
what linux distribution and version are we working with here?

Author Comment

ID: 40451430
Lubuntu version 14.10 64 bit

Expert Comment

ID: 40452268
How do you know that VM did not start?
Ampersand (&) at the end of the command means that process runs as daemon (in background), so it doesn' have console connected.
What is the output of
ps ax | grep Virtual

Open in new window

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline


Author Comment

ID: 40454062
ps ax | grep Virtual


2064 pts/3   S+   0:00 grep --color=auto Virtual

and the word Virtual is red.

Accepted Solution

slubek earned 500 total points
ID: 40454396
I don't know much about Lubuntu, but maybe you shuld use VBoxHeadless?
$ VBoxHeadless -startvm "VMName"

Open in new window


Author Closing Comment

ID: 40458157
thank you.

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now